help="Greyscale image of reference state for correlation")
parser.add_argument('im2',
metavar='im2',
type=argparse.FileType('r'),
help="Greyscale image of deformed state for correlation")
parser.add_argument('gp',
metavar='gp',
type=argparse.FileType('r'),
help='Path to file containing the guiding points')
parser.add_argument('-mf1',
'--maskFile1',
dest='MASK1',
default=None,
type=argparse.FileType('r'),
help="Path to tiff file containing the mask of image 1 -- masks zones not to correlate, which should be == 0")
parser.add_argument('-mf2',
'--maskFile2',
dest='MASK2',
default=None,
type=argparse.FileType('r'),
help="Path to tiff file containing the mask of image 2 -- masks zones not to correlate, which should be == 0")
parser.add_argument('-mc',
'--mask-coverage',
type=float,
default=0.5,
dest='MASK_COVERAGE',
help="In case a mask is defined, tolerance for a subvolume's pixels to be masked before it is skipped with RS=-5. Default = 0.5")
parser.add_argument('-sr',
'--search-range',
nargs=6,
type=int,
default=[-3,3,-3,3,-3,3],
dest='SEARCH_RANGE',
help='Z- Z+ Y- Y+ X- X+ ranges (in pixels) for the pixel search. Default = +-3px')
# Default: window size equal in all three directions
parser.add_argument('-hws',
'--half-window-size',
nargs=1,
type=int,
default=10,
dest='HWS',
help="Half correlation window size (in pixels), measured each side of the node pixel (assumed equal in all 3 directions -- see -hws3 for different setting). Default = 10 px")
# Possible: window size different in all three directions
parser.add_argument('-hws3',
'--half-window-size-3',
nargs=3,
type=int,
default=[10,10,10],
dest='HWS',
help="Half correlation window size (in pixels), measured each side of the node pixel (different in 3 directions). Default = 10, 10, 10px")
#parser.add_argument('-ns3',
#'--node-spacing-3',
#nargs=3,
#type=int,
#default=None,
#dest='NS',
#help="Node spacing in pixels (different in 3 directions). Default = 10, 10, 10px")
parser.add_argument('-nr',
'--neighbourhood-radius',
type=float,
default=None,
dest='RADIUS',
help="Radius (in pixels) inside which to select neighbours. Default = mean(hws)+mean(sr)")
parser.add_argument('-gwd',
'--gaussian-weighting-distance',
type=float,
default=None,
dest='DIST',
help="Distance (in pixels) over which the neighbour's distance is weighted. Default = sum(hws)+sum(sr)")
parser.add_argument('-cct',
'--CC-threshold',
type=float,
default=0.9,
dest='CC_MIN',
help="Pixel search correlation coefficient threshold BELOW which the point is considered badly correlated. Default = 0.9")
parser.add_argument('-glt',
'--grey-low-threshold',
type=float,
default=-numpy.inf,
dest='GREY_LOW_THRESH',
help="Grey threshold on mean of reference imagette BELOW which the correlation is not performed. Default = -infinity")
parser.add_argument('-ght',
'--grey-high-threshold',
type=float,
default=numpy.inf,
dest='GREY_HIGH_THRESH',
help="Grey threshold on mean of reference imagette ABOVE which the correlation is not performed. Default = infinity")
parser.add_argument('-od',
'--out-dir',
type=str,
default=None,
dest='OUT_DIR',
help="Output directory, default is the dirname of im1 file")
parser.add_argument('-pre',
'--prefix',
type=str,
default=None,
dest='PREFIX',
help='Prefix for output files (without extension). Default is basename of im1 and im2 files')
# 2019-04-05 EA: 2D image detection approved by Christophe Golke, update for shape 2019-08-29
#tiff = tifffile.TiffFile(args.im1.name)
#if len(tiff.pages) == 1 and len(tiff.series[0].shape) == 2:
# twoD = True
#else:
# twoD = False
#tiff.close()
# If we have no out dir specified, deliver on our default promise -- this can't be done inline before since parser.parse_args() has not been run at that stage.
ifargs.OUT_DIRisNone:
args.OUT_DIR=os.path.dirname(args.im1.name)
# However if we have no dir, notice this and make it the current directory.