Coder Social home page Coder Social logo

error in ANTSUseLandmarkImagesToGetAffineTransform for Estimate transfo: straight anat --> template (affine landmark-based) about spinalcordtoolbox HOT 6 CLOSED

jcohenadad avatar jcohenadad commented on May 24, 2024
error in ANTSUseLandmarkImagesToGetAffineTransform for Estimate transfo: straight anat --> template (affine landmark-based)

from spinalcordtoolbox.

Comments (6)

jcohenadad avatar jcohenadad commented on May 24, 2024

Works with testing/data/errsm_23

from spinalcordtoolbox.

jcohenadad avatar jcohenadad commented on May 24, 2024

Tried with labels: C2-T2 (2-9) (instead of C2-T3: 2-10).

sct_register_to_template.py -i t2_crop.nii.gz -l landmarks_rpi_crop__C2-T2.nii.gz -m segmentation_binary_crop.nii.gz -s superfast -r 0

--> that worked!

from spinalcordtoolbox.

jcohenadad avatar jcohenadad commented on May 24, 2024

Tried with labels: C2-T4 (2-11)

sct_register_to_template.py -i t2_crop.nii.gz -l landmarks_rpi_crop__C2-T4.nii.gz -m segmentation_binary_crop.nii.gz -s superfast -r 0

--> that crashed!

ERROR!!! 
fix-label 21 movlabel 21
labels do not match -- exiting 
Exit program.

So it looks like it is not possible to input labels bigger than 9. This needs to be fixed

from spinalcordtoolbox.

jcohenadad avatar jcohenadad commented on May 24, 2024

Created labels with itksnap. And checked with:

sct_label_utils.py -i label_itksnap.nii.gz -t display-voxel

Values are now:

Position=(49,192,249) -- Value= 24
Position=(51,191,105) -- Value= 104
Position=(56,186,249) -- Value= 23
Position=(56,187,105) -- Value= 103
Position=(56,194,105) -- Value= 101
Position=(56,196,249) -- Value= 21
Position=(62,191,105) -- Value= 102
Position=(64,191,249) -- Value= 22

Instead of:

Position=(49,189,104) -- Value= 104.0
Position=(49,190,104) -- Value= 104.0
Position=(49,190,255) -- Value= 24.0
Position=(49,191,104) -- Value= 104.0
Position=(49,191,255) -- Value= 24.0
Position=(49,192,255) -- Value= 24.0
Position=(50,189,104) -- Value= 104.0
Position=(50,190,104) -- Value= 104.0
Position=(50,190,255) -- Value= 24.0
Position=(50,191,104) -- Value= 104.0
...

So the ".0" at the end seems to make the difference.

from spinalcordtoolbox.

jcohenadad avatar jcohenadad commented on May 24, 2024

Investigating datatype:
fslhd gives:

  • label_itksnap: UINT16
  • landmarks_rpi_cross3x3: INT32
  • landmarks_rpi_cross3x3_straight.nii.gz: FLOAT32
  • template_label_cross.nii.gz: INT32
  • template_label.nii.gz: UINT32

from spinalcordtoolbox.

jcohenadad avatar jcohenadad commented on May 24, 2024

Changed output datatype for UINT16. Command ran:

c3d ../t2_crop.nii.gz -o data.nii
c3d ../landmarks_rpi_crop.nii.gz -o landmarks.nii
c3d ../segmentation_binary_crop.nii.gz -o segmentation.nii
sct_orientation -i data.nii -o data_rpi.nii.gz -orientation RPI
sct_orientation -i landmarks.nii.gz -o landmarks_rpi.nii.gz -orientation RPI
sct_orientation -i segmentation.nii.gz -o segmentation_rpi.nii.gz -orientation RPI
sct_straighten_spinalcord.py -i data_rpi.nii.gz -c segmentation_rpi.nii.gz -r 1
sct_label_utils.py -t remove -i ${SCT_DIR}/data/template/landmarks_center.nii.gz -o template_label.nii.gz -r landmarks_rpi.nii.gz
sct_label_utils.py -t cross -i template_label.nii.gz -o template_label_cross.nii.gz -c 5
sct_label_utils.py -t cross -i landmarks_rpi.nii.gz -o landmarks_rpi_cross3x3.nii.gz -c 5 -d
WarpImageMultiTransform 3 landmarks_rpi_cross3x3.nii.gz landmarks_rpi_cross3x3_straight.nii.gz -R data_rpi_straight.nii.gz warp_curve2straight.nii.gz --use-NN
ANTSUseLandmarkImagesToGetAffineTransform template_label_cross.nii.gz landmarks_rpi_cross3x3_straight.nii.gz affine tmp.straight2templateAffine.txt

error:

 fix-label 21 movlabel 21
 labels do not match -- exiting 

datatypes are:

  • landmarks_rpi_cross3x3: UINT16
  • landmarks_rpi_cross3x3_straight.nii.gz: FLOAT32
  • template_label_cross.nii.gz: UINT16
  • template_label.nii.gz: UINT16

from spinalcordtoolbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.