Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecognized run structure from enhanced DICOMs #256

Open
helena-balabin opened this issue Jan 15, 2025 · 12 comments
Open

Unrecognized run structure from enhanced DICOMs #256

helena-balabin opened this issue Jan 15, 2025 · 12 comments

Comments

@helena-balabin
Copy link

General summary
Hi! I have been really enjoying bidscoin so far, I find it quite convenient 😄.

I am currently trying to convert some raw enhanced DICOMs to BIDS, but for some reason, bidscoin seems to struggle with recognizing the run structure in my functional MRI data.

The DICOM folder in the func/ subfolder of my raw data contains image files (IM_0001, IM_0005, IM_0008, ...) and some extra files (PS_0002, PS_0006, PS_0009, ..., XX_0003, XX_0004, XX_0007, ...) for a total of 12 runs of an identical fMRI sequence.

Currently, the respective func/ part in the resulting BIDS folder is looking something like this:
image

It seems that the runs are converted into suffices a-k instead of run numbers. Also, something else seems to be instead interpreted as the run number, because I end up with some files that contain "run-1" or "run-2" Interestingly, when I just run dcm2niix myself, I don't seem to have any issues:
image

I am not sure if this is expected behavior or a bug, but in any case, is there any chance I can replace the a-k suffices with appropriate run indices? Thanks a lot in advance!

Additional detail
I am running bidscoin 4.4.0 and dcm2niix v1.0.20241211 on Linux.

@marcelzwiers
Copy link
Collaborator

Hi there, hope I can keep you as a happy bidscoin user :-). In your output, there are a lot of files with a, b, c, etc suffixes. These are undesirable and are produced by dcm2niix if it sees that the output file already exists. This can happen either because you re-running bidscoiner without first cleaning up the bids output directory, i.e. without removing the output of the previous run. The other possibility is that multiple Series (images) are stored in the same folder, so dcm2niix has to add suffixes to the output name when it converts the data in the series folder (which is supposed to contain a single Series/image). So I need to know, do you still get the problem if you run bidscoiner without there being any output data?

@helena-balabin
Copy link
Author

Thanks a lot for the quick reply 😄! I ran bidscoiner on an entirely new/empty output folder, so I don't believe it's related to any previous outputs. So if I understand correctly, it might instead be related to the fact that all my inputs (my 12 image files for the 12 runs) are stored in the same DICOM folder in the raw data?

@marcelzwiers
Copy link
Collaborator

Yes, your issue probably resides in bidscoin not properly understanding the structure of the input data. Can you show me how exactly your input data is organized (i.e. the tree of your root input folder)? And also what was the exact bidsmapper command that you used (in particular the sub/ses prefix options, if you used those)?

@helena-balabin
Copy link
Author

My input (/raw) folder looks like this:
image

I did not use any specific sub/ses prefix options, I created an empty /bids output folder and ran the following:
bidsmapper raw bids
bidscoiner raw bids

@marcelzwiers
Copy link
Collaborator

I've never seen this structure used before, and it's fairly complicated with your multiple DICOMDIR files in there. It will probably help if you would take out your DICOM folders, and put the dcm files directly under func and anat. But even then, I can see that bidscoin may have trouble with the fact that you have multiple DICOMDIR files...

@marcelzwiers
Copy link
Collaborator

Perhaps try the above without the DICOMDIR files?

@marcelzwiers
Copy link
Collaborator

If I may ask, how did you get your data to be organized like that?

@helena-balabin
Copy link
Author

I have tried removing the DICOMDIR files and putting the files directly under func/anat:

Image

But I still run into the same issue:

Image

This data structure is the one I got when exporting my MRI data from a Philips Achieva dstream 3T using the "enhanced DICOM" export option. I only added the subject, session, anat/func folder structure and exported the sequences to their respective subfolders. During my next scan, I will see what other options I might have to maybe end up with a less messy export format 😄

In the meantime, I will see if I can figure something out to get the run numbers right. Thanks a lot for all the help!

@marcelzwiers
Copy link
Collaborator

Did you get the data in ses-01 from a single export command or did you export the anat and func data separately? I'm asking because I assumed when exporting the data you always get a single DICOMDIR file...

@marcelzwiers
Copy link
Collaborator

marcelzwiers commented Jan 16, 2025

You may have a look at the input structures that bidscoin understands and give dicomsort a try.

@helena-balabin
Copy link
Author

I exported the anat and func data separately, maybe that's part of the issue. I'll try to group them, and/or see how I can use dicomsort to improve the structure.

@marcelzwiers
Copy link
Collaborator

Yes, that is confusing bidscoin. Perhaps you can try removing your DICOMDIR files and then run dicomsort...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants