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

integrating generate renders to pipeline #32

Merged
merged 7 commits into from
May 2, 2023

Conversation

Arshitha
Copy link
Collaborator

@Arshitha Arshitha commented May 1, 2023

This PR includes the following changes:

  • visualqc t1_mri prep code removed
  • integrated generate renders function into the defacing scripts
  • some light code refactoring to consistently use pathlib library

I've tested the code on two sample datasets from start to end, and its working as expected.

Things to do before it can be merged:

  • README edits

and some code refactoring to reduce number of output files
@Arshitha Arshitha requested review from ericearl and dmoracze May 1, 2023 22:19
@Arshitha
Copy link
Collaborator Author

Arshitha commented May 1, 2023

README has now been updated.

@Arshitha Arshitha closed this May 1, 2023
@Arshitha Arshitha reopened this May 1, 2023
@Arshitha Arshitha self-assigned this May 1, 2023
@Arshitha Arshitha added the enhancement New feature or request label May 1, 2023
for p in args.participant_label:
to_deface.extend(glob(os.path.join(args.bids_dir, f'sub-{p}', "ses-*")))
to_deface.extend(list(args.bids_dir.joinpath(f'sub-{p}').glob("ses-*")))
Copy link
Member

Choose a reason for hiding this comment

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

glob 1. These comments are just making sure this was intentional.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this was intentional just to stay consistent with usage of pathlib library coz all the other scripts use pathlib.Path objects. And I think it's a bit more readable too.

if not to_deface:
to_deface = glob(os.path.join(args.bids_dir, f'sub-{p}'))
to_deface = list(args.bids_dir.glob(f'sub-{p}'))
Copy link
Member

Choose a reason for hiding this comment

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

glob 2. These comments are just making sure this was intentional.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, and same reasoning as above.

for s in args.session_id:
to_deface = glob(os.path.join(args.bids_dir, "sub-*", f'ses-{s}'))
to_deface = list(args.bids_dir.rglob(f'ses-{s}'))
Copy link
Member

Choose a reason for hiding this comment

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

rglob 1. These comments are just making sure this was intentional.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, and same reasoning as above.

if args.participant_label == None and args.session_id == None:
session_check = glob(os.path.join(args.bids_dir, "sub-*", "ses-*"))
if args.participant_label is None and args.session_id is None:
session_check = list(args.bids_dir.rglob("ses-*"))
Copy link
Member

Choose a reason for hiding this comment

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

rglob 2. These comments are just making sure this was intentional.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, and same reasoning as above. Also, I tested each of these changes specifically to make sure it doesn't affect the functionality.

README.md Show resolved Hide resolved
README fixes.
ericearl
ericearl previously approved these changes May 2, 2023
Copy link
Member

@ericearl ericearl left a comment

Choose a reason for hiding this comment

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

I approve (and I'm testing right now and it looks like it won't have any problems)!

@ericearl
Copy link
Member

ericearl commented May 2, 2023

I spoke too soon! I got a lot of:

Has the render been created? False

I was testing over an SSH connection on curium from my VPN'ed PC. I don't know whether or not that should have worked... I will try direct on curium one more time and then I'm done. But this begs the question, "how can a user ONLY generate renders if they fail the first time and save all that defacing again?" we may want to file an issue to add --only-generate-renders to skip the defacing over again.

@ericearl ericearl dismissed their stale review May 2, 2023 04:11

I was wrong, it did not work on my second test either in the generate renders portion.

@Arshitha
Copy link
Collaborator Author

Arshitha commented May 2, 2023

@ericearl I'll try this out on curium too but just to confirm, did you have fsleyes on your env?

@ericearl
Copy link
Member

ericearl commented May 2, 2023

Oy. I did forget to activate conda again. Testing over right now...

@ericearl
Copy link
Member

ericearl commented May 2, 2023

It was the conda environment, got me again.

README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
Copy link
Member

@ericearl ericearl left a comment

Choose a reason for hiding this comment

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

Please review my two new README suggestions. Otherwise, I approve this PR.

@Arshitha
Copy link
Collaborator Author

Arshitha commented May 2, 2023

@ericearl Great, thank you! I'll merge this to main and do some more testing with the main branch.

@Arshitha Arshitha merged commit 18a3238 into main May 2, 2023
@Arshitha Arshitha deleted the feature/integrate-generate-renders branch December 14, 2023 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants