- Notifications
You must be signed in to change notification settings - Fork269
WIP: adding Philips XML/REC support#683
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
64ed1881ff1826df2751e8c405c1a4636b2570a7edbbeb710a7a9edced43e975fa681010bf7cc8d62119d7bf693fd88ccd70486404068548File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!python | ||
| """XML/REC to NIfTI converter | ||
| """ | ||
| # parrec2nii reads XML/REC as well | ||
| from nibabel.cmdline.parrec2nii import main | ||
| if __name__ == '__main__': | ||
| main() |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -19,6 +19,7 @@ | ||||||||||
| from .arrayproxy import is_proxy | ||||||||||
| from .py3k import FileNotFoundError | ||||||||||
| from .deprecated import deprecate_with_version | ||||||||||
| from .parrec import PARRECImage | ||||||||||
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. Can you import this inside Lines 109 to 112 ind5494f3
| ||||||||||
| def load(filename, **kwargs): | ||||||||||
| @@ -46,6 +47,15 @@ def load(filename, **kwargs): | ||||||||||
| for image_klass in all_image_classes: | ||||||||||
| is_valid, sniff = image_klass.path_maybe_image(filename, sniff) | ||||||||||
| if is_valid: | ||||||||||
| if image_klass is PARRECImage and '.REC' in filename: | ||||||||||
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. Suggested change
| ||||||||||
| # a .REC file can have either a .PAR of .xml header. | ||||||||||
| # This skip case assumes PARRECImage is beforeXMLRECImage in | ||||||||||
| # all_image_classes. | ||||||||||
| par_exists = os.path.exists(filename.replace('.REC', '.PAR')) | ||||||||||
| xml_exists = os.path.exists(filename.replace('.REC', '.xml')) | ||||||||||
| if not par_exists and xml_exists: | ||||||||||
| continue # skip trying .PAR and proceed to .xml | ||||||||||
| print(image_klass) | ||||||||||
| img = image_klass.from_filename(filename, **kwargs) | ||||||||||
| return img | ||||||||||
Uh oh!
There was an error while loading.Please reload this page.