Grey matter segmentation CSV: Vert Level Missing

Hi,

I am trying to look at changes in Grey and White matter by doing gray matter Segmentation as described in the Manual on T2* Scans. I get the CSV Output successfully and everything seems to be running smoothly, but for all files, all values in the Vert Level column of the CSV files are missing. Could this be an error on my part, or is the vertebrae Level not part of the Output?

Thank you,
Amba

Hi @ambaf,

This reminds me of other issues with vertebral labelling. I will try to dig back through our archives to see if I can dig out a clue.

In the meantime, it would help us to diagnose the issue if you could provide a complete log of your attempts, like how the bug in Sct_label_vertebrae fails v 4.0.0 looks. You should be able to copy from your terminal and paste it here, and when you do please put it in triple backticks:

    ```
    ```

to protect it from being messed up by the forum’s formatting codes. If you can share a sample of the output CSV you’re getting too that would also help, but we’ll understand if you can’t because of data privacy issues.

Hi,

Here is the first half of the log from the Grey matter Segmentation script I used:

nirims@nirims-VirtualBox:/media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM$ ./gm_wm_script.sh anonData/
started: 1603981901
folder selected: anonData/
found csvOutcome folder
Specific ouput folder already exists, adding to it  and replacing qc and duplicate files
input subject is subj1
mkdir: das Verzeichnis »../csvOutcome/anonData/subj1“ kann nicht angelegt werden: Die Datei existiert bereits
2020subj1.nii

--
Spinal Cord Toolbox (4.3)

Config deepseg_sc:
  Centerline algorithm: svm
  Brain in image: False
  Kernel dimension: 2d
  Contrast: t2s
  Threshold: 0.89

Create temporary folder (/tmp/sct-20201029153148.853579-j22b5vuu)...
Reorient the image to RPI, if necessary...
Finding the spinal cord centerline...
Remove temporary files...
rm -rf /tmp/sct-20201029153153.590115-uos969la
Cropping the image around the spinal cord...
Normalizing the intensity...
Segmenting the spinal cord using deep learning on 2D patches...
Reassembling the image...
Resampling the segmentation to the native image resolution using linear interpolation...
Binarizing the resampled segmentation...
Compute shape analysis: 100%|#################| 26/26 [00:00<00:00, 46.89iter/s]
Remove temporary files...
rm -rf /tmp/sct-20201029153148.853579-j22b5vuu

*** Generate Quality Control (QC) html report ***
Resample images to 0.6x0.6 mm
QcImage: layout with Axial slice
Compute center of mass at each slice
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/css/bootstrap-table.min.css /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/css
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/css/bootstrap.min.css /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/css
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/css/bootstrap-theme.min.css /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/css
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/css/bootstrap.min.css.map /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/css
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/css/select2.min.css /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/css
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/css/style.css /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/css
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/js/animation.js /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/js
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/js/bootstrap-table.min.js /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/js
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/js/main.js /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/js
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/js/bootstrap.min.js /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/js
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/js/jquery-3.1.0.min.js /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/js
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/js/select2.min.js /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/js
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/imgs/sagittal.png /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/imgs
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/imgs/sct_logo.png /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/imgs
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/imgs/axial.png /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/imgs
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/fonts/glyphicons-halflings-regular.eot /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/fonts
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/fonts/glyphicons-halflings-regular.woff2 /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/fonts
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/fonts/glyphicons-halflings-regular.woff /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/fonts
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/fonts/glyphicons-halflings-regular.ttf /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/fonts
cp /home/nirims/sct_4.3/spinalcordtoolbox/reports/assets/_assets/fonts/glyphicons-halflings-regular.svg /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_assets/fonts
Successfully generated the QC results in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_json/qc_2020_10_29_153209.961772.json
Use the following command to see the results in a browser:
xdg-open "/media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/index.html"

Done! To view results, type:
fsleyes /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1/2020subj1.nii -cm greyscale /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1/2020subj1_seg.nii -cm red -a 70.0 &


--
Spinal Cord Toolbox (4.3)

26/26 [==============================] - 187s 7s/step

*** Generate Quality Control (QC) html report ***
Resample images to 0.6x0.6 mm
QcImage: layout with Axial slice
Compute center of mass at each slice
Successfully generated the QC results in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_json/qc_2020_10_29_153541.117833.json
Use the following command to see the results in a browser:
xdg-open "/media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/index.html"

Done! To view results, type:
fsleyes 2020subj1.nii -cm greyscale -a 100.0 2020subj1_gmseg.nii -cm red -a 70.0 &


--
Spinal Cord Toolbox (4.3)


Done! To view results, type:
fsleyes 2020subj1_wmseg.nii &


--
Spinal Cord Toolbox (4.3)

Folder ../../csvOutcome/anonData/qc has been created.

Input parameters:
  Source .............. /home/nirims/sct_4.3/data/PAM50/template/PAM50_t2s.nii.gz
  Destination ......... 2020subj1.nii
  Init transfo ........ /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/analysisFiles/warp_template2anat.nii.gz
  Mask ................ 
  Output name ......... 
  Remove temp files ... 1
  Verbose ............. 1

Check if input data are 3D...

Create temporary folder (/tmp/sct-20201029153546.541065-register-ocgl30mg)...

Copying input data to tmp folder and convert to nii...

Skip step=0 and replace with initial transformations: 
  /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/analysisFiles/warp_template2anat.nii.gz

--
ESTIMATE TRANSFORMATION FOR STEP #1

Apply transformation from previous step

Parse list of warping fields...

Get dimensions of data...
  141 x 141 x 991 x 1

Apply transformation...

Apply transformation and resample to destination space...
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i src_seg.nii -o src_seg_reg.nii -t /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/analysisFiles/warp_template2anat.nii.gz -r dest_seg_RPI.nii -n NearestNeighbor # in /tmp/sct-20201029153546.541065-register-ocgl30mg
Copy affine matrix from destination space to make sure qform/sform are the same.

Done! To view results, type:
fsleyes dest_seg_RPI.nii src_seg_reg.nii &

Registration parameters:
  type ........... seg
  algo ........... rigid
  slicewise ...... 0
  metric ......... MeanSquares
  iter ........... 10
  smooth ......... 0
  laplacian ...... 0
  shrink ......... 1
  gradStep ....... 0.5
  deformation .... 1x1x0
  init ........... 
  poly ........... 5
  filter_size .... 5
  dof ............ Tx_Ty_Tz_Rx_Ry_Rz
  smoothWarpXY ... 2
  rot_method ..... pca
sct_image -i dest_seg_RPI.nii -o dest_seg_RPI_pad.nii -pad 0,0,5 # in /tmp/sct-20201029153546.541065-register-ocgl30mg

Estimate transformation
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 3 --transform 'rigid[0.5]' --metric 'MeanSquares[dest_seg_RPI_pad.nii,src_seg_reg.nii,1,4]' --convergence 10 --shrink-factors 1 --smoothing-sigmas 0mm --restrict-deformation 1x1x0 --output '[step1,src_seg_reg_regStep1.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029153546.541065-register-ocgl30mg

--
ESTIMATE TRANSFORMATION FOR STEP #2

Apply transformation from previous step

Parse list of warping fields...

Get dimensions of data...
  141 x 141 x 991 x 1

Apply transformation...

Apply transformation and resample to destination space...
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i src_seg.nii -o src_seg_reg.nii -t warp_forward_1.mat /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/analysisFiles/warp_template2anat.nii.gz -r dest_seg_RPI.nii -n NearestNeighbor # in /tmp/sct-20201029153546.541065-register-ocgl30mg
Copy affine matrix from destination space to make sure qform/sform are the same.
WARNING: the resulting image could have wrong apparent results. You should use an affine transformation as last transformation...

Done! To view results, type:
fsleyes dest_seg_RPI.nii src_seg_reg.nii &

Registration parameters:
  type ........... seg
  algo ........... bsplinesyn
  slicewise ...... 1
  metric ......... MeanSquares
  iter ........... 3
  smooth ......... 0
  laplacian ...... 0
  shrink ......... 1
  gradStep ....... 0.5
  deformation .... 1x1x0
  init ........... 
  poly ........... 5
  filter_size .... 5
  dof ............ Tx_Ty_Tz_Rx_Ry_Rz
  smoothWarpXY ... 2
  rot_method ..... pca

Create temporary folder (/tmp/sct-20201029154556.837548-register-tzn1pfg9)...

Copy input data to temp folder...
sct_convert -i src_seg_reg.nii -o /tmp/sct-20201029154556.837548-register-tzn1pfg9/src.nii
sct_convert -i dest_seg_RPI.nii -o /tmp/sct-20201029154556.837548-register-tzn1pfg9/dest.nii

Get image dimensions of destination image...
.. matrix size: 512 x 448 x 26
.. voxel size:  0.39062497mm x 0.390625mm x 3.8499997mm

Split input volume...

Split destination volume...
Registering slice 0/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0000.nii,src_Z0000.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0000,src_Z0000_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 1/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0001.nii,src_Z0001.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0001,src_Z0001_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 2/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0002.nii,src_Z0002.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0002,src_Z0002_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 3/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0003.nii,src_Z0003.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0003,src_Z0003_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 4/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0004.nii,src_Z0004.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0004,src_Z0004_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 5/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0005.nii,src_Z0005.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0005,src_Z0005_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 6/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0006.nii,src_Z0006.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0006,src_Z0006_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 7/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0007.nii,src_Z0007.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0007,src_Z0007_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 8/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0008.nii,src_Z0008.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0008,src_Z0008_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 9/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0009.nii,src_Z0009.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0009,src_Z0009_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 10/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0010.nii,src_Z0010.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0010,src_Z0010_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 11/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0011.nii,src_Z0011.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0011,src_Z0011_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 12/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0012.nii,src_Z0012.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0012,src_Z0012_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 13/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0013.nii,src_Z0013.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0013,src_Z0013_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 14/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0014.nii,src_Z0014.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0014,src_Z0014_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 15/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0015.nii,src_Z0015.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0015,src_Z0015_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 16/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0016.nii,src_Z0016.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0016,src_Z0016_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 17/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0017.nii,src_Z0017.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0017,src_Z0017_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 18/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0018.nii,src_Z0018.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0018,src_Z0018_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 19/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0019.nii,src_Z0019.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0019,src_Z0019_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 20/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0020.nii,src_Z0020.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0020,src_Z0020_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 21/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0021.nii,src_Z0021.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0021,src_Z0021_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 22/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0022.nii,src_Z0022.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0022,src_Z0022_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 23/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0023.nii,src_Z0023.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0023,src_Z0023_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 24/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0024.nii,src_Z0024.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0024,src_Z0024_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9
Registering slice 25/25...
/home/nirims/sct_4.3/bin/isct_antsRegistration --dimensionality 2 --transform 'BSplineSyN[0.5,1,3]' --metric 'MeanSquares[dest_Z0025.nii,src_Z0025.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 0mm --output '[warp2d_0025,src_Z0025_reg.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /tmp/sct-20201029154556.837548-register-tzn1pfg9

Merge warping fields along z...

Here is the second half:


Move warping fields...
cp step2Warp.nii.gz /tmp/sct-20201029153546.541065-register-ocgl30mg
cp step2InverseWarp.nii.gz /tmp/sct-20201029153546.541065-register-ocgl30mg
rm -rf /tmp/sct-20201029154556.837548-register-tzn1pfg9

Concatenate transformations...

Parse list of warping fields...

Check file existence...
  OK: dest.nii
  OK: /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/analysisFiles/warp_template2anat.nii.gz
  OK: warp_forward_1.mat
  OK: warp_forward_2.nii.gz
/home/nirims/sct_4.3/bin/isct_ComposeMultiTransform 3 warp_final.nii.gz -R dest.nii warp_forward_2.nii.gz warp_forward_1.mat /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/analysisFiles/warp_template2anat.nii.gz # in /tmp/sct-20201029153546.541065-register-ocgl30mg

Generate output files...
  File created: warp_src2dest.nii.gz

Parse list of warping fields...

Check file existence...
  OK: src.nii
  OK: warp_inverse_2.nii.gz
  OK: warp_forward_1.mat
  OK: /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/analysisFiles/warp_anat2template.nii.gz
/home/nirims/sct_4.3/bin/isct_ComposeMultiTransform 3 warp_final.nii.gz -R src.nii /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/analysisFiles/warp_anat2template.nii.gz -i warp_forward_1.mat warp_inverse_2.nii.gz # in /tmp/sct-20201029153546.541065-register-ocgl30mg

Generate output files...
  File created: warp_dest2src.nii.gz

Apply transfo source --> dest...

Parse list of warping fields...

Get dimensions of data...
  141 x 141 x 991 x 1

Apply transformation...

Apply transformation and resample to destination space...
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i src.nii -o src_reg.nii -t warp_src2dest.nii.gz -r dest.nii -n Linear # in /tmp/sct-20201029153546.541065-register-ocgl30mg
Copy affine matrix from destination space to make sure qform/sform are the same.

Done! To view results, type:
fsleyes dest.nii src_reg.nii &


Apply transfo dest --> source...

Parse list of warping fields...

Get dimensions of data...
  512 x 448 x 26 x 1

Apply transformation...

Apply transformation and resample to destination space...
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i dest.nii -o dest_reg.nii -t warp_dest2src.nii.gz -r src.nii -n Linear # in /tmp/sct-20201029153546.541065-register-ocgl30mg
Copy affine matrix from destination space to make sure qform/sform are the same.

Done! To view results, type:
fsleyes src.nii dest_reg.nii &


Generate output files...
  File created: PAM50_t2s_reg.nii.gz
  File created: 2020subj1_reg.nii
  File created: warp_PAM50_t2s22020subj1.nii.gz
  File created: warp_2020subj12PAM50_t2s.nii.gz

Remove temporary files...
rm -rf /tmp/sct-20201029153546.541065-register-ocgl30mg

Finished! Elapsed time: 966s

*** Generate Quality Control (QC) html report ***
Resample images to 0.6x0.6 mm
QcImage: layout with Axial slice
Compute center of mass at each slice
Mask type float64
Successfully generated the QC results in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_json/qc_2020_10_29_155158.590531.json
Use the following command to see the results in a browser:
xdg-open "/media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/index.html"

Done! To view results, type:
fsleyes /home/nirims/sct_4.3/data/PAM50/template/PAM50_t2s.nii.gz 2020subj1_reg.nii &


Done! To view results, type:
fsleyes 2020subj1.nii PAM50_t2s_reg.nii.gz &

mv: Aufruf von stat für 'warp_t2s2PAM50_2020subj1.nii.gz' nicht möglich: Datei oder Verzeichnis nicht gefunden

--
Spinal Cord Toolbox (4.3)

Folder ../../csvOutcome/anonData/qc has been created.

Check parameters:
  Working directory ........ /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
  Destination image ........ 2020subj1.nii
  Warping field ............ warp_template2t2s.nii.gz
  Path template ............ /home/nirims/sct_4.3/data/PAM50
  Output folder ............ label


WARP TEMPLATE:
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_t1.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_t1.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_t2.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_t2.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_t2s.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_t2s.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_cord.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_cord.nii.gz -n NearestNeighbor # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_wm.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_wm.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_gm.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_gm.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_csf.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_csf.nii.gz -n NearestNeighbor # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_levels.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_levels.nii.gz -n NearestNeighbor # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_levels_continuous.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_levels_continuous.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_label_body.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_label_body.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_label_disc.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_label_disc.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_label_discPosterior.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_label_discPosterior.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_spine.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_spine.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_centerline.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_centerline.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/template/PAM50_label_spinal_levels.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/template/PAM50_label_spinal_levels.nii.gz -n NearestNeighbor # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
cp /home/nirims/sct_4.3/data/PAM50/template/info_label.txt label/template

WARP ATLAS OF WHITE MATTER TRACTS:
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_00.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_00.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_01.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_01.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_02.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_02.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_03.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_03.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_04.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_04.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_05.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_05.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_06.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_06.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_07.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_07.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_08.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_08.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_09.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_09.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_10.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_10.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_11.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_11.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_12.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_12.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_13.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_13.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_14.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_14.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_15.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_15.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_16.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_16.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_17.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_17.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_18.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_18.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_19.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_19.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_20.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_20.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_21.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_21.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_22.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_22.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_23.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_23.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_24.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_24.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_25.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_25.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_26.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_26.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_27.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_27.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_28.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_28.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_29.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_29.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_30.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_30.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_31.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_31.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_32.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_32.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_33.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_33.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_34.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_34.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_35.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_35.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
/home/nirims/sct_4.3/bin/isct_antsApplyTransforms -d 3 -i /home/nirims/sct_4.3/data/PAM50/atlas/PAM50_atlas_36.nii.gz -r 2020subj1.nii -t warp_template2t2s.nii.gz -o label/atlas/PAM50_atlas_36.nii.gz -n Linear # in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/anonData/subj1
cp /home/nirims/sct_4.3/data/PAM50/atlas/info_label.txt label/atlas

*** Generate Quality Control (QC) html report ***
Resample images to 0.6x0.6 mm
QcImage: layout with Axial slice
Compute center of mass at each slice
Successfully generated the QC results in /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/_json/qc_2020_10_29_155605.785358.json
Use the following command to see the results in a browser:
xdg-open "/media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/qc/index.html"

Done! To view results, type:
fsleyes 2020subj1.nii -cm greyscale -a 100.0 label/template/PAM50_t2.nii.gz -cm greyscale -dr 0 4000 -a 100.0 label/template/PAM50_gm.nii.gz -cm red-yellow -dr 0.4 1 -a 50.0 label/template/PAM50_wm.nii.gz -cm blue-lightblue -dr 0.4 1 -a 50.0 &


--
Spinal Cord Toolbox (4.3)

Compute shape analysis: 100%|#################| 26/26 [00:00<00:00, 47.05iter/s]

Done! To view results, type:
xdg-open /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/subj1/2020subj1_gm_CSA.csv


--
Spinal Cord Toolbox (4.3)

Compute shape analysis: 100%|#################| 26/26 [00:00<00:00, 28.76iter/s]

Done! To view results, type:
xdg-open /media/sf_GemeinsamerOrdner/SCT/Testdaten/miniTrialGMWM/csvOutcome/anonData/subj1/2020subj1_wm_CSA.csv

Execution time was 1476 seconds.

And attached is a sample CSV Output.

gmCSV.xlsx (14.6 KB)

Thanks. Would it be possible to see what is in gm_wm_script.sh too?

I believe you need to pass -vert to sct_extract_metric to ask it for this output. For easier consumption by other tools, the VertLevel column was made permanent in https://github.com/neuropoly/spinalcordtoolbox/pull/2199, but you still need to enable it to actually get the output.

Do you have an idea about how we could make this more obvious?

I see! Thank you. I think it was mostly confusing because of the empty column which made it seem like an error had occurred and because you can use sct_process_segmentation to get vertebral values for t1 and t2 Scans. I also thought the Atlas base Analysis was for more specific Areas of the spinal cord. But in hindsight the notes make a lot more sense now! Thank you again :slight_smile:

1 Like

sorry for the late reply-- yes, as you and @nguenthe figured out, you need to specify -vert in order to have the explicit levels listed in the output CSV file.

Hi again! :blush:

I tried the sct_extract_metric approach on the same file, but when I use sct_warp_template after creating a mask and registering the template to the file, only a small amount of slices are successfully registered. Therefore, I only get very few output values per vertebrae.

image


Here I registered the template using the GM shape, but I also tried without and got the same/worse results. I used the same commands as used in the course, changing only the files.

Also, is the size in voxels given by sct_extract_metric the same as the area values given by sct_process Segmentation, just as a different measurement?

Thank you!
Amba

Hi @ambaf

there is clearly something wrong with your analysis pipeline. It is difficult for me to tell what is wrong: could be the segmentation, the registration, the types of inputs, the parameters, etc.

the most efficient way for me to help would be for you to share:

  • the images you used to generate those results
  • the shell script you used to generate those results. Please use relative (not absolute) file names so the script can run as is.

Hi @jcohenadad,

below are the script I used for both types of template registration and the output I got from it. I have emailed you the t2* Image. Thank you!

script.sh (1.7 KB) output.txt (71.2 KB)

@ambaf

your script requires those inputs:

  • warp_template2anat.nii.gz
  • warp_anat2template.nii.gz

which you did not send me (you only sent the t2s).

pls send me everything needed for me to reproduce your results.

also: there is possibly something wrong with warp_template2anat.nii.gz, so it might be more efficient if you send me the sources that generated this warping field (and also include the full script to get to this)

Hi @jcohenadad,

To be sure I wasn’t making a mistake, I rewrote the cript only copy-pasting from the Course script. I’ve attached what I used. With this script get:
image

I believe my first error was due to my using the wrong warp_template2anat and warp_anat2template files, but now using the correct ones I still only get data for half the slices. I have sent you the t2 file I used and the warp_template2anat file it created. However, the warp_anat2template file is too large to send.

Thank you!
Amba
scriptUsed.sh (1.2 KB)

@ambaf The problem is caused by the T2 and T2* images not being in the same physical coordinate system, as shown in the image below:

This is likely due to the two images being acquired with patient repositioning in between.

If you absolutely need to process these data, then you need to manually set the vertebral level on the T2*. We kind of see the intervertebral discs, so you could assign the slice number and use it before sct_register_to_template (with flag: -ref subject). Or, if you know how the FOV was placed (e.g., center of FOV at disc XX), you could also use that information, as exemplified in this pipeline.

@jcohenadad aah, I see! Thank you. Luckily the majority of the data doesn’t have repositioning between the two scans, so in this case it should be fine after all. Thank you for spotting this!

Best wishes,
Amba

1 Like

Hi @jcohenadad,

thank you for all your help so far. I am still having trouble obtaining the per-vertebrae CSA for Grey and White matter from my T2* Images by registering them to my T2 Images. I have tried following the steps from this post Sct_label_utils display , but I get vert values of “16.889” for example. I’ve also tried using the created vertfile in the sct_extract_metric command under the -vertfile flag but get no vertLevel values. I have sent you a sample T2 and T2* file more representative of the data. Do you have any suggestions on the best way to proceed?

Hi,

Here are the commands:

# T2 processing
# =============
# Crop T2 with FOV from T2* data (for faster processing)
sct_crop_image -i t2_subj14.nii.gz -ref t2s_subj14.nii.gz
# Resample to isotropic resolution due to poor native R-L resolution
 sct_resample -i t2_subj14_crop.nii.gz -mm 0.8x0.8x0.8 -o t2_subj14_crop_r.nii.gz
# Segment spinal cord
sct_deepseg_sc -i t2_subj14_crop_r.nii.gz -c t2 -qc qc
# Label vertebrae
sct_label_vertebrae -i t2_subj14_crop_r.nii.gz -s t2_subj14_crop_r_seg.nii.gz -c t2 -qc qc
# T2* processing
# ==============
# Segment spinal cord
sct_deepseg_sc -i t2s_subj14.nii.gz -c t2s -qc qc
# Segment gray matter
sct_deepseg_gm -i t2s_subj14.nii.gz -qc qc
# Subtract spinal cord and gray matter masks to obtain white matter mask
sct_maths -i t2s_subj14_seg.nii.gz -sub t2s_subj14_gmseg.nii.gz -o t2s_subj14_wmseg.nii.gz
# Bring T2 vertebral labeling to T2* space for vertebral-based quantifications
sct_register_multimodal -i t2_subj14_crop_r_seg_labeled.nii.gz -d t2s_subj14.nii.gz -identity 1 -x nn
# Generate QC to check if vertebrae are aligned
sct_qc -i t2s_subj14_reg.nii.gz -s t2_subj14_crop_r_seg_labeled.nii.gz -p sct_label_vertebrae -qc qc
# Quantify CSA across vertebral levels
sct_process_segmentation -i t2s_subj14_gmseg.nii.gz -vertfile t2_subj14_crop_r_seg_labeled_reg.nii.gz -vert 1:7 -perlevel 1 -o csa_gm.csv
sct_process_segmentation -i t2s_subj14_wmseg.nii.gz -vertfile t2_subj14_crop_r_seg_labeled_reg.nii.gz -vert 1:7 -perlevel 1 -o csa_wm.csv

Here are the resulting CSAs: csa_gm.csv (3.6 KB) csa_wm.csv (3.6 KB)

And here is the QC report: qc.zip (765.3 KB)

This was tested with SCT v5.0.1.

:warning: Please note that the GM segmentation needs to be checked and manually corrected if necessary, before computing CSAs.

Let me know if you can reproduce these results.

Best,
Julien

Hi Julien,

This works perfectly thank you!

Best wishes,
Amba

1 Like