rrsg2020 / analysis

4 stars 0 forks source link

Added script to co-register t1maps #2

Closed jcohenadad closed 4 years ago

jcohenadad commented 4 years ago

After trying a fully-automatic method, I realized that some acquisitions are too different from each other. Notably, the positioning of the phantom and acquisition matrix size, makes it difficult to obtain a reliable co-registration to a reference image.

So, the proposed strategy involves the creation of three labels (doesn't need to be exactly at the middle, but roughtly), as illustrated here: image_labels.

A first step involves label-based affine realignment, and a second step involves image-based affine registration. This strategy relies on ANTs, so that's an added dependency.

To prevent the registration algorithm from using the phantom edge, I've added a mask (only on the reference image): image_mask

Here is are some results on 5 datasets: anim_t1map_reg

(here the reference image was: 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz).

To reproduce these results, download and unzip the labels + mask under the 3T/NIST folder: NIST_labels.zip

Then run:

register_t1maps_nist.sh

Note: this script needs to run from within the image folder.

I realize this is not "perfect", mainly due to a site acquiring the phantom in a non-orthogonal way, which "distorts" the circles. We could get around it by adding a non-linear step to the registration (I've quickly tried BsplineSyN and it gives satisfactory results). Also, using the T1-weighted images could slightly improve results.

Finally, I suggest, for the final analysis pipeline, to apply the inverse composed affine transformed to the masks (created on the ref image), so that noise properties are not altered when computing statistics. Although I think if there is enough voxels, statistics should not be altered too much (mean, variance).

Related to https://github.com/rrsg2020/analysis/issues/1

mathieuboudreau commented 4 years ago

Thanks @jcohenadad !

I just had a look at this - installed ANTs from source, created some labels for two images (guillaumegilbert and Aaschen) and mask as you said, but then I hit a bit of a wall when I ran your script. The script runs, but the images that I selected (guillaumegilbert as the reference image, Aaschen as the source image) didn't generate a registered nifti image or jpg for the Aaschen target image.

So then, I tried to process the labels you shared to above (NIST_labels.zip), and for me the script generated some registered images for source nifti images, but didn't for others:

Capture d’écran 2020-06-07 à 22 57 10

The T1 maps from siyuhanhu, guillaumegilbert, and iveslevesque produced registered niftifi files and jpgs, whereas mrel and Aaschen did not. Any clue of why this might happen for me?

Below is the log file saved using script from when I ran you scripts.

``` Script started on Sun Jun 7 22:56:22 2020 % ]7;file://mathieu.local/Users/mathieuboudreau/Downloads/NIST_labels (base) mathieuboudreau@mathieu NIST_labels % [?2004h~/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh~/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh[?2004l + set -v # PARAMETERS # ---------- # Choose reference image. Do NOT add the extension FILEREF="20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map" + FILEREF=20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map # Extension for NIFTI file names EXT="nii.gz" + EXT=nii.gz # Suffix of images to register SUFFIXT1="_t1map" + SUFFIXT1=_t1map SUFFIXLABEL="_labels" + SUFFIXLABEL=_labels SUFFIXMASK="_mask" + SUFFIXMASK=_mask # SCRIPT STARTS HERE # ------------------ # Loop across images and register to the ref image # Note: here we assume that all images to register have the suffix FILES=`ls *${SUFFIXT1}.nii.gz` ls *${SUFFIXT1}.nii.gz ++ ls 20200124_siyuanhu_casewestern_NIST_t1map.nii.gz 20200204_mrel_usc_GE3T_MR1_NIST_t1map.nii.gz 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map.nii.gz Aachen_MR1_Complex_t1map.nii.gz + FILES='20200124_siyuanhu_casewestern_NIST_t1map.nii.gz 20200204_mrel_usc_GE3T_MR1_NIST_t1map.nii.gz 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map.nii.gz Aachen_MR1_Complex_t1map.nii.gz' for file in $FILES; do # Remove extension for easier parsing file=${file%???????} fileout=${file}_reg # Skip ref image (no need to register it to itself) if [ $file != $FILEREF ]; then # Some sites placed the phantom with a flip along z axis, or oriented the # FOV along another direction than the ref image, causing the labels to go # in the clockwise direction (whereas they are oriented anti-clockwise in # the ref image), causing the label-based transformation to fail. For this # reason, we need to copy header information from the ref image to the # moving image. # Note: I've also tried flipping the image and labels using PermuteFlipImageOrientationAxes # but for some reasons i do not understand, the flipping does not produce # the same qform between the output image and labels (even though the inputs # have the same qform...). CopyImageHeaderInformation $FILEREF.$EXT $file.$EXT ${file}_modifheader.$EXT 1 1 0 CopyImageHeaderInformation $FILEREF.$EXT $file${SUFFIXLABEL}.$EXT ${file}_modifheader${SUFFIXLABEL}.$EXT 1 1 0 file=${file}_modifheader # Label-based registration antsLandmarkBasedTransformInitializer 2 $FILEREF$SUFFIXLABEL.$EXT $file$SUFFIXLABEL.$EXT affine $file.mat # Apply transformation (only for debugging purpose) antsApplyTransforms -d 2 -r $FILEREF.$EXT -i $file.$EXT -o ${file}_reg-labelbased.$EXT -t $file.mat # Affine registration antsRegistration -d 2 -r $file.mat -t Affine[0.1] -m CC[ $FILEREF.$EXT , $file.$EXT] -c 100x100x100 -s 0x0x0 -f 4x2x1 -x $FILEREF${SUFFIXMASK}.$EXT -o [$file_, $fileout.$EXT] -v # Convert to jpg for easy QC ConvertToJpg $file.$EXT $file.jpg ConvertToJpg $fileout.$EXT $fileout.jpg fi done + for file in '$FILES' + file=20200124_siyuanhu_casewestern_NIST_t1map + fileout=20200124_siyuanhu_casewestern_NIST_t1map_reg + '[' 20200124_siyuanhu_casewestern_NIST_t1map '!=' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map ']' + CopyImageHeaderInformation 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200124_siyuanhu_casewestern_NIST_t1map.nii.gz 20200124_siyuanhu_casewestern_NIST_t1map_modifheader.nii.gz 1 1 0 + CopyImageHeaderInformation 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200124_siyuanhu_casewestern_NIST_t1map_labels.nii.gz 20200124_siyuanhu_casewestern_NIST_t1map_modifheader_labels.nii.gz 1 1 0 + file=20200124_siyuanhu_casewestern_NIST_t1map_modifheader + antsLandmarkBasedTransformInitializer 2 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_labels.nii.gz 20200124_siyuanhu_casewestern_NIST_t1map_modifheader_labels.nii.gz affine 20200124_siyuanhu_casewestern_NIST_t1map_modifheader.mat + antsApplyTransforms -d 2 -r 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz -i 20200124_siyuanhu_casewestern_NIST_t1map_modifheader.nii.gz -o 20200124_siyuanhu_casewestern_NIST_t1map_modifheader_reg-labelbased.nii.gz -t 20200124_siyuanhu_casewestern_NIST_t1map_modifheader.mat + antsRegistration -d 2 -r 20200124_siyuanhu_casewestern_NIST_t1map_modifheader.mat -t 'Affine[0.1]' -m 'CC[' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz , '20200124_siyuanhu_casewestern_NIST_t1map_modifheader.nii.gz]' -c 100x100x100 -s 0x0x0 -f 4x2x1 -x 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_mask.nii.gz -o '[,' '20200124_siyuanhu_casewestern_NIST_t1map_reg.nii.gz]' -v All_Command_lines_OK Using double precision for computations. ============================================================================= The composite transform comprises the following transforms (in order): 1. 20200124_siyuanhu_casewestern_NIST_t1map_modifheader.mat (type = AffineTransform) ============================================================================= Reading mask(s). Registration stage 0 Fixed mask = 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_mask.nii.gz number of levels = 3 fixed image: 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz moving image: 20200124_siyuanhu_casewestern_NIST_t1map_modifheader.nii.gz Dimension = 2 Number of stages = 1 Use Histogram Matching false Winsorize image intensities false Lower quantile = 0 Upper quantile = 1 Stage 1 State Image metric = CC Fixed image = Image (0x7f86370dbb10) RTTI typeinfo: itk::Image Reference Count: 2 Modified Time: 1517 Debug: Off Object Name: Observers: none Source: (none) Source output name: (none) Release Data: Off Data Released: False Global Release Data: Off PipelineMTime: 0 UpdateMTime: 1298 RealTimeStamp: 0 seconds LargestPossibleRegion: Dimension: 2 Index: [0, 0] Size: [192, 192] BufferedRegion: Dimension: 2 Index: [0, 0] Size: [192, 192] RequestedRegion: Dimension: 2 Index: [0, 0] Size: [192, 192] Spacing: [1, 1] Origin: [-96.0404, -61.8271] Direction: 0.999676 -0.015025 -0.0254473 0.999887 IndexToPointMatrix: 0.999676 -0.015025 -0.0254473 0.999887 PointToIndexMatrix: 1.00071 0.0150373 0.0254681 1.0005 Inverse Direction: 1.00071 0.0150373 0.0254681 1.0005 PixelContainer: ImportImageContainer (0x7f86370dd0f0) RTTI typeinfo: itk::ImportImageContainer Reference Count: 1 Modified Time: 1295 Debug: Off Object Name: Observers: none Pointer: 0x1121ae000 Container manages memory: true Size: 36864 Capacity: 36864 Moving image = Image (0x7f86370e0130) RTTI typeinfo: itk::Image Reference Count: 2 Modified Time: 1518 Debug: Off Object Name: Observers: none Source: (none) Source output name: (none) Release Data: Off Data Released: False Global Release Data: Off PipelineMTime: 0 UpdateMTime: 1515 RealTimeStamp: 0 seconds LargestPossibleRegion: Dimension: 2 Index: [0, 0] Size: [256, 256] BufferedRegion: Dimension: 2 Index: [0, 0] Size: [256, 256] RequestedRegion: Dimension: 2 Index: [0, 0] Size: [256, 256] Spacing: [1, 1] Origin: [-96.0404, -61.8271] Direction: 0.999986 0.00521339 -0.00521339 0.999986 IndexToPointMatrix: 0.999986 0.00521339 -0.00521339 0.999986 PointToIndexMatrix: 0.999986 -0.00521339 0.00521339 0.999986 Inverse Direction: 0.999986 -0.00521339 0.00521339 0.999986 PixelContainer: ImportImageContainer (0x7f86370db9f0) RTTI typeinfo: itk::ImportImageContainer Reference Count: 1 Modified Time: 1512 Debug: Off Object Name: Observers: none Pointer: 0x1121f6000 Container manages memory: true Size: 65536 Capacity: 65536 Weighting = 1 Sampling strategy = none Number of bins = 32 Radius = 4 Sampling percentage = 1 Transform = Affine Gradient step = 0.1 Update field sigma (voxel space) = 0 Total field sigma (voxel space) = 0 Update field time sigma = 0 Total field time sigma = 0 Number of time indices = 0 Number of time point samples = 0 Registration using 1 total stages. Stage 0 iterations = 100x100x100 convergence threshold = 1e-06 convergence window size = 10 number of levels = 3 using the CC metric (radius = 4, weight = 1) Shrink factors (level 1 out of 3): [4, 4] Shrink factors (level 2 out of 3): [2, 2] Shrink factors (level 3 out of 3): [1, 1] smoothing sigmas per level: [0, 0, 0] Using default NONE metricSamplingStrategy *** Running AffineTransform registration *** DIAGNOSTIC,Iteration,metricValue,convergenceValue,ITERATION_TIME_INDEX,SINCE_LAST 2DIAGNOSTIC, 1, -4.060027940377e-01, 1.797693134862e+308, 8.6122e-03, 8.6100e-03, 2DIAGNOSTIC, 2, -4.221221384333e-01, 1.797693134862e+308, 1.4480e-02, 5.8682e-03, 2DIAGNOSTIC, 3, -4.450158551973e-01, 1.797693134862e+308, 1.9636e-02, 5.1558e-03, 2DIAGNOSTIC, 4, -4.753335980265e-01, 1.797693134862e+308, 2.6574e-02, 6.9380e-03, 2DIAGNOSTIC, 5, -5.031931995539e-01, 1.797693134862e+308, 3.3947e-02, 7.3729e-03, 2DIAGNOSTIC, 6, -5.197977947183e-01, 1.797693134862e+308, 4.0894e-02, 6.9470e-03, 2DIAGNOSTIC, 7, -5.233381566284e-01, 1.797693134862e+308, 4.7737e-02, 6.8429e-03, 2DIAGNOSTIC, 8, -5.274565161799e-01, 1.797693134862e+308, 5.3476e-02, 5.7390e-03, 2DIAGNOSTIC, 9, -5.350120788288e-01, 1.797693134862e+308, 6.1863e-02, 8.3871e-03, 2DIAGNOSTIC, 10, -5.413160870489e-01, 1.839353494219e-02, 6.9324e-02, 7.4611e-03, 2DIAGNOSTIC, 11, -5.428701439808e-01, 1.351447691868e-02, 8.0907e-02, 1.1583e-02, 2DIAGNOSTIC, 12, -5.442930081592e-01, 9.158413783117e-03, 8.8220e-02, 7.3130e-03, 2DIAGNOSTIC, 13, -5.442038220197e-01, 5.687469573970e-03, 9.8394e-02, 1.0174e-02, 2DIAGNOSTIC, 14, -5.443765788233e-01, 3.435542187304e-03, 1.0470e-01, 6.3009e-03, 2DIAGNOSTIC, 15, -5.447262295870e-01, 2.227565321681e-03, 1.1221e-01, 7.5140e-03, 2DIAGNOSTIC, 16, -5.447861581492e-01, 1.558022377478e-03, 1.1991e-01, 7.6981e-03, 2DIAGNOSTIC, 17, -5.449766179809e-01, 9.529994577803e-04, 1.4781e-01, 2.7907e-02, 2DIAGNOSTIC, 18, -5.449766176155e-01, 4.545300285898e-04, 1.8447e-01, 3.6657e-02, 2DIAGNOSTIC, 19, -5.449766176155e-01, 1.847942249904e-04, 1.9640e-01, 1.1928e-02, 2DIAGNOSTIC, 20, -5.449766176155e-01, 9.884028439277e-05, 2.0777e-01, 1.1373e-02, 2DIAGNOSTIC, 21, -5.449766176155e-01, 5.192566956107e-05, 2.1673e-01, 8.9610e-03, 2DIAGNOSTIC, 22, -5.449766176155e-01, 4.033480297195e-05, 2.2582e-01, 9.0861e-03, 2DIAGNOSTIC, 23, -5.449766176155e-01, 2.404691041837e-05, 2.3578e-01, 9.9590e-03, 2DIAGNOSTIC, 24, -5.449766176155e-01, 1.084202469961e-05, 2.4940e-01, 1.3618e-02, 2DIAGNOSTIC, 25, -5.449766176155e-01, 5.468525728601e-06, 2.5707e-01, 7.6780e-03, 2DIAGNOSTIC, 26, -5.449766176155e-01, 1.273399187374e-06, 2.6801e-01, 1.0931e-02, 2DIAGNOSTIC, 27, -5.449766176155e-01, 1.224392254112e-06, 2.7739e-01, 9.3870e-03, 2DIAGNOSTIC, 28, -5.449766176155e-01, 1.179011068643e-06, 2.8649e-01, 9.0978e-03, 2DIAGNOSTIC, 29, -5.449766176155e-01, 1.136873693172e-06, 2.9789e-01, 1.1396e-02, 2DIAGNOSTIC, 30, -5.449766176155e-01, 1.097644331712e-06, 3.0528e-01, 7.3950e-03, 2DIAGNOSTIC, 31, -5.449766176155e-01, 1.061031990560e-06, 3.1462e-01, 9.3429e-03, 2DIAGNOSTIC, 32, -5.449766176155e-01, 1.026783247628e-06, 3.2403e-01, 9.4061e-03, DIAGNOSTIC,Iteration,metricValue,convergenceValue,ITERATION_TIME_INDEX,SINCE_LAST 2DIAGNOSTIC, 1, -4.540373098436e-01, 1.797693134862e+308, 3.5487e-01, 3.0838e-02, 2DIAGNOSTIC, 2, -4.583118929131e-01, 1.797693134862e+308, 3.8407e-01, 2.9206e-02, 2DIAGNOSTIC, 3, -4.613640153118e-01, 1.797693134862e+308, 4.1234e-01, 2.8266e-02, 2DIAGNOSTIC, 4, -4.635615895725e-01, 1.797693134862e+308, 4.4068e-01, 2.8343e-02, 2DIAGNOSTIC, 5, -4.651349098315e-01, 1.797693134862e+308, 4.6352e-01, 2.2833e-02, 2DIAGNOSTIC, 6, -4.673496159535e-01, 1.797693134862e+308, 4.8664e-01, 2.3122e-02, 2DIAGNOSTIC, 7, -4.787937798587e-01, 1.797693134862e+308, 5.3749e-01, 5.0847e-02, 2DIAGNOSTIC, 8, -4.805330127084e-01, 1.797693134862e+308, 6.2792e-01, 9.0430e-02, 2DIAGNOSTIC, 9, -4.805427272140e-01, 1.797693134862e+308, 6.4934e-01, 2.1426e-02, 2DIAGNOSTIC, 10, -4.805545333490e-01, 4.055517659582e-03, 6.8177e-01, 3.2427e-02, 2DIAGNOSTIC, 11, -4.805772261724e-01, 3.302593929628e-03, 7.1069e-01, 2.8922e-02, 2DIAGNOSTIC, 12, -4.806121485988e-01, 2.586877488449e-03, 7.3806e-01, 2.7368e-02, 2DIAGNOSTIC, 13, -4.806674634284e-01, 1.890654789388e-03, 7.6259e-01, 2.4535e-02, 2DIAGNOSTIC, 14, -4.807326017453e-01, 1.228525712079e-03, 7.8793e-01, 2.5333e-02, 2DIAGNOSTIC, 15, -4.808405118835e-01, 6.157627124898e-04, 8.1368e-01, 2.5758e-02, 2DIAGNOSTIC, 16, -4.809995397427e-01, 1.020575492226e-04, 8.4221e-01, 2.8526e-02, 2DIAGNOSTIC, 17, -4.811746450762e-01, 4.857948452708e-05, 8.6933e-01, 2.7123e-02, 2DIAGNOSTIC, 18, -4.813297106168e-01, 5.980421526454e-05, 9.1208e-01, 4.2745e-02, 2DIAGNOSTIC, 19, -4.814422185761e-01, 6.828030632445e-05, 9.4843e-01, 3.6350e-02, 2DIAGNOSTIC, 20, -4.814494286110e-01, 7.026881068447e-05, 9.8078e-01, 3.2350e-02, 2DIAGNOSTIC, 21, -4.814503349198e-01, 6.636436424953e-05, 1.0779e+00, 9.7168e-02, 2DIAGNOSTIC, 22, -4.814503349122e-01, 5.768347692685e-05, 1.1819e+00, 1.0396e-01, 2DIAGNOSTIC, 23, -4.814503349122e-01, 4.590551444732e-05, 1.2100e+00, 2.8095e-02, 2DIAGNOSTIC, 24, -4.814503349122e-01, 3.255021647026e-05, 1.2516e+00, 4.1615e-02, 2DIAGNOSTIC, 25, -4.814503349122e-01, 1.991004624017e-05, 1.2778e+00, 2.6159e-02, 2DIAGNOSTIC, 26, -4.814503349122e-01, 1.011850029675e-05, 1.3066e+00, 2.8786e-02, 2DIAGNOSTIC, 27, -4.814503349122e-01, 4.024304403390e-06, 1.3290e+00, 2.2421e-02, 2DIAGNOSTIC, 28, -4.814503349122e-01, 1.336665780186e-06, 1.3758e+00, 4.6833e-02, 2DIAGNOSTIC, 29, -4.814503349122e-01, 1.125743284286e-06, 1.4007e+00, 2.4845e-02, 2DIAGNOSTIC, 30, -4.814503349122e-01, 1.069885977138e-06, 1.4275e+00, 2.6820e-02, 2DIAGNOSTIC, 31, -4.814503349122e-01, 1.035072775803e-06, 1.4682e+00, 4.0747e-02, 2DIAGNOSTIC, 32, -4.814503349122e-01, 1.002453631584e-06, 1.4992e+00, 3.0965e-02, DIAGNOSTIC,Iteration,metricValue,convergenceValue,ITERATION_TIME_INDEX,SINCE_LAST 2DIAGNOSTIC, 1, -2.234480444330e-01, 1.797693134862e+308, 1.5912e+00, 9.2023e-02, 2DIAGNOSTIC, 2, -2.248309490532e-01, 1.797693134862e+308, 1.7044e+00, 1.1315e-01, 2DIAGNOSTIC, 3, -2.250379370510e-01, 1.797693134862e+308, 1.8724e+00, 1.6799e-01, 2DIAGNOSTIC, 4, -2.250396293370e-01, 1.797693134862e+308, 2.0734e+00, 2.0103e-01, 2DIAGNOSTIC, 5, -2.250396418898e-01, 1.797693134862e+308, 2.3331e+00, 2.5974e-01, 2DIAGNOSTIC, 6, -2.250396419792e-01, 1.797693134862e+308, 2.5229e+00, 1.8975e-01, 2DIAGNOSTIC, 7, -2.250396419862e-01, 1.797693134862e+308, 2.7187e+00, 1.9585e-01, 2DIAGNOSTIC, 8, -2.250396419866e-01, 1.797693134862e+308, 2.8961e+00, 1.7738e-01, 2DIAGNOSTIC, 9, -2.250396419867e-01, 1.797693134862e+308, 3.1507e+00, 2.5458e-01, 2DIAGNOSTIC, 10, -2.250396419867e-01, 2.275462339218e-04, 3.2577e+00, 1.0700e-01, 2DIAGNOSTIC, 11, -2.250396419867e-01, 2.704402740981e-05, 3.3903e+00, 1.3263e-01, 2DIAGNOSTIC, 12, -2.250396419867e-01, 2.833323304322e-06, 3.4980e+00, 1.0766e-01, 2DIAGNOSTIC, 13, -2.250396419867e-01, 2.449663703552e-06, 3.5977e+00, 9.9719e-02, 2DIAGNOSTIC, 14, -2.250396419867e-01, 2.273447042650e-06, 3.6957e+00, 9.8041e-02, 2DIAGNOSTIC, 15, -2.250396419867e-01, 2.121794881807e-06, 3.8204e+00, 1.2463e-01, 2DIAGNOSTIC, 16, -2.250396419867e-01, 1.989115714307e-06, 3.9675e+00, 1.4719e-01, 2DIAGNOSTIC, 17, -2.250396419867e-01, 1.872053731783e-06, 4.0646e+00, 9.7035e-02, 2DIAGNOSTIC, 18, -2.250396419867e-01, 1.768004457385e-06, 4.1488e+00, 8.4226e-02, 2DIAGNOSTIC, 19, -2.250396419867e-01, 1.674912357891e-06, 4.2670e+00, 1.1822e-01, 2DIAGNOSTIC, 20, -2.250396419867e-01, 1.591133196956e-06, 4.3845e+00, 1.1749e-01, 2DIAGNOSTIC, 21, -2.250396419867e-01, 1.515336047281e-06, 4.4673e+00, 8.2747e-02, 2DIAGNOSTIC, 22, -2.250396419867e-01, 1.446432056455e-06, 4.5755e+00, 1.0825e-01, 2DIAGNOSTIC, 23, -2.250396419867e-01, 1.383521803885e-06, 4.6749e+00, 9.9378e-02, 2DIAGNOSTIC, 24, -2.250396419867e-01, 1.325855822160e-06, 4.7919e+00, 1.1700e-01, 2DIAGNOSTIC, 25, -2.250396419867e-01, 1.272804597018e-06, 4.8821e+00, 9.0239e-02, 2DIAGNOSTIC, 26, -2.250396419867e-01, 1.223835492489e-06, 4.9921e+00, 1.0997e-01, 2DIAGNOSTIC, 27, -2.250396419867e-01, 1.178494805146e-06, 5.0933e+00, 1.0119e-01, 2DIAGNOSTIC, 28, -2.250396419867e-01, 1.136393664794e-06, 5.1925e+00, 9.9229e-02, 2DIAGNOSTIC, 29, -2.250396419867e-01, 1.097196853178e-06, 5.2989e+00, 1.0644e-01, 2DIAGNOSTIC, 30, -2.250396419867e-01, 1.060613860016e-06, 5.4049e+00, 1.0592e-01, 2DIAGNOSTIC, 31, -2.250396419867e-01, 1.026391669816e-06, 5.5112e+00, 1.0638e-01, Elapsed time (stage 0): 5.5458e+00 Total elapsed time: 5.5462e+00 + ConvertToJpg 20200124_siyuanhu_casewestern_NIST_t1map_modifheader.nii.gz 20200124_siyuanhu_casewestern_NIST_t1map_modifheader.jpg Updated reader Dire in 0.999986 0.00521339 -0.00521339 0.999986 Dire out 0.999986 0.00521339 -0.00521339 0.999986 + ConvertToJpg 20200124_siyuanhu_casewestern_NIST_t1map_reg.nii.gz 20200124_siyuanhu_casewestern_NIST_t1map_reg.jpg Updated reader Dire in 0.999986 0.00521339 -0.00521339 0.999986 Dire out 0.999986 0.00521339 -0.00521339 0.999986 + for file in '$FILES' + file=20200204_mrel_usc_GE3T_MR1_NIST_t1map + fileout=20200204_mrel_usc_GE3T_MR1_NIST_t1map_reg + '[' 20200204_mrel_usc_GE3T_MR1_NIST_t1map '!=' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map ']' + CopyImageHeaderInformation 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200204_mrel_usc_GE3T_MR1_NIST_t1map.nii.gz 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader.nii.gz 1 1 0 libc++abi.dylib: terminating with uncaught exception of type itk::ExceptionObject: /Users/mathieuboudreau/neuropoly/rrsg/github/antsInstallExample/build/staging/include/ITK-5.1/itkImageBase.hxx:184: itk::ERROR: Image(0x7fdff8fc67f0): Bad direction, determinant is 0. Direction is 1 0 0 -0 /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 40: 37589 Abort trap: 6 CopyImageHeaderInformation $FILEREF.$EXT $file.$EXT ${file}_modifheader.$EXT 1 1 0 + CopyImageHeaderInformation 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200204_mrel_usc_GE3T_MR1_NIST_t1map_labels.nii.gz 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader_labels.nii.gz 1 1 0 + file=20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader + antsLandmarkBasedTransformInitializer 2 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_labels.nii.gz 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader_labels.nii.gz affine 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader.mat + antsApplyTransforms -d 2 -r 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz -i 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader.nii.gz -o 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader_reg-labelbased.nii.gz -t 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader.mat file 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader.nii.gz does not exist . libc++abi.dylib: terminating with uncaught exception of type itk::ExceptionObject: /Users/mathieuboudreau/neuropoly/rrsg/github/antsInstallExample/build/ITKv5/Modules/Core/Common/src/itkProcessObject.cxx:1340: itk::ERROR: ResampleImageFilter(0x7fa29ba6fa30): Input Primary is required but not set. /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 40: 37592 Abort trap: 6 antsApplyTransforms -d 2 -r $FILEREF.$EXT -i $file.$EXT -o ${file}_reg-labelbased.$EXT -t $file.mat + antsRegistration -d 2 -r 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader.mat -t 'Affine[0.1]' -m 'CC[' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz , '20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader.nii.gz]' -c 100x100x100 -s 0x0x0 -f 4x2x1 -x 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_mask.nii.gz -o '[,' '20200204_mrel_usc_GE3T_MR1_NIST_t1map_reg.nii.gz]' -v All_Command_lines_OK Using double precision for computations. ============================================================================= The composite transform comprises the following transforms (in order): 1. 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader.mat (type = AffineTransform) ============================================================================= Reading mask(s). Registration stage 0 Fixed mask = 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_mask.nii.gz number of levels = 3 fixed image: 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz moving image: 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader.nii.gz file 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader.nii.gz does not exist . /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 40: 37593 Segmentation fault: 11 antsRegistration -d 2 -r $file.mat -t Affine[0.1] -m CC[ $FILEREF.$EXT , $file.$EXT] -c 100x100x100 -s 0x0x0 -f 4x2x1 -x $FILEREF${SUFFIXMASK}.$EXT -o [$file_, $fileout.$EXT] -v + ConvertToJpg 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader.nii.gz 20200204_mrel_usc_GE3T_MR1_NIST_t1map_modifheader.jpg /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 40: 37594 Segmentation fault: 11 ConvertToJpg $file.$EXT $file.jpg + ConvertToJpg 20200204_mrel_usc_GE3T_MR1_NIST_t1map_reg.nii.gz 20200204_mrel_usc_GE3T_MR1_NIST_t1map_reg.jpg /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 40: 37595 Segmentation fault: 11 ConvertToJpg $fileout.$EXT $fileout.jpg + for file in '$FILES' + file=20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map + fileout=20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_reg + '[' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map '!=' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map ']' + for file in '$FILES' + file=20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map + fileout=20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_reg + '[' 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map '!=' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map ']' + CopyImageHeaderInformation 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map.nii.gz 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader.nii.gz 1 1 0 + CopyImageHeaderInformation 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_labels.nii.gz 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader_labels.nii.gz 1 1 0 + file=20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader + antsLandmarkBasedTransformInitializer 2 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_labels.nii.gz 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader_labels.nii.gz affine 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader.mat + antsApplyTransforms -d 2 -r 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz -i 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader.nii.gz -o 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader_reg-labelbased.nii.gz -t 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader.mat + antsRegistration -d 2 -r 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader.mat -t 'Affine[0.1]' -m 'CC[' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz , '20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader.nii.gz]' -c 100x100x100 -s 0x0x0 -f 4x2x1 -x 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_mask.nii.gz -o '[,' '20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_reg.nii.gz]' -v All_Command_lines_OK Using double precision for computations. ============================================================================= The composite transform comprises the following transforms (in order): 1. 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader.mat (type = AffineTransform) ============================================================================= Reading mask(s). Registration stage 0 Fixed mask = 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_mask.nii.gz number of levels = 3 fixed image: 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz moving image: 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader.nii.gz Dimension = 2 Number of stages = 1 Use Histogram Matching false Winsorize image intensities false Lower quantile = 0 Upper quantile = 1 Stage 1 State Image metric = CC Fixed image = Image (0x7fe891f81c70) RTTI typeinfo: itk::Image Reference Count: 2 Modified Time: 1517 Debug: Off Object Name: Observers: none Source: (none) Source output name: (none) Release Data: Off Data Released: False Global Release Data: Off PipelineMTime: 0 UpdateMTime: 1298 RealTimeStamp: 0 seconds LargestPossibleRegion: Dimension: 2 Index: [0, 0] Size: [192, 192] BufferedRegion: Dimension: 2 Index: [0, 0] Size: [192, 192] RequestedRegion: Dimension: 2 Index: [0, 0] Size: [192, 192] Spacing: [1, 1] Origin: [-96.0404, -61.8271] Direction: 0.999676 -0.015025 -0.0254473 0.999887 IndexToPointMatrix: 0.999676 -0.015025 -0.0254473 0.999887 PointToIndexMatrix: 1.00071 0.0150373 0.0254681 1.0005 Inverse Direction: 1.00071 0.0150373 0.0254681 1.0005 PixelContainer: ImportImageContainer (0x7fe891f81a70) RTTI typeinfo: itk::ImportImageContainer Reference Count: 1 Modified Time: 1295 Debug: Off Object Name: Observers: none Pointer: 0x112a58000 Container manages memory: true Size: 36864 Capacity: 36864 Moving image = Image (0x7fe891f83470) RTTI typeinfo: itk::Image Reference Count: 2 Modified Time: 1518 Debug: Off Object Name: Observers: none Source: (none) Source output name: (none) Release Data: Off Data Released: False Global Release Data: Off PipelineMTime: 0 UpdateMTime: 1515 RealTimeStamp: 0 seconds LargestPossibleRegion: Dimension: 2 Index: [0, 0] Size: [256, 256] BufferedRegion: Dimension: 2 Index: [0, 0] Size: [256, 256] RequestedRegion: Dimension: 2 Index: [0, 0] Size: [256, 256] Spacing: [1, 1] Origin: [-96.0404, -61.8271] Direction: 0.999986 0.00521339 -0.00521339 0.999986 IndexToPointMatrix: 0.999986 0.00521339 -0.00521339 0.999986 PointToIndexMatrix: 0.999986 -0.00521339 0.00521339 0.999986 Inverse Direction: 0.999986 -0.00521339 0.00521339 0.999986 PixelContainer: ImportImageContainer (0x7fe891f83630) RTTI typeinfo: itk::ImportImageContainer Reference Count: 1 Modified Time: 1512 Debug: Off Object Name: Observers: none Pointer: 0x112aa0000 Container manages memory: true Size: 65536 Capacity: 65536 Weighting = 1 Sampling strategy = none Number of bins = 32 Radius = 4 Sampling percentage = 1 Transform = Affine Gradient step = 0.1 Update field sigma (voxel space) = 0 Total field sigma (voxel space) = 0 Update field time sigma = 0 Total field time sigma = 0 Number of time indices = 0 Number of time point samples = 0 Registration using 1 total stages. Stage 0 iterations = 100x100x100 convergence threshold = 1e-06 convergence window size = 10 number of levels = 3 using the CC metric (radius = 4, weight = 1) Shrink factors (level 1 out of 3): [4, 4] Shrink factors (level 2 out of 3): [2, 2] Shrink factors (level 3 out of 3): [1, 1] smoothing sigmas per level: [0, 0, 0] Using default NONE metricSamplingStrategy *** Running AffineTransform registration *** DIAGNOSTIC,Iteration,metricValue,convergenceValue,ITERATION_TIME_INDEX,SINCE_LAST 2DIAGNOSTIC, 1, -5.035096130706e-01, 1.797693134862e+308, 2.2855e-02, 2.2853e-02, 2DIAGNOSTIC, 2, -5.134468784156e-01, 1.797693134862e+308, 3.1890e-02, 9.0349e-03, 2DIAGNOSTIC, 3, -5.385851952946e-01, 1.797693134862e+308, 3.9791e-02, 7.9010e-03, 2DIAGNOSTIC, 4, -6.338233111459e-01, 1.797693134862e+308, 4.5602e-02, 5.8112e-03, 2DIAGNOSTIC, 5, -8.316923462550e-01, 1.797693134862e+308, 5.7629e-02, 1.2027e-02, 2DIAGNOSTIC, 6, -8.359329074296e-01, 1.797693134862e+308, 6.7340e-02, 9.7110e-03, 2DIAGNOSTIC, 7, -8.396973032020e-01, 1.797693134862e+308, 7.4718e-02, 7.3781e-03, 2DIAGNOSTIC, 8, -8.427887879813e-01, 1.797693134862e+308, 8.0133e-02, 5.4150e-03, 2DIAGNOSTIC, 9, -8.465039481579e-01, 1.797693134862e+308, 8.6201e-02, 6.0680e-03, 2DIAGNOSTIC, 10, -8.538506478592e-01, 3.736356484837e-02, 9.8999e-02, 1.2797e-02, 2DIAGNOSTIC, 11, -8.539652021013e-01, 2.707918826018e-02, 1.0663e-01, 7.6330e-03, 2DIAGNOSTIC, 12, -8.545265272403e-01, 1.681244753197e-02, 1.3440e-01, 2.7764e-02, 2DIAGNOSTIC, 13, -8.545265169210e-01, 7.556279464053e-03, 1.7087e-01, 3.6472e-02, 2DIAGNOSTIC, 14, -8.545265169207e-01, 1.493834110947e-03, 1.9333e-01, 2.2463e-02, 2DIAGNOSTIC, 15, -8.545265169207e-01, 1.077620796732e-03, 2.0205e-01, 8.7199e-03, 2DIAGNOSTIC, 16, -8.545265169207e-01, 7.175180874276e-04, 2.1161e-01, 9.5561e-03, 2DIAGNOSTIC, 17, -8.545265169207e-01, 4.208619012410e-04, 2.2103e-01, 9.4249e-03, 2DIAGNOSTIC, 18, -8.545265169207e-01, 1.838025960060e-04, 2.2951e-01, 8.4822e-03, 2DIAGNOSTIC, 19, -8.545265169207e-01, 2.402014567087e-05, 2.5081e-01, 2.1294e-02, 2DIAGNOSTIC, 20, -8.545265169207e-01, 1.182875810908e-05, 2.6442e-01, 1.3617e-02, 2DIAGNOSTIC, 21, -8.545265169207e-01, 1.633474933836e-06, 2.7684e-01, 1.2420e-02, 2DIAGNOSTIC, 22, -8.545265169207e-01, 1.553850633294e-06, 2.8582e-01, 8.9712e-03, 2DIAGNOSTIC, 23, -8.545265169207e-01, 1.481483171112e-06, 2.9712e-01, 1.1307e-02, 2DIAGNOSTIC, 24, -8.545265169207e-01, 1.415556475814e-06, 3.0838e-01, 1.1257e-02, 2DIAGNOSTIC, 25, -8.545265169207e-01, 1.355247334377e-06, 3.1689e-01, 8.5118e-03, 2DIAGNOSTIC, 26, -8.545265169207e-01, 1.299867086878e-06, 3.3459e-01, 1.7703e-02, 2DIAGNOSTIC, 27, -8.545265169207e-01, 1.248835218570e-06, 3.4805e-01, 1.3459e-02, 2DIAGNOSTIC, 28, -8.545265169207e-01, 1.201658933338e-06, 3.5789e-01, 9.8319e-03, 2DIAGNOSTIC, 29, -8.545265169207e-01, 1.157917188431e-06, 3.6502e-01, 7.1371e-03, 2DIAGNOSTIC, 30, -8.545265169207e-01, 1.117248093624e-06, 3.7881e-01, 1.3785e-02, 2DIAGNOSTIC, 31, -8.545265169207e-01, 1.079338875658e-06, 3.9024e-01, 1.1433e-02, 2DIAGNOSTIC, 32, -8.545265169207e-01, 1.043917818924e-06, 4.0475e-01, 1.4507e-02, 2DIAGNOSTIC, 33, -8.545265169207e-01, 1.010747742371e-06, 4.1326e-01, 8.5120e-03, DIAGNOSTIC,Iteration,metricValue,convergenceValue,ITERATION_TIME_INDEX,SINCE_LAST 2DIAGNOSTIC, 1, -7.285572751403e-01, 1.797693134862e+308, 4.4944e-01, 3.6181e-02, 2DIAGNOSTIC, 2, -7.296883119649e-01, 1.797693134862e+308, 4.7557e-01, 2.6132e-02, 2DIAGNOSTIC, 3, -7.300891066985e-01, 1.797693134862e+308, 5.0103e-01, 2.5459e-02, 2DIAGNOSTIC, 4, -7.308555996398e-01, 1.797693134862e+308, 5.2447e-01, 2.3441e-02, 2DIAGNOSTIC, 5, -7.360601866323e-01, 1.797693134862e+308, 5.5018e-01, 2.5712e-02, 2DIAGNOSTIC, 6, -7.458347044154e-01, 1.797693134862e+308, 6.1154e-01, 6.1360e-02, 2DIAGNOSTIC, 7, -7.474359855542e-01, 1.797693134862e+308, 6.4248e-01, 3.0936e-02, 2DIAGNOSTIC, 8, -7.511675757954e-01, 1.797693134862e+308, 6.7171e-01, 2.9230e-02, 2DIAGNOSTIC, 9, -7.602474703860e-01, 1.797693134862e+308, 7.0414e-01, 3.2430e-02, 2DIAGNOSTIC, 10, -7.658208116540e-01, 3.375633429976e-03, 7.2983e-01, 2.5687e-02, 2DIAGNOSTIC, 11, -7.663778977372e-01, 3.328546377366e-03, 7.5509e-01, 2.5258e-02, 2DIAGNOSTIC, 12, -7.678319955857e-01, 3.080034642583e-03, 7.8130e-01, 2.6214e-02, 2DIAGNOSTIC, 13, -7.696829779000e-01, 2.663254347528e-03, 8.2594e-01, 4.4636e-02, 2DIAGNOSTIC, 14, -7.698819592148e-01, 2.086544038029e-03, 8.5711e-01, 3.1169e-02, 2DIAGNOSTIC, 15, -7.698863128823e-01, 1.522741300213e-03, 9.0532e-01, 4.8219e-02, 2DIAGNOSTIC, 16, -7.698864158869e-01, 1.125965364410e-03, 9.3826e-01, 3.2931e-02, 2DIAGNOSTIC, 17, -7.698864351580e-01, 7.104844405943e-04, 9.7310e-01, 3.4848e-02, 2DIAGNOSTIC, 18, -7.698864381297e-01, 3.502032138522e-04, 1.0178e+00, 4.4672e-02, 2DIAGNOSTIC, 19, -7.698864386909e-01, 1.734110610540e-04, 1.0755e+00, 5.7713e-02, 2DIAGNOSTIC, 20, -7.698864388115e-01, 1.040355685297e-04, 1.1224e+00, 4.6912e-02, 2DIAGNOSTIC, 21, -7.698864388417e-01, 4.152671798634e-05, 1.1594e+00, 3.7035e-02, 2DIAGNOSTIC, 22, -7.698864388481e-01, 5.009788593247e-06, 1.1959e+00, 3.6470e-02, 2DIAGNOSTIC, 23, -7.698864388496e-01, 1.480307445158e-06, 1.2380e+00, 4.2139e-02, 2DIAGNOSTIC, 24, -7.698864388499e-01, 1.348051050343e-06, 1.2724e+00, 3.4319e-02, 2DIAGNOSTIC, 25, -7.698864388499e-01, 1.291505284953e-06, 1.3147e+00, 4.2353e-02, 2DIAGNOSTIC, 26, -7.698864388499e-01, 1.240808785184e-06, 1.3507e+00, 3.5976e-02, 2DIAGNOSTIC, 27, -7.698864388499e-01, 1.194178618866e-06, 1.3863e+00, 3.5640e-02, 2DIAGNOSTIC, 28, -7.698864388499e-01, 1.150961173327e-06, 1.4419e+00, 5.5552e-02, 2DIAGNOSTIC, 29, -7.698864388499e-01, 1.110768886169e-06, 1.4720e+00, 3.0085e-02, 2DIAGNOSTIC, 30, -7.698864388499e-01, 1.073290267654e-06, 1.5076e+00, 3.5582e-02, 2DIAGNOSTIC, 31, -7.698864388499e-01, 1.038258562520e-06, 1.5490e+00, 4.1487e-02, 2DIAGNOSTIC, 32, -7.698864388499e-01, 1.005441479941e-06, 1.5835e+00, 3.4462e-02, DIAGNOSTIC,Iteration,metricValue,convergenceValue,ITERATION_TIME_INDEX,SINCE_LAST 2DIAGNOSTIC, 1, -4.088795966029e-01, 1.797693134862e+308, 1.6932e+00, 1.0974e-01, 2DIAGNOSTIC, 2, -4.217898421359e-01, 1.797693134862e+308, 1.7863e+00, 9.3037e-02, 2DIAGNOSTIC, 3, -4.312945782285e-01, 1.797693134862e+308, 1.9668e+00, 1.8053e-01, 2DIAGNOSTIC, 4, -4.321984045499e-01, 1.797693134862e+308, 2.0988e+00, 1.3200e-01, 2DIAGNOSTIC, 5, -4.329712953060e-01, 1.797693134862e+308, 2.2216e+00, 1.2277e-01, 2DIAGNOSTIC, 6, -4.335953234435e-01, 1.797693134862e+308, 2.3369e+00, 1.1534e-01, 2DIAGNOSTIC, 7, -4.338152545328e-01, 1.797693134862e+308, 2.4230e+00, 8.6076e-02, 2DIAGNOSTIC, 8, -4.338938888150e-01, 1.797693134862e+308, 2.5187e+00, 9.5691e-02, 2DIAGNOSTIC, 9, -4.342644326909e-01, 1.797693134862e+308, 2.6448e+00, 1.2614e-01, 2DIAGNOSTIC, 10, -4.348171961232e-01, 2.616637615711e-03, 2.8038e+00, 1.5897e-01, 2DIAGNOSTIC, 11, -4.348862360032e-01, 1.089412588029e-03, 2.8996e+00, 9.5792e-02, 2DIAGNOSTIC, 12, -4.350278373342e-01, 4.263261228274e-04, 2.9894e+00, 8.9760e-02, 2DIAGNOSTIC, 13, -4.350858656815e-01, 3.128940874332e-04, 3.0907e+00, 1.0133e-01, 2DIAGNOSTIC, 14, -4.350926855916e-01, 2.296299136677e-04, 3.1833e+00, 9.2594e-02, 2DIAGNOSTIC, 15, -4.351053044408e-01, 1.703364737325e-04, 3.2849e+00, 1.0163e-01, 2DIAGNOSTIC, 16, -4.351177582888e-01, 1.291833619166e-04, 3.4903e+00, 2.0543e-01, 2DIAGNOSTIC, 17, -4.351177782539e-01, 9.003780148070e-05, 3.8646e+00, 3.7421e-01, 2DIAGNOSTIC, 18, -4.351177782533e-01, 4.985813452520e-05, 4.1780e+00, 3.1343e-01, 2DIAGNOSTIC, 19, -4.351177782533e-01, 2.185840917703e-05, 4.3381e+00, 1.6009e-01, 2DIAGNOSTIC, 20, -4.351177782533e-01, 1.298050992739e-05, 4.4457e+00, 1.0759e-01, 2DIAGNOSTIC, 21, -4.351177782533e-01, 5.943761701301e-06, 4.5610e+00, 1.1529e-01, 2DIAGNOSTIC, 22, -4.351177782533e-01, 3.323291032947e-06, 4.6651e+00, 1.0417e-01, 2DIAGNOSTIC, 23, -4.351177782533e-01, 2.418545948582e-06, 4.7625e+00, 9.7419e-02, 2DIAGNOSTIC, 24, -4.351177782533e-01, 1.674037947472e-06, 4.8777e+00, 1.1515e-01, 2DIAGNOSTIC, 25, -4.351177782533e-01, 1.279274820874e-06, 4.9829e+00, 1.0520e-01, 2DIAGNOSTIC, 26, -4.351177782533e-01, 1.229331778471e-06, 5.1262e+00, 1.4332e-01, 2DIAGNOSTIC, 27, -4.351177782533e-01, 1.183590547786e-06, 5.2471e+00, 1.2092e-01, 2DIAGNOSTIC, 28, -4.351177782533e-01, 1.141131093341e-06, 5.3538e+00, 1.0669e-01, 2DIAGNOSTIC, 29, -4.351177782533e-01, 1.101612473631e-06, 5.4715e+00, 1.1764e-01, 2DIAGNOSTIC, 30, -4.351177782533e-01, 1.064739382543e-06, 5.5962e+00, 1.2471e-01, 2DIAGNOSTIC, 31, -4.351177782533e-01, 1.030254771210e-06, 5.7034e+00, 1.0725e-01, Elapsed time (stage 0): 5.7356e+00 Total elapsed time: 5.7361e+00 + ConvertToJpg 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader.nii.gz 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_modifheader.jpg Updated reader Dire in 0.999986 0.00521339 -0.00521339 0.999986 Dire out 0.999986 0.00521339 -0.00521339 0.999986 + ConvertToJpg 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_reg.nii.gz 20200226_iveslevesque_muhc_glen_NIST_NoPowerError_t1map_reg.jpg Updated reader Dire in 0.999986 0.00521339 -0.00521339 0.999986 Dire out 0.999986 0.00521339 -0.00521339 0.999986 + for file in '$FILES' + file=Aachen_MR1_Complex_t1map + fileout=Aachen_MR1_Complex_t1map_reg + '[' Aachen_MR1_Complex_t1map '!=' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map ']' + CopyImageHeaderInformation 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz Aachen_MR1_Complex_t1map.nii.gz Aachen_MR1_Complex_t1map_modifheader.nii.gz 1 1 0 libc++abi.dylib: terminating with uncaught exception of type itk::ExceptionObject: /Users/mathieuboudreau/neuropoly/rrsg/github/antsInstallExample/build/staging/include/ITK-5.1/itkImageBase.hxx:184: itk::ERROR: Image(0x7fa3638dfac0): Bad direction, determinant is 0. Direction is 1 0 0 -0 /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 40: 37607 Abort trap: 6 CopyImageHeaderInformation $FILEREF.$EXT $file.$EXT ${file}_modifheader.$EXT 1 1 0 + CopyImageHeaderInformation 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz Aachen_MR1_Complex_t1map_labels.nii.gz Aachen_MR1_Complex_t1map_modifheader_labels.nii.gz 1 1 0 + file=Aachen_MR1_Complex_t1map_modifheader + antsLandmarkBasedTransformInitializer 2 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_labels.nii.gz Aachen_MR1_Complex_t1map_modifheader_labels.nii.gz affine Aachen_MR1_Complex_t1map_modifheader.mat + antsApplyTransforms -d 2 -r 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz -i Aachen_MR1_Complex_t1map_modifheader.nii.gz -o Aachen_MR1_Complex_t1map_modifheader_reg-labelbased.nii.gz -t Aachen_MR1_Complex_t1map_modifheader.mat file Aachen_MR1_Complex_t1map_modifheader.nii.gz does not exist . libc++abi.dylib: terminating with uncaught exception of type itk::ExceptionObject: /Users/mathieuboudreau/neuropoly/rrsg/github/antsInstallExample/build/ITKv5/Modules/Core/Common/src/itkProcessObject.cxx:1340: itk::ERROR: ResampleImageFilter(0x7fd5325a8a60): Input Primary is required but not set. /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 40: 37610 Abort trap: 6 antsApplyTransforms -d 2 -r $FILEREF.$EXT -i $file.$EXT -o ${file}_reg-labelbased.$EXT -t $file.mat + antsRegistration -d 2 -r Aachen_MR1_Complex_t1map_modifheader.mat -t 'Affine[0.1]' -m 'CC[' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz , 'Aachen_MR1_Complex_t1map_modifheader.nii.gz]' -c 100x100x100 -s 0x0x0 -f 4x2x1 -x 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_mask.nii.gz -o '[,' 'Aachen_MR1_Complex_t1map_reg.nii.gz]' -v All_Command_lines_OK Using double precision for computations. ============================================================================= The composite transform comprises the following transforms (in order): 1. Aachen_MR1_Complex_t1map_modifheader.mat (type = AffineTransform) ============================================================================= Reading mask(s). Registration stage 0 Fixed mask = 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_mask.nii.gz number of levels = 3 fixed image: 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz moving image: Aachen_MR1_Complex_t1map_modifheader.nii.gz file Aachen_MR1_Complex_t1map_modifheader.nii.gz does not exist . /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 40: 37611 Segmentation fault: 11 antsRegistration -d 2 -r $file.mat -t Affine[0.1] -m CC[ $FILEREF.$EXT , $file.$EXT] -c 100x100x100 -s 0x0x0 -f 4x2x1 -x $FILEREF${SUFFIXMASK}.$EXT -o [$file_, $fileout.$EXT] -v + ConvertToJpg Aachen_MR1_Complex_t1map_modifheader.nii.gz Aachen_MR1_Complex_t1map_modifheader.jpg /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 40: 37612 Segmentation fault: 11 ConvertToJpg $file.$EXT $file.jpg + ConvertToJpg Aachen_MR1_Complex_t1map_reg.nii.gz Aachen_MR1_Complex_t1map_reg.jpg /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 40: 37613 Segmentation fault: 11 ConvertToJpg $fileout.$EXT $fileout.jpg # Also convert the reference image ConvertToJpg $FILEREF.$EXT $FILEREF.jpg + ConvertToJpg 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.jpg Updated reader Dire in 0.999676 -0.015025 -0.0254473 0.999887 Dire out 0.999676 -0.015025 -0.0254473 0.999887 ConvertToJpg $FILEREF.$EXT ${FILEREF}_reg.jpg + ConvertToJpg 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_reg.jpg Updated reader Dire in 0.999676 -0.015025 -0.0254473 0.999887 Dire out 0.999676 -0.015025 -0.0254473 0.999887 % ]7;file://mathieu.local/Users/mathieuboudreau/Downloads/NIST_labels (base) mathieuboudreau@mathieu NIST_labels % [?2004heexit[?2004l Script done on Sun Jun 7 22:56:42 2020 ```
mathieuboudreau commented 4 years ago

p.s. I'm using ANTs Version: 2.3.3.dev168-g29bdf

jcohenadad commented 4 years ago

Hum, there was a problem when copying the header from the Gilbert site to another site. I’ll try to reproduce with your version of Ants and after downloading a fresh bundle of the data.

mathieuboudreau commented 4 years ago

Ok, thanks! If you'd let me know of the version that you have installed, I could try with that one too. Eventually I'll create a Dockerfile for this repo.

jcohenadad commented 4 years ago

@mathieuboudreau i can reproduce your error, with my current configuration, after fresh download of the data. I must have modified some of the headers while playing with the data, which made it work on my end, but forgot to keep track of everything. Working on it... Bad start for reproducible science 😅

jcohenadad commented 4 years ago

the fundamental problem is that some nifti files have a corrupted qform (any idea why? do you know if the files were processed with custom scripts before submitting them to the challenge?), and as a result many ANTs functions will not read them. Example:

PrintHeader Aachen_MR1_Complex_t1map.nii.gz
libc++abi.dylib: terminating with uncaught exception of type itk::ExceptionObject: /Users/julien/temp/ants/build/staging/include/ITK-5.1/itkImageBase.hxx:184:
itk::ERROR: Image(0x7f840dae0310): Bad direction, determinant is 0. Direction is 1 0
0 -0

Abort trap: 6

i'm looking into ways to reset the header, while minimizing the dependencies.

EDIT 2020-06-08 13:09:32: the problem is that ITK checks data integrity before loading, and if there are inconsistencies, it crashes. See here. Note: i've tried SetDirectionByMatrix as suggested but it also crashes.

jcohenadad commented 4 years ago

@mathieuboudreau i found a fix using fslcpgeom, is that OK to add this dependency?

mathieuboudreau commented 4 years ago

@mathieuboudreau i found a fix using fslcpgeom, is that OK to add this dependency?

I think that should be ok. The plan was always to make this script into a Dockerfile/docker container. I'll look into installing FSL in one.

jcohenadad commented 4 years ago

@mathieuboudreau can you try 66f1a1cafab9ac824342d741619aba9fae10124d?

mathieuboudreau commented 4 years ago

the fundamental problem is that some nifti files have a corrupted qform (any idea why? do you know if the files were processed with custom scripts before submitting them to the challenge?), and as a result many ANTs functions will not read them. Example:

PrintHeader Aachen_MR1_Complex_t1map.nii.gz
libc++abi.dylib: terminating with uncaught exception of type itk::ExceptionObject: /Users/julien/temp/ants/build/staging/include/ITK-5.1/itkImageBase.hxx:184:
itk::ERROR: Image(0x7f840dae0310): Bad direction, determinant is 0. Direction is 1 0
0 -0

Abort trap: 6

i'm looking into ways to reset the header, while minimizing the dependencies.

EDIT 2020-06-08 13:09:32: the problem is that ITK checks data integrity before loading, and if there are inconsistencies, it crashes. See here. Note: i've tried SetDirectionByMatrix as suggested but it also crashes.

The only thing that I suspected can't be it. We did encounter an issue with some Philips scans, as the DICOM that's produced by these scanners can be in two different formats ("Classic DICOM" or "Enhanced DICOM"), and these can cause issues for qMRI as the Enhanced DICOM isn't properly consistently between acquisition. For some scans, we had to use tools internal to Philips developers to convert some of their data drom Enhanced DICOM back to Classic DICOM.

However, even though Aaschen is a Philips site, mrel is not (GE). So it's possible that this is simply a result of different Dicom to NIFTI converters, or some scanner-specific differences in how they handle the DICOMs I guess?

mathieuboudreau commented 4 years ago

@mathieuboudreau can you try 66f1a1c?

That worked for the labelled dataset you provided, thanks!

However, I just tried it on my own labelled dataset, and it appears that something is not working for the labels/masks that I created myself.

Capture d’écran 2020-06-08 à 16 37 02
/Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 44: 63737 Abort trap: 6 antsLandmarkBasedTransformInitializer 2 $FILEREF$SUFFIXLABEL.$EXT $file$SUFFIXLABEL.$EXT affine $file.mat + antsApplyTransforms -d 2 -r 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz -i Aachen_MR1_Complex_t1map_modifheader.nii.gz -o Aachen_MR1_Complex_t1map_modifheader_reg-labelbased.nii.gz -t Aachen_MR1_Complex_t1map_modifheader.mat Transform file does not exist: Aachen_MR1_Complex_t1map_modifheader.mat + antsRegistration -d 2 -r Aachen_MR1_Complex_t1map_modifheader.mat -t 'Affine[0.1]' -m 'CC[' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz , 'Aachen_MR1_Complex_t1map_modifheader.nii.gz]' -c 100x100x100 -s 0x0x0 -f 4x2x1 -x 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_mask.nii.gz -o '[,' 'Aachen_MR1_Complex_t1map_reg.nii.gz]' -v All_Command_lines_OK Using double precision for computations. Transform file does not exist: Aachen_MR1_Complex_t1map_modifheader.mat Can't read initial transform Aachen_MR1_Complex_t1map_modifheader.mat + ConvertToJpg Aachen_MR1_Complex_t1map_modifheader.nii.gz Aachen_MR1_Complex_t1map_modifheader.jpg Updated reader Dire in 0.999676 -0.015025 -0.0254473 0.999887 Dire out 0.999676 -0.015025 -0.0254473 0.999887 + ConvertToJpg Aachen_MR1_Complex_t1map_reg.nii.gz Aachen_MR1_Complex_t1map_reg.jpg /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 44: 63741 Segmentation fault: 11 ConvertToJpg $fileout.$EXT $fileout.jpg # Also convert the reference image ConvertToJpg $FILEREF.$EXT $FILEREF.jpg + ConvertToJpg 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.jpg Updated reader Dire in 0.999676 -0.015025 -0.0254473 0.999887 Dire out 0.999676 -0.015025 -0.0254473 0.999887 ConvertToJpg $FILEREF.$EXT ${FILEREF}_reg.jpg + ConvertToJpg 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_reg.jpg Updated reader Dire in 0.999676 -0.015025 -0.0254473 0.999887 Dire out 0.999676 -0.015025 -0.0254473 0.999887 # show syntax to convert to gif echo "Done! To convert to gif anim, you can use gifmaker (https://github.com/neuropoly/internal_tools/blob/master/python/gifmaker.py):" + echo 'Done! To convert to gif anim, you can use gifmaker (https://github.com/neuropoly/internal_tools/blob/master/python/gifmaker.py):' Done! To convert to gif anim, you can use gifmaker (https://github.com/neuropoly/internal_tools/blob/master/python/gifmaker.py): echo "gifmaker -i *t1map_reg.jpg -o t1map_reg.gif" + echo 'gifmaker -i *t1map_reg.jpg -o t1map_reg.gif' gifmaker -i *t1map_reg.jpg -o t1map_reg.gif (base) mathieuboudreau@mathieu t1 % clear (base) mathieuboudreau@mathieu t1 % ~/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh + set -v # PARAMETERS # ---------- # Choose reference image. Do NOT add the extension FILEREF="20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map" + FILEREF=20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map # Extension for NIFTI file names EXT="nii.gz" + EXT=nii.gz # Suffix of images to register SUFFIXT1="_t1map" + SUFFIXT1=_t1map SUFFIXLABEL="_labels" + SUFFIXLABEL=_labels SUFFIXMASK="_mask" + SUFFIXMASK=_mask # SCRIPT STARTS HERE # ------------------ # Loop across images and register to the ref image # Note: here we assume that all images to register have the suffix FILES=`ls *${SUFFIXT1}.nii.gz` ls *${SUFFIXT1}.nii.gz ++ ls 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz Aachen_MR1_Complex_t1map.nii.gz + FILES='20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz Aachen_MR1_Complex_t1map.nii.gz' for file in $FILES; do # Remove extension for easier parsing file=${file%???????} fileout=${file}_reg # Skip ref image (no need to register it to itself) if [ $file != $FILEREF ]; then # Some sites placed the phantom with a flip along z axis, or oriented the # FOV along another direction than the ref image, causing the labels to go # in the clockwise direction (whereas they are oriented anti-clockwise in # the ref image), causing the label-based transformation to fail. For this # reason, we need to copy header information from the ref image to the # moving image. # Note: I've also tried flipping the image and labels using PermuteFlipImageOrientationAxes # but for some reasons i do not understand, the flipping does not produce # the same qform between the output image and labels (even though the inputs # have the same qform...). cp $file.$EXT ${file}_modifheader.$EXT fslcpgeom $FILEREF.$EXT ${file}_modifheader.$EXT -d cp $file${SUFFIXLABEL}.$EXT ${file}_modifheader${SUFFIXLABEL}.$EXT fslcpgeom $FILEREF.$EXT ${file}_modifheader${SUFFIXLABEL}.$EXT -d file=${file}_modifheader # Label-based registration antsLandmarkBasedTransformInitializer 2 $FILEREF$SUFFIXLABEL.$EXT $file$SUFFIXLABEL.$EXT affine $file.mat # Apply transformation (only for debugging purpose) antsApplyTransforms -d 2 -r $FILEREF.$EXT -i $file.$EXT -o ${file}_reg-labelbased.$EXT -t $file.mat # Affine registration antsRegistration -d 2 -r $file.mat -t Affine[0.1] -m CC[ $FILEREF.$EXT , $file.$EXT] -c 100x100x100 -s 0x0x0 -f 4x2x1 -x $FILEREF${SUFFIXMASK}.$EXT -o [$file_, $fileout.$EXT] -v # Convert to jpg for easy QC ConvertToJpg $file.$EXT $file.jpg ConvertToJpg $fileout.$EXT $fileout.jpg fi done + for file in '$FILES' + file=20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map + fileout=20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_reg + '[' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map '!=' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map ']' + for file in '$FILES' + file=Aachen_MR1_Complex_t1map + fileout=Aachen_MR1_Complex_t1map_reg + '[' Aachen_MR1_Complex_t1map '!=' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map ']' + cp Aachen_MR1_Complex_t1map.nii.gz Aachen_MR1_Complex_t1map_modifheader.nii.gz + fslcpgeom 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz Aachen_MR1_Complex_t1map_modifheader.nii.gz -d + cp Aachen_MR1_Complex_t1map_labels.nii.gz Aachen_MR1_Complex_t1map_modifheader_labels.nii.gz + fslcpgeom 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz Aachen_MR1_Complex_t1map_modifheader_labels.nii.gz -d + file=Aachen_MR1_Complex_t1map_modifheader + antsLandmarkBasedTransformInitializer 2 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_labels.nii.gz Aachen_MR1_Complex_t1map_modifheader_labels.nii.gz affine Aachen_MR1_Complex_t1map_modifheader.mat libc++abi.dylib: terminating with uncaught exception of type itk::ImageFileReaderException: /Users/mathieuboudreau/neuropoly/rrsg/github/antsInstallExample/build/staging/include/ITK-5.1/itkImageFileReader.hxx:133: Could not create IO object for reading file 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_labels.nii.gz Tried to create one of the following: BMPImageIO BioRadImageIO Bruker2dseqImageIO GDCMImageIO GE4ImageIO GE5ImageIO GiplImageIO HDF5ImageIO JPEGImageIO JPEG2000ImageIO LSMImageIO MGHImageIO MINCImageIO MRCImageIO MetaImageIO NiftiImageIO NrrdImageIO PNGImageIO StimulateImageIO TIFFImageIO VTKImageIO You probably failed to set a file suffix, or set the suffix to an unsupported type. /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 44: 63850 Abort trap: 6 antsLandmarkBasedTransformInitializer 2 $FILEREF$SUFFIXLABEL.$EXT $file$SUFFIXLABEL.$EXT affine $file.mat + antsApplyTransforms -d 2 -r 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz -i Aachen_MR1_Complex_t1map_modifheader.nii.gz -o Aachen_MR1_Complex_t1map_modifheader_reg-labelbased.nii.gz -t Aachen_MR1_Complex_t1map_modifheader.mat Transform file does not exist: Aachen_MR1_Complex_t1map_modifheader.mat + antsRegistration -d 2 -r Aachen_MR1_Complex_t1map_modifheader.mat -t 'Affine[0.1]' -m 'CC[' 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz , 'Aachen_MR1_Complex_t1map_modifheader.nii.gz]' -c 100x100x100 -s 0x0x0 -f 4x2x1 -x 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_mask.nii.gz -o '[,' 'Aachen_MR1_Complex_t1map_reg.nii.gz]' -v All_Command_lines_OK Using double precision for computations. Transform file does not exist: Aachen_MR1_Complex_t1map_modifheader.mat Can't read initial transform Aachen_MR1_Complex_t1map_modifheader.mat + ConvertToJpg Aachen_MR1_Complex_t1map_modifheader.nii.gz Aachen_MR1_Complex_t1map_modifheader.jpg Updated reader Dire in 0.999676 -0.015025 -0.0254473 0.999887 Dire out 0.999676 -0.015025 -0.0254473 0.999887 + ConvertToJpg Aachen_MR1_Complex_t1map_reg.nii.gz Aachen_MR1_Complex_t1map_reg.jpg /Users/mathieuboudreau/neuropoly/rrsg/github/analysis/register_t1maps_nist.sh: line 44: 63856 Segmentation fault: 11 ConvertToJpg $fileout.$EXT $fileout.jpg # Also convert the reference image ConvertToJpg $FILEREF.$EXT $FILEREF.jpg + ConvertToJpg 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.jpg Updated reader Dire in 0.999676 -0.015025 -0.0254473 0.999887 Dire out 0.999676 -0.015025 -0.0254473 0.999887 ConvertToJpg $FILEREF.$EXT ${FILEREF}_reg.jpg + ConvertToJpg 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map.nii.gz 20200210_guillaumegilbert_muhc_NIST_Magnitude_t1map_reg.jpg Updated reader Dire in 0.999676 -0.015025 -0.0254473 0.999887 Dire out 0.999676 -0.015025 -0.0254473 0.999887 # show syntax to convert to gif echo "Done! To convert to gif anim, you can use gifmaker (https://github.com/neuropoly/internal_tools/blob/master/python/gifmaker.py):" + echo 'Done! To convert to gif anim, you can use gifmaker (https://github.com/neuropoly/internal_tools/blob/master/python/gifmaker.py):' Done! To convert to gif anim, you can use gifmaker (https://github.com/neuropoly/internal_tools/blob/master/python/gifmaker.py): echo "gifmaker -i *t1map_reg.jpg -o t1map_reg.gif" + echo 'gifmaker -i *t1map_reg.jpg -o t1map_reg.gif' gifmaker -i *t1map_reg.jpg -o t1map_reg.gif (base) mathieuboudreau@mathieu t1 %

No registered mask is produced for Aaschen in my case.

I created the labeled datasets and mask using FSLeyes, following these steps:

Capture d’écran 2020-06-08 à 16 40 49

Here is a zipped file with my labels & images: Archive.zip

Did you do your labels with FSLeyes, or another software? Is there a step missing in my workflow, or did I make a mistake somewhere?

jcohenadad commented 4 years ago

@mathieuboudreau i do it differently, see here: https://www.youtube.com/watch?v=HblJ_skvU44

mathieuboudreau commented 4 years ago

Perfect - that solved it. Thanks for the video instructions!