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

Add correctFieldMapCase4 to support pepolar fieldmaps #39

Merged
merged 21 commits into from
May 17, 2023

Conversation

switt4
Copy link
Contributor

@switt4 switt4 commented Apr 20, 2023

Add correctFieldMapCase4 and correctFieldMapJsonCase4.py to populate IntendedFor field in pepolar fieldmap json files. Assumes acquisition field is set to acq-EPI. Direction field is set to wildcard.

switt4 and others added 18 commits April 19, 2023 13:51
Create correctFieldMapJsonCase4.py for populating IntendedFor field in peploar fieldmap jsons.  Based on correctFieldMapJsonCase2.py.
Create correctFieldMapJsonCase4 for running correctFieldMapJsonCase4.py.  Based on correctFieldMapJsonCase2.
Create correctFieldMapCase4.py for populating IntendedFor field in pepolar fieldmap json files.  Based on correctFieldMapCase2.py.
Fix debug print statement syntax.  Also, hard code dir- field to dir-PA in os.path.join statement.  Need to figure out something more flexible...
Add for loop with glob to grab all acq-EPI_dir-*_epi.json files and add func files to IntendedFor section.
Fix syntax error to call glob.glob instead of glob module directly.
Add correctFieldMapCase4 to support pepolar fieldmaps
Add memp2rage_bids_corrector.py script to tar2bids run
Copy link
Contributor

@tkkuehn tkkuehn left a comment

Choose a reason for hiding this comment

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

A couple of minor style things but it looks to me like this will do what's intended.

As we discussed on Slack, correctFieldMapCase4 will never get called, but we can address that in a separate PR.

if ses: #ses not None
sub_prefix = '{}_{}'.format(sub,ses)
sub_path_prefix=os.path.join(sub,ses)
sub_root = '{}'.format(sub)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can just be sub_root = sub (or maybe sub_root = str(sub) if sub might not already be a string).

Actually, you may just want to get rid of this variable entirely because it seems to be the same as sub in all cases.

fmri_json = json.load(f,object_pairs_hook=collections.OrderedDict)

# apply to all bold images
cwd=os.getcwd()
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we're changing the working directory to get the paths relative to the participant directory? I try to avoid changing directories if possible (can cause problems e.g. if the script fails or is cancelled part way through) but if this is the easiest way to do it, that's fine.

switt4 and others added 3 commits May 16, 2023 13:25
Add call to correctFieldMapCase4 to tar2bids to create and populated IntendedFor field in fMRI pepolar fieldmaps.
Add call to correctFieldMapCase4 to tar2bids
@tkkuehn
Copy link
Contributor

tkkuehn commented May 17, 2023

The additional changes also look good and this all seems in line with what's already in tar2bids, so I'm going to go ahead and merge.

@tkkuehn tkkuehn merged commit 01d18c8 into khanlab:master May 17, 2023
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.

2 participants