-
Notifications
You must be signed in to change notification settings - Fork 15
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
Remove sdcflows and model ASLPrep on fMRIPrep/next #338
Conversation
I'm getting the following error now that it's installing a version of niworkflows from GitHub:
My solution: Use the most recent releases from each of the dependencies and remove anything that requires the pinned GitHub versions (e.g., the MSMSulc elements). |
Next problem:
So far my debugging process is to mount my local clone of Nipype within aslprep/aslprep/workflows/asl/qc.py Line 182 in 3a34405
Basically, I had accidentally removed the connection of |
The current problem is that fMRIPrep's
|
fMRIPrep's |
The carpetplots from fMRIPrep look bad for ASL data because
|
Here's a trick ChatGPT gave me to patch in ASLPrep's DerivativesDataSink into an fMRIPrep workflow with a context manager. I'm not using it for class OverrideDerivativesDataSink:
"""A context manager for temporarily overriding the definition of SomeClass.
Parameters
----------
None
Attributes
----------
original_class (type): The original class that is replaced during the override.
Methods
-------
__init__()
Initialize the context manager.
__enter__()
Enters the context manager and performs the class override.
__exit__(exc_type, exc_value, traceback)
Exits the context manager and restores the original class definition.
"""
def __init__(self, module):
"""Initialize the context manager with the target module.
Parameters
-----------
module
The module where SomeClass should be overridden.
"""
self.module = module
def __enter__(self):
"""Enter the context manager and perform the class override.
Returns
-------
OverrideConfoundsDerivativesDataSink
The instance of the context manager.
"""
# Save the original class
self.original_class = self.module.DerivativesDataSink
# Replace SomeClass with YourOwnClass
self.module.DerivativesDataSink = DerivativesDataSink
return self
def __exit__(self, exc_type, exc_value, traceback): # noqa: U100
"""Exit the context manager and restore the original class definition.
Parameters
----------
exc_type : type
The type of the exception (if an exception occurred).
exc_value : Exception
The exception instance (if an exception occurred).
traceback : traceback
The traceback information (if an exception occurred).
Returns
-------
None
"""
# Restore the original class
self.module.DerivativesDataSink = self.original_class Usage: with OverrideDerivativesDataSink(package.module):
# do some stuff |
It looks like fMRIPrep is currently undergoing a massive refactor, and that's going to have upstream impacts on SDCFlows, (probably) niworkflows, and sMRIPrep. Basically everything I'm doing is based on the version prior to this refactor, which unfortunately doesn't have any releases related to it. SDCFlows has a bunch of backwards-incompatible changes, and I also need to make a bunch of changes to support ASL data because SDCFlows relies on hardcoded suffixes and datatypes. |
I think I might be stuck.
UPDATE:
|
The Philips M0 scan has values of zero for some in-mask voxels, which, when used to calculate CBF, results in Infs.
It looks like the only thing I need to get working is the resampling workflow! EDIT: Also, there aren't workflow plots for the workflows in |
😭 I got an error with the CIFTI resampling:
I think I need the working directory to figure out what's going wrong, but that's not really feasible with local testing or using CircleCI, so I'm leaning toward merging this once I have CI passing, building the Singularity image on CUBIC, and testing there. |
Closes #219, closes #297, closes #346, closes #340, closes #341, and closes #199.
Changes proposed in this pull request
--bids-database-dir
,--level
(which is mostly untested),--medial-surface-nan
,--project-goodvoxels
,--cifti-output
,--no-msm
,--no-submm-recon
,--fs-subjects-dir
,--fs-no-reconall
,--config-file
.Breaking changes
aslprep
will no longer be appended automatically.--anat-derivatives
is replaced with--derivatives
, which takes one or more paths to anatomical or ASLPrep derivatives.--dummy-vols
is now--dummy-scans
to match fMRIPrep.desc-hmc
anddesc-coreg
versions.basil
CBF parcellations.desc-pvGM_cbf
renamed todesc-basilGM_cbf
desc-pvWM_cbf
renamed todesc-basilWM_cbf
desc-confounds_regressors.tsv
renamed todesc-confounds_timeseries.tsv
from-T1w_to-scanner_mode-image_xfm.txt
removed. The inverse is invertible, so it's fine.from-scanner_to-T1w_mode-image_xfm.txt
split intofrom-orig_to-aslref_mode-image_xfm.txt
andfrom-aslref_to-T1w_mode-image_xfm.txt