-
Notifications
You must be signed in to change notification settings - Fork 29
Allow read-only h5 access, define IMTYPE_RGB, explicit error on too-large Waveforms #87
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
base: master
Are you sure you want to change the base?
Changes from all commits
8bf00db
5d944c2
bdc0c8e
eeaa2a4
bf8a7c9
5fca37c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -144,12 +144,15 @@ def fileinfo(fname): | |
|
|
||
|
|
||
| class Dataset(object): | ||
| def __init__(self, filename, dataset_name="dataset", create_if_needed=True): | ||
| def __init__(self, filename, dataset_name="dataset", create_if_needed=True, mode=None): | ||
|
Contributor
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. We should document the valid arguments for mode: https://docs.h5py.org/en/stable/high/file.html#opening-creating-files |
||
| # Open the file | ||
| if create_if_needed: | ||
| self._file = h5py.File(filename, 'a') | ||
| else: | ||
| self._file = h5py.File(filename, 'r+') | ||
| if mode is None: | ||
| if create_if_needed: | ||
| mode = 'a' | ||
| else: | ||
| mode = 'r+' | ||
|
|
||
| self._file = h5py.File(filename, mode) | ||
|
|
||
| self._dataset_name = dataset_name | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,9 @@ def from_array(data, **kwargs): | |
|
|
||
| channels, nsamples = data.shape | ||
|
|
||
| if nsamples > np.iinfo(np.uint16).max: | ||
| raise TypeError(f"Array has {nsamples} samples, which is greater than the maximum of {np.iinfo(np.uint16).max}") | ||
|
Contributor
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. This is a |
||
|
|
||
| array_data = { | ||
| 'version': 1, | ||
| 'channels': channels, | ||
|
|
||
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.
I don't see where this is defined in the C++ implementation?
What does RGB mean for each of the possible ISMRMRD image types? i.e. How is RGB decoded from a 32-bit complex float? How many bits for each RGB channel if the image is 32-bit vs 16-bit?
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.
I see this in the docs now (https://ismrmrd.readthedocs.io/en/latest/mrd_image_data.html#image-types).
But I still don't understand. How long has this been documented without actually being implemented in ISMRMRD or ismrmrd-python?