In the General ANTs 3D slicer extension I noticed something rather odd. I can take one of the default parameter presets, say “QuickSyn”, change nothing, and click “save as preset”. The new .json preset saves in the correct folder, but comparing this file with the original shows one key difference: The initializationfeature switches from 1 to -2(yes minus 2, not 2!). See the line of code below.
Can anyone else recreate this? My two volumes have in fact already been very crudely aligned, so I would actually like there to be no initial transform. Is there a value for this, blank, or maybe just delete the command entirely from the .json file?
According to this website 0,1,2 do very different things. I have no idea what the minus sign does, but maybe it errors and prevents there from being any initial registration whatsoever? ”An initial moving transform is used to quickly align the images before registration. The optimization process requires images to roughly overlap and will fail if images are too far apart in physical space.
There are various options for the initialization:
0-match by mid-point (i.e., center voxel of one image will be brought in line with center voxel of the other)
1-match by center of mass
2-match by point of origin (i.e. physical coordinates 0,0,0, as defined by the image headers) The center of mass alignment usually works well.”
Original
},
“initialTransformSettings”: {
“initializationFeature”: 1
}
After saving (changed nothing in GUI
“initialTransformSettings”: {“initializationFeature”: -2}
There are still cases where this initial transform feature might be useful for me, so I tried to see if the values change anything using a dummy comfiguration that should’t move my image other than the this initial transform, but it doesn’t seem to do anything. Can anyone get this to work?
Also, still curious if anyone can reproduce this odd -2 initialization value writing during the preset save.
The meaning of the parameter values for -2 and -1 are:
-2: use no initialization transform, i.e. assume that the images are already nearly aligned
-1: use the transform from a supplied transform node as the starting point for registration
This does not appear to be documented anywhere, but I sorted this out by looking at the interface code and module code a while back.
It sounds like there is probably a bug in the code for saving or loading a preset, or possibly in the GUI update. What happens for you if you:
Load a preset like QuickSyN.
Change the initialization feature to something else and then change it back to what you want.
Save as a new preset
I wonder if something in the loading code is failing to fully update the transform initialization setting upon load, and then interprets nothing being set as -2.
Thanks. As far as I can tell the intialization feature can only be changed in the .json file not the GUI, so how to attempt this? Or maybe there is a field I’m missing in the GUI? So far I’ve started with the QuickSyN intitialization 1 .json file, resaving writes it to -2. If I create a new .json with any value (0,1,2) it doesn’t seem to move my image (similar to -2?).
Cheers
Oh funny. I had been ignoring that menu because I thought it was only for loading in custom intial transform files. If I change the values in the GUI it now has the expected consequeces on the registration. Interestingly though, no matter how many times I change it, when I save it in the GUI it writes a .json with the value -2. Maybe this is by design, maybe a bug?
But now that I understand the odd behavior, it seems like I can still get the full flexibility. I just need to remember to always manually change the initial transform in the GUI, if I don’t want the default -2 “no tranform” setting.