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()
### Otherwise we are in node spacing and half-window size mode
else:
ifargs.MASK1isnotNone:
im1mask=tifffile.imread(args.MASK1.name)!=0
iflen(im1mask.shape)==2:
im1mask=im1mask[numpy.newaxis,...]
else:
im1mask=None
ifargs.MASK2isnotNone:
im2mask=tifffile.imread(args.MASK2.name)!=0
iflen(im2mask.shape)==2:
im2mask=im2mask[numpy.newaxis,...]
else:
im2mask=None
# different checks to be done for lab and grid:
ifargs.LAB1isNone:
# In case NS is also defined, complain, but if it's the same as the loaded data, continue
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()
ifnodePositionsFileisNone:
else:# no Phi file
ifargs.LAB1isNone:
ifargs.NSisNone:
print("spam-pixelSearch: You're in regular grid mode, but no -ns is set and no Phi Field TSV has been passed, exiting.")