Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This update standardizes the output format across all imaging modalities in osipy. Before, every perfusion pipeline like DCE, DSC, ASL, and IVIM gave out data in their own unique ways, which made it tough for researchers to write flexible scripts that could handle different data types without having to write special code for each one.Now, all pipelines universally return a standardized AnalysisResult. This ensures that things like$K^{trans}$ , $CBF$ , or $D$ , along with quality masks and consistent audit trails, are always available in the same way.
Usage Example
This makes it easier to move and show data for studies that use different types of info.Before: Researchers had to jot down different code for each way they were looking at things.
'''
result = pipeline.run(data, ...)
if modality == "dce":
ktrans = result.ktrans_map
elif modality == "ivim":
d = result.fit_result.D
elif modality == "dsc":
cbf = result.cbf_map
'''
After (This PR): The new run_analysis function returns a uniform output, so plotting or saving your data requires only one concise loop regardless of the MRI contrast used:
'''
result = run_analysis(data, modality=modality, ...)
for parameter_name, parameter_map in result.parameter_maps.items():
save_nifti(parameter_map.values, f"{parameter_name}.nii.gz")
''''
Key Improvements
1.Uniform Parameter Mapping: All calculated parameter maps are now bundled together in a standardized dictionary using OSIPI CAPLEX nomenclature, preventing the need to hunt for specific object attributes.
2.Guaranteed Quality Masks: Now, every time you run an analysis, you'll get a clear yes-or-no answer on whether the voxels were fitted properly or not.
3.Built-in Reproducibility (Audit Trails): Every result now automatically logs its details (provenance), capturing the exact osipy version, timestamp, modality, and configuration parameters used. This means we can check and repeat the same outcomes later on.
Backward Compatibility
If you've been using those old-school script classes straight from the inside (like DCEPipeline.run()), your code's gonna keep doing its thing just like it always has, no need to change anything.
Validation
This unified framework has successfully cleared 792 automated tests against standard digital reference objects to ensure accuracy in Python 3.12 and newer environments.