print(f"spam-ddic: Input PhiField positions from {args.PHIFILE.name} are not within 1px of the centre of mass of the labels from {args.lab1.name}, this seems dangerous.")
print(f"\tplease consider using spam-passPhiField to apply your PhiField to a new labelled image")
print(f"spam-pixelSearch: Input PhiField positions from {args.PHIFILE.name} are not within 1px of the centre of mass of the labels from {args.LAB1}, this seems dangerous.")
print(f"\tplease consider using spam-passPhiField to apply your PhiField to a new labelled image")
exit()
# Calculate the distance of the point of the current grid to the points of the input F field
help="Ratio of binning level between loaded Phi file and current calculation. If the input Phi file has been obtained on a 500x500x500 image and now the calculation is on 1000x1000x1000, this should be 2. Default = 1")
parser.add_argument('-F',
'--apply-F',
type=str,
default='all',
dest='APPLY_F',
help="Apply the F part of Phi guess? Accepted values are:\n\t\"all\": apply all of F"+
"\n\t\"rigid\": apply rigid part (mostly rotation) \n\t\"no\": don't apply it \"all\" is default")
# PFD now assumed to be true
#parser.add_argument('-pfd',
#'--phiFile-direct',
...
...
@@ -280,26 +288,31 @@ def ldicParser(parser):
raise
# Catch interdependent node spacing and correlation window sizes
ifargs.NSisNone:
print("\nUsing default node spacing: "),
ifargs.HWSisNone:
print("2x default half window size"),
args.HWS=[10]
print("({}) which is".format(args.HWS[0])),
args.NS=[args.HWS[0]*2]
else:
print("2x user-set half window size"),
iflen(args.HWS)==1:
print("({}) which is".format(args.HWS[0])),
args.NS=[int(args.HWS[0]*2)]
eliflen(args.HWS)==3:
print("({} -- selecting smallest) which is".format(args.HWS)),
args.NS=[int(min(args.HWS)*2)]
print(args.NS)
#if args.NS is None:
#print("\nUsing default node spacing: "),
#if args.HWS is None:
#print("2x default half window size"),
#args.HWS = [10]
#print("({}) which is".format(args.HWS[0])),
#args.NS = [args.HWS[0] * 2]
#else:
#print("2x user-set half window size"),
#if len(args.HWS) == 1:
#print("({}) which is".format(args.HWS[0])),
#args.NS = [int(args.HWS[0] * 2)]
#elif len(args.HWS) == 3:
#print("({} -- selecting smallest) which is".format(args.HWS)),
#args.NS = [int(min(args.HWS) * 2)]
#print(args.NS)
ifargs.HWSisNone:
print("spam-ldic: HWS must be defined.")
exit()
# Catch 3D options
iflen(args.NS)==1:
args.NS=[args.NS[0],args.NS[0],args.NS[0]]
## Catch 3D options
ifargs.NSisnotNone:
iflen(args.NS)==1:
args.NS=[args.NS[0],args.NS[0],args.NS[0]]
iflen(args.HWS)==1:
args.HWS=[args.HWS[0],args.HWS[0],args.HWS[0]]
...
...
@@ -312,7 +325,7 @@ def ldicParser(parser):
# Catch and overwrite 2D options
iftwoD:
args.NS[0]=1
ifargs.NSisnotNone:args.NS[0]=1
args.HWS[0]=0
args.MARGIN[0]=0
...
...
@@ -339,6 +352,9 @@ def ldicParser(parser):
#args.TSV = True
# Nor prefix here because LDIC can still do an image series and needs to update the name
ifargs.APPLY_Fnotin["all","rigid","no",]:
print("-F should be 'all' 'rigid' or 'no'")
exit()
returnargs
...
...
@@ -1988,20 +2004,6 @@ def pixelSearch(parser):
dest='PHIFILE_BIN_RATIO',
help="Ratio of binning level between loaded Phi file and current calculation. If the input Phi file has been obtained on a 500x500x500 image and now the calculation is on 1000x1000x1000, this should be 2. Default = 1")
parser.add_argument('-pfd',
'--phiFile-direct',
action="store_true",
#default=1,
dest='PHIFILE_DIRECT',
help="Trust the Phi file completely? This option ignores and overrides -pfni and requires same nodes in same positions. Default = False")
parser.add_argument('-pfni',
'--neighbours-for-phi-field-interpolation',
type=int,
default=6,
dest='NEIGHBOURS',
help="Number of neighbours for field interpolation. Default = 6")
parser.add_argument('-F',
'--apply-F',
type=str,
...
...
@@ -2157,33 +2159,38 @@ def pixelSearch(parser):
else:
# We are in grid, with a nodeSpacing and halfWindowSize
# Catch interdependent node spacing and correlation window sizes