Commit 8ed1f7eb authored by Edward Andò's avatar Edward Andò
Browse files

Client fixes

parent 8e5606cf
Pipeline #1383 passed with stages
in 1 minute and 23 seconds
......@@ -55,7 +55,7 @@ for im1number in range( im4D.shape[0]-1 ):
im1 = im4D[ im1number ]
im2 = im4D[ im1number+1 ]
nodePositions = randomwaffle.DIC.grid.makeGrid( im1.shape, args.NS )
nodePositions, nodesDim = randomwaffle.DIC.grid.makeGrid( im1.shape, args.NS )
# Initialise field of Fs with the identity matrix
Ffield = numpy.zeros( ( nodePositions.shape[0], 4, 4 ) )
......@@ -96,9 +96,10 @@ for im1number in range( im4D.shape[0]-1 ):
if args.VTK:
cellData = {'pixelSearch-CC': pixelSearchCC,
'subpixel-displacements-xyz': Ffield[ :, -2::-1, 3 ],
'subpixel-error': subpixelError,
'subpixel-iterations': subpixelIterations,
'subpixel-returnStatus': subpixelReturnStatus,
'subpixel-error': subPixelReturns['subpixelError'],
'subpixel-iterations': subPixelReturns['subpixelIterations'],
'subpixel-returnStatus': subPixelReturns['subpixelReturnStatus'],
'subpixel-deltaFnorm': subPixelReturns['subpixelDeltaFnorm']
}
randomwaffle.helpers.rwvtk.write_structured_grid( (numpy.array( nodesDim )+1)[::-1], cell_data=cellData, filename=args.OUT_DIR+"/"+args.PREFIX+"-"+step+'.vtk')
......@@ -109,26 +110,31 @@ for im1number in range( im4D.shape[0]-1 ):
# F[0:3,0:2]
# Pixel-search CC
# SubPixError, SubPixIterations, SubPixelReturnStatus
outMatrix = numpy.array( [ numpy.array(range( nodePositions.shape[0] )),
nodePositions[:,0], nodePositions[:,1], nodePositions[:,2],
Ffield[:,0,3], Ffield[:,1,3], Ffield[:,2,3],
Ffield[:,0,0], Ffield[:,0,1], Ffield[:,0,2],
Ffield[:,1,0], Ffield[:,1,1], Ffield[:,1,2],
Ffield[:,2,0], Ffield[:,2,1], Ffield[:,2,2],
pixelSearchCC,
subpixelError, subpixelIterations, subpixelReturnStatus ] ).T
TSVheader = "NodeNumber\tZpos\tYpos\tXpos\tZdisp\tYdisp\tXdisp\tF11\tF12\tF13\tF21\tF22\tF23\tF31\tF32\tF33"
outMatrix = numpy.array( [ numpy.array(range( nodePositions.shape[0] )),
nodePositions[:,0], nodePositions[:,1], nodePositions[:,2],
Ffield[:,0,3], Ffield[:,1,3], Ffield[:,2,3],
Ffield[:,0,0], Ffield[:,0,1], Ffield[:,0,2],
Ffield[:,1,0], Ffield[:,1,1], Ffield[:,1,2],
Ffield[:,2,0], Ffield[:,2,1], Ffield[:,2,2] ] ).T
if args.PS:
outMatrix = numpy.hstack( [ outMatrix, numpy.array([pixelSearchCC]).T ] )
TSVheader = TSVheader+"\tPSCC"
if args.SUBPIXEL:
outMatrix = numpy.hstack([outMatrix, numpy.array( [ subPixelReturns['subpixelError'],
subPixelReturns['subpixelIterations'],
subPixelReturns['subpixelReturnStatus'],
subPixelReturns['subpixelDeltaFnorm'] ] ).T ] )
TSVheader = TSVheader+"\tSubPixError\tSubPixIterations\tSubPixReturnStat\tSubPixDeltaFnorm"
numpy.savetxt( args.OUT_DIR+"/"+args.PREFIX+"-"+step+".tsv",
outMatrix,
fmt = '%.7f',
delimiter= '\t',
newline = '\n',
comments = '',
header = "NodeNumber\tZpos\tYpos\tXpos\t"+
"Zdisp\tYdisp\tXdisp\t"+
"F11\tF12\tF13\t"+
"F21\tF22\tF23\t"+
"F31\tF32\tF33\t"+
"PS-CC\tSubPixError\tSubPixIterations\tSubPixReturnStat" )
header = TSVheader )
if args.TIF:
......
......@@ -43,7 +43,7 @@ if __name__ == "__main__":
fileName = sys.argv[1]
if os.path.isfile( fileName ):
tsvToTIFF( fileName )
tsvToTIFF( fileName, prefix=os.path.basename( fileName )[0:-4] )
else:
print( "\ttsvToTIFF(): {} is not a file".format( fileName ) )
......
......@@ -44,7 +44,7 @@ def makeGrid( imageSize, nodeSpacing ):
nodePositions[:,1] = nodesMgrid[1].ravel()
nodePositions[:,2] = nodesMgrid[2].ravel()
return nodePositions
return nodePositions, nodesDim
......@@ -326,5 +326,5 @@ def subPixel( im1, im2,
"subpixelError": subpixelError,
"subpixelIterations": subpixelIterations,
"subpixelReturnStatus": subpixelReturnStatus,
"subpixelDeltaFnorm": subpixelDeltaFnorm
"subpixelDeltaFnorm": subpixelDeltaFnorm,
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment