Skip to content

Minor bug fixes#37

Open
ljchang wants to merge 9 commits into
bids-standard:masterfrom
ljchang:master
Open

Minor bug fixes#37
ljchang wants to merge 9 commits into
bids-standard:masterfrom
ljchang:master

Conversation

@ljchang

@ljchang ljchang commented Feb 25, 2022

Copy link
Copy Markdown

Not sure if this project is still being maintained, but I wanted to share a few small changes I made so that I was able to successfully upload my bids formatted data to the NDA. It looks like a few other people have experienced similar problems, so hopefully somebody will find this useful.

Comment thread bids2nda/main.py
and therefore as the row index changes.

Notes:
Modified Yarik's original solution from https://stackoverflow.com/a/45469577 to use the argmax for increaesd flexibility.

@yarikoptic yarikoptic Jul 12, 2023

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~~hm -- was it mine? says user6867490 there. ~~
note the typo

Suggested change
Modified Yarik's original solution from https://stackoverflow.com/a/45469577 to use the argmax for increaesd flexibility.
Modified Yarik's original solution from https://stackoverflow.com/a/45469577 to use the argmax for increased flexibility.

I will bolt on codespell now

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually -- I don't really see a reason for this note here at all. But I feel it is time to add tests for this function to ensure that it operates as expected... ATM can't quite grasp the ramification of the change, in particular for those cases where before a RuntimeError would have been raised.

Comment thread bids2nda/main.py
parser.add_argument(
"experiment_id",
help="Experiment ID assigned by NDA for collection. Requred for fMRI studies",
metavar='EXPERIMENT_ID')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, I wonder how we managed to upload before without this?

so we were taking experiment id from metadata and it worked on our few uploads I participated in.

Do you know if it may be recent or could be optional?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind -- it is in the notes of README.md , so good to have it here in the code now but we would need to remove that note from README.md here. care to do that @ljchang ?

@yarikoptic

Copy link
Copy Markdown
Collaborator

@ljchang since then, did you have fun/pleasure of uploading anything to NDA? With @yuqi98 we are looking into uploading one and I am trying to grasp "where are we standing" ;)

@ljchang

ljchang commented Mar 14, 2025 via email

Copy link
Copy Markdown
Author

@yuqi98

yuqi98 commented Apr 8, 2025

Copy link
Copy Markdown

Yes, I believed we used this in the past 1-2 years and our fork was still working. It would be great to get this working more reliably for everyone!

Hi Luke @ljchang , I've tried to use this fork https://github.com/brown-bnc/bids2nda, and it is showing me these two error messages when I do the img3 validation

photomet_interpret  Field photomet_interpret is conditionally required when image_file_format != 'DICOM' && image_modality == 'MRI'
experiment_id       Field experiment_id is conditionally required when scan_type == 'fMRI'

I wonder if that's the right fork I should use or is there any new updates? I think the nda tool has updated to 0.4.0 instead of previous 0.3.0, not sure if that's making any difference.

@yarikoptic

yarikoptic commented Apr 9, 2025

Copy link
Copy Markdown
Collaborator

re experiment_id see

  -e EXPID_MAPPING, --expid_mapping EXPID_MAPPING
                        Path to a text file with experiment name to NDA experiment ID mapping.

on
https://github.com/brown-bnc/bids2nda?tab=readme-ov-file#usage . So should register experiment I guess on NDA first also. (edit: seems to be described here)

Re photomet_interpret , https://docs.ccv.brown.edu/bnc-user-manual/bids/bids-to-nimh-data-archive-nda says

We are working on a fix, but for now the photomet_interpret field of the image03.csv file will need to be filled in manually if you are converting any "enhanced" DICOM files (i.e. data collected post- scanner upgrade to XA30). The correct value is likely MONOCHROME2, but double-check your DICOM header for the (0028,0004) | Photometric Interpretation field to make sure this is true for your data.

so -- fill in manually or fix up in the code ro just add it as such and be done

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

Successfully merging this pull request may close these issues.

3 participants