Closed finnlennartsson closed 4 months ago
This should now all be modifed in the script. The combination of thalamus.mif and lobes_parcels.mif is now successful.
The final output so far when running results in: lobes_parcels.mif --> sub-id/anat thalamus.mif --> sub-id/anat/ thalamus_lobes.mif --> sub-id/anat
the thomasr.mif and thomasl.mif (converted from the HIPS-THOMAS output .nii.gz files in left/right) are put in left/right in sMRI_thalamic_thomas/sub-id to keep the data related to thomas in that folder.
You have done almost everything correct in
dMRI/thalamic_connectome.sh
!! Well done!All the convert.txt and label.txt file pairs are all correct and the sequence of stuff! So this should work.
Some things.
1) You need to have the same dimensions (matrix and voxel-dimension) for aparc+aseg.mgz and the thalamic stuff, so that is what fails you. Both are inherently 1x1x1 dim and 256x256x256. You can check the dimensions with
mrinfo "file"
You are working with the cropped output of the thomas output (which is 1x1x1 but not 256x256x256), and should usethomasfull.nii.gz
instead. So change here (NOTE - typo in thomasr.nii.gz) https://github.com/sotnir/NENAH-BIDS/blob/63cebe9fce4aee938c91c6210dc25885136e7f83/dMRI/thalamic_connectome.sh#L73-L742) The final output directory for the connectome should be
derivatives/dMRI/sID/dwi/connectome
You have not yet done this, but this is where output for thetck2connectome
ends up3) The output of the anatomical files should be put in
derivatives/dMRI/sID/anat/
as they belong to the dMRI-pipeline. So change output_lobes_parcels="${datadir}/sMRI_fs-segmentation/sub-${sID}/mri/${sID}_lobes_parcels.mif" left_thomas_segm_nifty="${datadir}/sMRI_thalamic_thomas/sub-${sID}/left/thomas.nii.gz" right_thomas_segm_nifty="${datadir}/sMRI_thalamic_thomas/sub-${sID}/right/thomasr.nii.gz" to be located inderivatives/dMRI/sID/anat/
4) $datadir should be consistent throughout the pipeline and point to
derivatives/dMRI/sID
Instead use$studydir/derivatives/sMRI_thalamic_thomas
and$studydir/derivatives/sMRI_thalamic_thomas
when you look for those files in aparc_aseg="${datadir}/sMRI_fs-segmentation/sub-${sID}/mri/aparc+aseg.mgz" left_convert="${datadir}/sMRI_thalamic_thomas/left_convert.txt" right_convert="${datadir}/sMRI_thalamic_thomas/right_convert.txt" left_labels="${datadir}/sMRI_thalamic_thomas/left_labels.txt" right_labels="${datadir}/sMRI_thalamic_thomas/right_labels.txt" left_thomas_segm_nifty="${datadir}/sMRI_thalamic_thomas/sub-${sID}/left/thomas.nii.gz" right_thomas_segm_nifty="${datadir}/sMRI_thalamic_thomas/sub-${sID}/right/thomasr.nii.gz"5) The convert.txt and label.txt files for thomas should not be located in a "pipeline-folder". I use to put them in the github repo. So create a folder in the github repo
$studydir/code/NENAH-BIDS/label_names
and put the files there. This can be reached either like before, or better with through a "$codedir" call.