ANTs
ANTs copied to clipboard
FEATURE IDEA: keyboard shortcut to trigger "--save-state saveSateAsTransform" and exit
Just a random feature idea, it might be useful to have a way to trigger a state save in case a registration is taking a very long time, or someone would like to check if their setup is working as expected.
This already exists.
-j, --save-state saveSateAsTransform
Specify the output file for the current state of the registration. The state
file is written to an hdf5 composite file. It is specially usefull if we want to
save the current state of a SyN registration to the disk, so we can load and
restore that later to continue the next registration process directly started
from the last saved state. The output file of this flag is the same as the
write-composite-transform, unless the last transform is a SyN transform. In that
case, the inverse displacement field of the SyN transform is also added to the
output composite transform. Again notice that this file cannot be treated as a
transform, and restore-state option must be used to load the written file by
this flag.
-k, --restore-state restoreStateAsATransform
Specify the initial state of the registration which get immediately used to
directly initialize the registration process. The flag is mutually exclusive
with other intialization flags.If this flag is used, none of the
initial-moving-transform and initial-fixed-transform cannot be used.
From: "Gabriel A. Devenyi" [email protected] Reply-To: stnava/ANTs [email protected] Date: Tuesday, October 27, 2015 at 3:46 PM To: stnava/ANTs [email protected] Subject: [ANTs] FEATURE IDEA: keyboard shortcut to trigger "--save-state saveSateAsTransform" and exit (#232)
Just a random feature idea, it might be useful to have a way to trigger a state save in case a registration is taking a very long time, or someone would like to check if their setup is working as expected.
— Reply to this email directly or view it on GitHub.
Yes, thanks, I know that, you'll notice I referred specifically to that flag in my title. I am proposing a way to trigger the saving, even if I may not have invoked such a flag on the commandline.
Furthermore, the command-line options make no mention of when the states are saved. So I have no idea if in the current implementation this is even useful to me.
Related to this, it would be very helpful if after completion of each stage if ANTs were to write out the transform results, to guard against out-of-memory issues or walltime issues.
Following up with this a bit more, implementing trap catching (like https://wiki.scinet.utoronto.ca/wiki/index.php/Programming_Concepts#Trapping_signals_in_C.2B.2B ) to save the transform state could in theory allow a kind of checkpointing in case of walltime issues on a compute cluster.