-
Notifications
You must be signed in to change notification settings - Fork 85
Issue 122 Philips Multiframe dti with ADC #159
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
Open
ma-tripleT
wants to merge
17
commits into
icometrix:main
Choose a base branch
from
ma-tripleT:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+37
−5
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
613a238
#122 return nifti from _create_bvals_bvecs()
ma-tripleT 7e1165d
rename nifti variable to nii_image
ma-tripleT 6aa4a47
Merge branch 'icometrix:main' into issue122_philips_multiframe_dti_wi…
ma-tripleT dce624e
add new ADC teste file to test_data
ma-tripleT 490522f
modify tests
ma-tripleT 94f9508
add script to create smaller ADC dicom
ma-tripleT b453948
change folder of original data
ma-tripleT 9c867a1
remove whitespace
ma-tripleT ef56d0e
correct retrieval of dimensions from header in test
ma-tripleT a7457ec
correct indentation
ma-tripleT 3acae47
update test data
ma-tripleT 473401f
remove create_adc.py which was used to make a small test data file fr…
ma-tripleT 8293eba
indentation in test_data
ma-tripleT dc182b7
multiline varables in _create_bvals_bvecs() call for human readability
ma-tripleT 7f0fce6
type in comment of _fix_diffusion_images()
ma-tripleT a261ef6
newline at end of test_tools.py
ma-tripleT 805dd01
Merge pull request #1 from ma-tripleT/issue122_philips_multiframe_dti…
ma-tripleT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -259,8 +259,9 @@ def _multiframe_to_nifti(dicom_input, output_file): | |
| logger.info('Creating bval en bvec files') | ||
| bval_file = '%s/%s.bval' % (base_path, base_name) | ||
| bvec_file = '%s/%s.bvec' % (base_path, base_name) | ||
| bval, bvec, bval_file, bvec_file = _create_bvals_bvecs(multiframe_dicom, bval_file, bvec_file, nii_image, | ||
| output_file) | ||
| nii_image, bval, bvec, bval_file, bvec_file = _create_bvals_bvecs( | ||
| multiframe_dicom, bval_file, bvec_file, nii_image, output_file | ||
| ) | ||
|
|
||
| return {'NII_FILE': output_file, | ||
| 'BVAL_FILE': bval_file, | ||
|
|
@@ -433,15 +434,15 @@ def _create_bvals_bvecs(multiframe_dicom, bval_file, bvec_file, nifti, nifti_fil | |
| bvals = None | ||
| bvecs = None | ||
|
|
||
| return bvals, bvecs, bval_file, bvec_file | ||
| return nifti, bvals, bvecs, bval_file, bvec_file | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The key change - to return the modified |
||
|
|
||
|
|
||
| def _fix_diffusion_images(bvals, bvecs, nifti, nifti_file): | ||
| """ | ||
| This function will remove the last timepoint from the nifti, bvals and bvecs if the last vector is 0,0,0 | ||
| This is sometimes added at the end by philips | ||
| """ | ||
| # if all zero continue of if the last bvec is not all zero continue | ||
| # if all zero continue or if the last bvec is not all zero continue | ||
| if numpy.count_nonzero(bvecs) == 0 or not numpy.count_nonzero(bvals[-1]) == 0: | ||
| # nothing needs to be done here | ||
| return nifti, bvals, bvecs | ||
|
|
||
Binary file not shown.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 0 1000 1000 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| 0.0 -0.9939979910850525 -0.0821085199713707 | ||
| 0.0 0.08382682502269745 -0.9962577819824219 | ||
| 0.0 -0.07029245793819427 -0.02699320949614048 |
Binary file not shown.
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including the
nii_imagein the tuple of variables to.