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 ASL fields to config #282

Merged
merged 19 commits into from
Jan 30, 2024
Merged

Add ASL fields to config #282

merged 19 commits into from
Jan 30, 2024

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Jan 17, 2024

Closes none.

Changes proposed:

  • Add support for aslcontext, asllabeling, and m0scan files.
  • Add/enhance docstrings throughout the package.
  • Add release notes from last release.
  • Improve CLI parameter types.

Comment on lines +66 to +67
subprocess.run(["mkdir", str(bids_dir / "code")])
subprocess.run(["mkdir", str(bids_dir / "code" / "CuBIDS")])
Copy link
Member Author

Choose a reason for hiding this comment

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

@mattcieslak do you know why CuBIDS uses subprocess.run here instead of os.makedirs? Does Datalad not play well with os.makedirs?

Copy link
Contributor

Choose a reason for hiding this comment

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

this is odd, I don't remember why it's done this way

@tsalo
Copy link
Member Author

tsalo commented Jan 24, 2024

I'm pretty happy with the current state, but I'm not sure how best to test my changes. I guess running on the PNC and NKI datasets would be a good test?

@mattcieslak
Copy link
Contributor

That sounds good to me. The CI tests are fairly limited

Comment on lines +476 to 479
# Entities that may be in the filename?
file_keys = ["task", "acquisition", "direction", "reconstruction", "run"]

for key in file_keys:
Copy link
Member Author

Choose a reason for hiding this comment

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

@mattcieslak do you know what these entities are hardcoded here for? Are they the only entities that are used to group files? For example, if two files are the same but have different contrast agent (ce) entities, would CuBIDS treat them as part of the same key group?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we had ever seen ce entities at this point. These were from what we'd seen while curating RBC and should definitely be expanded to better match current bids

Copy link
Member Author

Choose a reason for hiding this comment

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

Gotcha. Does that mean I was interpreting the code correctly then? I.e., that those are the entities that are used to group files?

@tsalo tsalo added the enhancement New feature or request label Jan 26, 2024
@tsalo tsalo requested a review from mattcieslak January 29, 2024 16:10
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to keep supporting 3.5? Other than pybids the only important dependency is sklearn and I'm not sure how far back they go

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd like to push forward to 3.9+ at this point, but I'd rather tackle that in a future PR.

cubids/cli.py Show resolved Hide resolved
NON_KEY_ENTITIES = set(["subject", "session", "extension"])
# Multi-dimensional keys SliceTiming
# Multi-dimensional keys SliceTiming XXX: what is this line about?
Copy link
Contributor

Choose a reason for hiding this comment

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

This was going to be a list of fields that are array or list type. They would need special consideration when deciding whether they're a variant or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, so it's a relic from an old attempt at #281?

cubids/data/config.yml Show resolved Hide resolved
cubids/utils.py Show resolved Hide resolved
Comment on lines +476 to 479
# Entities that may be in the filename?
file_keys = ["task", "acquisition", "direction", "reconstruction", "run"]

for key in file_keys:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we had ever seen ce entities at this point. These were from what we'd seen while curating RBC and should definitely be expanded to better match current bids

cubids/cubids.py Show resolved Hide resolved
cubids/cubids.py Outdated Show resolved Hide resolved
cubids/cubids.py Outdated Show resolved Hide resolved
@@ -1510,6 +1687,12 @@ def _order_columns(df):

This ensures that KeyGroup and ParamGroup are the first two columns,
FilePath is the last, and the others are sorted alphabetically.

Notes
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm open to alternative strategies for how to define these values

Copy link
Member Author

Choose a reason for hiding this comment

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

Since they're only used here, we could just define them in a constant in this function. WDYT?

@tsalo tsalo merged commit 96a484b into PennLINC:main Jan 30, 2024
5 checks passed
@tsalo tsalo deleted the asl branch January 30, 2024 15:02
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