Heudiconv (single session)- problems with heuristic.py

Dear all,

I have a single session to each subject (5 runs per each).
I tried to run heuristic.py; dcm2niix is working, but the output is not order (in Nifti folder: “run001.nii.gz”…“run005.nii.gz” and not “code/sub-01/anat/sub-01_run-001_T1w” for example)

my script:

(I also tried to specified s.dim1/s.dim2 but I got the same results

docker run --rm -it -v mypath:/base nipy/heudiconv:latest -d /base/Dicom/sub-{subject}//MR. -o /base/Nifti/ -f /base/Nifti/code/heuristic.py -s 01 -c dcm2niix -b --overwrite

Ahoi hoi @Tali_Weiss,

a couple of ideas:

  • Do you have multiple T1w and T2w images? If not, the respective part of the for loop should not treat t1w and t2w as lists, but single variables (e.g. info[t1w] = [s.series_id] & info[t2w] = [s.series_id])
  • Your func-task is missing the task- identifier, it should be sub-{subject}_task-odors_run-0{item:01d}_bold
  • I assume the typo in your -d (-d /base/Dicom/sub-{subject}//MR.) is only present in this post and not your original docker run?

Cheers, Peer

Thank you Peer!

I correct my heuristic.py for t1w,t2w and dwi (= [s.series_id])

The output is still in the same order as in my dicominfo.tsv

The error in my terminal (for all runs):
WARNING: Failed to detect fullfilled BIDS layout. No scans.tsv file(s) will be produced for /base/Nifti/run001.json

What am I doing wrong? :frowning:

btw, why new users can only put one image in a post?

I found that if I delete .auto/.edit.txt files its works :slight_smile:
Perhaps this step can be added to the tutorial?

1 Like