Trouble running nibabies on third-party segmentation

Summary of what happened:

Hi neurostars,

I’m new to this list, and I’m trying to run nibabies on a segmentation for a six-month old baby that was generated by a third-party organization (probably before nibabies/bibsnet existed). The GM/WM boundary looks surprising good, despite the age. I am trying to fool nibabies into believing it is bibsnet-generated, so I relabeled the ROI’s to match FreeSurferColorLUT.txt ( freesurfer/distribution/FreeSurferColorLUT.txt at dev · freesurfer/freesurfer · GitHub ). There were a few ROI’s missing, including Left/Right-Accumbens-area.

You can see my errors below.

There is a nibabies-generated label table here:

nibabies_25_2_wf/single_subject_sub-103840_ses-6mo_wf/bold_ses_6mo_task_rest_run_01_wf/subcortical_mni_alignment_wf/atlas_labels/tpl-MNI152NLin6Asym_res-02_atlas-HCP_dseg_labels.txt

If I’m reading it correctly, vol0009 corresponds to DIENCEPHALON_VENTRAL_LEFT.
It’s true that my third-party segmentation is missing this label, but so are other bibsnet-generated segmentations I have looked at that process through nibabies successfully.

Any ideas of what I can do to get past this? These third-party segmentations look promising, especially for this age group.

Thanks,

Donna

Command used (and if a helper script was used, a link to the helper script or the command generated):

docker run --rm -i -u XXXX:YY \
-v /my_fs_distro/.license:/opt/freesurfer/license.txt:ro \
-v /my/dataset/folder/rawdata:/data:ro \
-v /my/dataset/folder/derivatives/nibabies:/out \
-v /my/dataset/folder/work/nibabies/sub-103840:/work \
-v /my/dataset/folder/derivatives/bibsnet:/deriv1 \
nipreps/nibabies:25.2.1 \
/data /out participant \
--participant-label 103840 \
-s 6mo \
-w /work \
--verbose \
--derivatives /deriv1 \
--fd-spike-threshold 0.2 \
--age-months 6 \
--surface-recon-method infantfs \
--cifti-output 91k \
--debug registration \
--project-goodvoxels \
--multi-step-reg \
--norm-csf \
--omp-nthreads 7 --mem 100G --nprocs 7 \
--stop-on-first-crash \
--output-spaces fsLR MNIInfant:cohort-3 MNI152NLin6Asym:res-2 T1w

Version:

nipreps/nibabies:25.2.1

Environment (Docker, Singularity / Apptainer, custom installation):

Docker

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

I was getting this error:

WARNING: Failed to parse caret volume extension: unexpected character
line number: 39 column number: 1

While running:
wb_command -cifti-create-dense-timeseries out.dtseries.nii -volume /work/nibabies_25_2_wf/single_subject_sub-103840_ses-6mo_wf/bold_ses_6mo_task_rest_run_01_wf/subcortical_mni_alignment_wf/bold_mask_roi/mapflow/_bold_mask_roi8/sub-103840_ses-6mo_task-rest_run-01_bold_valid_tshift_xformresampled_flirt_masked.nii.gz /work/nibabies_25_2_wf/single_subject_sub-103840_ses-6mo_wf/bold_ses_6mo_task_rest_run_01_wf/subcortical_mni_alignment_wf/vol_label/mapflow/_vol_label8/vol0008_flirt_maths_labels.nii.gz

ERROR: cifti xml dimensions must be greater than zero

So I drew in the accumbens and it got a step further. Now it fails with:

WARNING: Failed to parse caret volume extension: unexpected character
line number: 39 column number: 1

While running:
wb_command -cifti-create-dense-timeseries out.dtseries.nii -volume /work/nibabies_25_2_wf/single_subject_sub-103840_ses-6mo_wf/bold_ses_6mo_task_rest_run_01_wf/subcortical_mni_alignment_wf/bold_mask_roi/mapflow/_bold_mask_roi9/sub-103840_ses-6mo_task-rest_run-01_bold_valid_tshift_xformresampled_flirt_masked.nii.gz /work/nibabies_25_2_wf/single_subject_sub-103840_ses-6mo_wf/bold_ses_6mo_task_rest_run_01_wf/subcortical_mni_alignment_wf/vol_label/mapflow/_vol_label9/vol0009_flirt_maths_labels.nii.gz

ERROR: cifti xml dimensions must be greater than zero

Screenshots / relevant information:


Hi @donna.dierker - you’ll need the segmentation to contain all the expected labels, as each subcortical structure is registered to the template and then combined when creating the dtseries. Depending on what output you would like, you could just remove the --cifti-output argument and still get surface processing + volumetric output (just without the subcortical alignment).

Hi mgxd, thank you very much for your reply! I do need cifti, so I went ahead and drew in the left/right VentralDC labels, too, and it worked. (I am ashamed to admit I didn’t realize these corresponded to DIENCEPHALON_VENTRAL in the label table.). We will figure out a way to get these labeled for this project. Thank you again for your speedy reply! –Donna