spinalcordtoolbox / manual-correction

Scripts for the manual correction of spinal cord labels
MIT License
4 stars 0 forks source link

`-change-orient` flag manipulates the original image #101

Open valosekj opened 4 months ago

valosekj commented 4 months ago

The recently added -change-orient flag (https://github.com/spinalcordtoolbox/manual-correction/pull/100) works as follows:

  1. Fetch the original orientation of the image and label
  2. Change the orientation of the image and label to the orientation specified by -change-orient
  3. Open the viewer
  4. Change the orientation of the image and label back to the original orientation

This works fine if all the steps are executed. However, when the correction process is interrupted, for example, by pressing ctrl + C during steps 2 and 3, the orientation of the image and label will stay changed. This might be suboptimal as we are manipulating the original image.

For now, I have cross-refed this issue to the -change-orient help (https://github.com/spinalcordtoolbox/manual-correction/commit/9a57a8e9564e26defb8bee2e94e92ba417268ea7). A long-term solution might involve creating a tmp directory, copying the original files and reorienting these copies.