Skip to content
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

Add RLE Lossless datasets #5

Merged
merged 2 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added data/ds/RLELossless/MR_small_RLE.dcm
Binary file not shown.
Binary file added data/ds/RLELossless/OBXXXX1A_rle.dcm
Binary file not shown.
Binary file added data/ds/RLELossless/OBXXXX1A_rle_2frame.dcm
Binary file not shown.
Binary file added data/ds/RLELossless/SC_rgb_rle.dcm
Binary file not shown.
Binary file added data/ds/RLELossless/SC_rgb_rle_16bit.dcm
Binary file not shown.
Binary file added data/ds/RLELossless/SC_rgb_rle_16bit_2frame.dcm
Binary file not shown.
Binary file added data/ds/RLELossless/SC_rgb_rle_2frame.dcm
Binary file not shown.
Binary file added data/ds/RLELossless/SC_rgb_rle_32bit.dcm
Binary file not shown.
Binary file added data/ds/RLELossless/SC_rgb_rle_32bit_2frame.dcm
Binary file not shown.
160 changes: 160 additions & 0 deletions data/ds/RLELossless/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
"""1.2.840.10008.1.2.5 - RLE Lossless"""

INDEX = {
'emri_small_RLE.dcm' : {
'TransferSyntaxUID' : ('UI', '1.2.840.10008.1.2.5'),
'SamplesPerPixel' : ('US', 1),
'PhotometricInterpretation' : ('CS', 'MONOCHROME2'),
'PlanarConfiguration' : ('US', 0),
'NumberOfFrames' : ('IS', '10'),
'Rows' : ('US', 64),
'Columns' : ('US', 64),
'BitsAllocated' : ('US', 16),
'BitsStored' : ('US', 12),
'HighBit' : ('US', 11),
'PixelRepresentation' : ('US', 0),
},
'MR_small_RLE.dcm' : {
'TransferSyntaxUID' : ('UI', '1.2.840.10008.1.2.5'),
'SamplesPerPixel' : ('US', 1),
'PhotometricInterpretation' : ('CS', 'MONOCHROME2'),
'PlanarConfiguration' : ('US', 0),
'NumberOfFrames' : ('IS', '1'),
'Rows' : ('US', 64),
'Columns' : ('US', 64),
'BitsAllocated' : ('US', 16),
'BitsStored' : ('US', 16),
'HighBit' : ('US', 15),
'PixelRepresentation' : ('US', 1),
},
'OBXXXX1A_rle.dcm' : {
'TransferSyntaxUID' : ('UI', '1.2.840.10008.1.2.5'),
'SamplesPerPixel' : ('US', 1),
'PhotometricInterpretation' : ('CS', 'PALETTE COLOR'),
'PlanarConfiguration' : ('US', 0),
'NumberOfFrames' : ('IS', '1'),
'Rows' : ('US', 600),
'Columns' : ('US', 800),
'BitsAllocated' : ('US', 8),
'BitsStored' : ('US', 8),
'HighBit' : ('US', 7),
'PixelRepresentation' : ('US', 0),
},
'OBXXXX1A_rle_2frame.dcm' : {
'TransferSyntaxUID' : ('UI', '1.2.840.10008.1.2.5'),
'SamplesPerPixel' : ('US', 1),
'PhotometricInterpretation' : ('CS', 'PALETTE COLOR'),
'PlanarConfiguration' : ('US', 0),
'NumberOfFrames' : ('IS', '2'),
'Rows' : ('US', 600),
'Columns' : ('US', 800),
'BitsAllocated' : ('US', 8),
'BitsStored' : ('US', 8),
'HighBit' : ('US', 7),
'PixelRepresentation' : ('US', 0),
},
'rtdose_rle.dcm' : {
'TransferSyntaxUID' : ('UI', '1.2.840.10008.1.2.5'),
'SamplesPerPixel' : ('US', 1),
'PhotometricInterpretation' : ('CS', 'MONOCHROME2'),
'PlanarConfiguration' : ('US', 0),
'NumberOfFrames' : ('IS', '15'),
'Rows' : ('US', 10),
'Columns' : ('US', 10),
'BitsAllocated' : ('US', 32),
'BitsStored' : ('US', 32),
'HighBit' : ('US', 31),
'PixelRepresentation' : ('US', 0),
},
'rtdose_rle_1frame.dcm' : {
'TransferSyntaxUID' : ('UI', '1.2.840.10008.1.2.5'),
'SamplesPerPixel' : ('US', 1),
'PhotometricInterpretation' : ('CS', 'MONOCHROME2'),
'PlanarConfiguration' : ('US', 0),
'NumberOfFrames' : ('IS', '1'),
'Rows' : ('US', 10),
'Columns' : ('US', 10),
'BitsAllocated' : ('US', 32),
'BitsStored' : ('US', 32),
'HighBit' : ('US', 31),
'PixelRepresentation' : ('US', 0),
},
'SC_rgb_rle.dcm' : {
'TransferSyntaxUID' : ('UI', '1.2.840.10008.1.2.5'),
'SamplesPerPixel' : ('US', 3),
'PhotometricInterpretation' : ('CS', 'RGB'),
'PlanarConfiguration' : ('US', 0),
'NumberOfFrames' : ('IS', '1'),
'Rows' : ('US', 100),
'Columns' : ('US', 100),
'BitsAllocated' : ('US', 8),
'BitsStored' : ('US', 8),
'HighBit' : ('US', 7),
'PixelRepresentation' : ('US', 0),
},
'SC_rgb_rle_2frame.dcm' : {
'TransferSyntaxUID' : ('UI', '1.2.840.10008.1.2.5'),
'SamplesPerPixel' : ('US', 3),
'PhotometricInterpretation' : ('CS', 'RGB'),
'PlanarConfiguration' : ('US', 0),
'NumberOfFrames' : ('IS', '2'),
'Rows' : ('US', 100),
'Columns' : ('US', 100),
'BitsAllocated' : ('US', 8),
'BitsStored' : ('US', 8),
'HighBit' : ('US', 7),
'PixelRepresentation' : ('US', 0),
},
'SC_rgb_rle_16bit.dcm' : {
'TransferSyntaxUID' : ('UI', '1.2.840.10008.1.2.5'),
'SamplesPerPixel' : ('US', 3),
'PhotometricInterpretation' : ('CS', 'RGB'),
'PlanarConfiguration' : ('US', 0),
'NumberOfFrames' : ('IS', '1'),
'Rows' : ('US', 100),
'Columns' : ('US', 100),
'BitsAllocated' : ('US', 16),
'BitsStored' : ('US', 16),
'HighBit' : ('US', 15),
'PixelRepresentation' : ('US', 0),
},
'SC_rgb_rle_16bit_2frame.dcm' : {
'TransferSyntaxUID' : ('UI', '1.2.840.10008.1.2.5'),
'SamplesPerPixel' : ('US', 3),
'PhotometricInterpretation' : ('CS', 'RGB'),
'PlanarConfiguration' : ('US', 0),
'NumberOfFrames' : ('IS', '2'),
'Rows' : ('US', 100),
'Columns' : ('US', 100),
'BitsAllocated' : ('US', 16),
'BitsStored' : ('US', 16),
'HighBit' : ('US', 15),
'PixelRepresentation' : ('US', 0),
},
'SC_rgb_rle_32bit.dcm' : {
'TransferSyntaxUID' : ('UI', '1.2.840.10008.1.2.5'),
'SamplesPerPixel' : ('US', 3),
'PhotometricInterpretation' : ('CS', 'RGB'),
'PlanarConfiguration' : ('US', 0),
'NumberOfFrames' : ('IS', '1'),
'Rows' : ('US', 100),
'Columns' : ('US', 100),
'BitsAllocated' : ('US', 32),
'BitsStored' : ('US', 32),
'HighBit' : ('US', 31),
'PixelRepresentation' : ('US', 0),
},
'SC_rgb_rle_32bit_2frame.dcm' : {
'TransferSyntaxUID' : ('UI', '1.2.840.10008.1.2.5'),
'SamplesPerPixel' : ('US', 3),
'PhotometricInterpretation' : ('CS', 'RGB'),
'PlanarConfiguration' : ('US', 0),
'NumberOfFrames' : ('IS', '2'),
'Rows' : ('US', 100),
'Columns' : ('US', 100),
'BitsAllocated' : ('US', 32),
'BitsStored' : ('US', 32),
'HighBit' : ('US', 31),
'PixelRepresentation' : ('US', 0),
},
}
Binary file added data/ds/RLELossless/emri_small_RLE.dcm
Binary file not shown.
Binary file added data/ds/RLELossless/rtdose_rle.dcm
Binary file not shown.
Binary file added data/ds/RLELossless/rtdose_rle_1frame.dcm
Binary file not shown.
1 change: 1 addition & 0 deletions data/ds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
from .JPEGLS import INDEX as JPEGLS_IDX
from .JPEGLSLossless import INDEX as JPEGLSLossless_IDX
from .LittleEndianExplicit import INDEX as LittleEndianExplicit_IDX
from .RLELossless import INDEX as RLELossless_IDX
6 changes: 5 additions & 1 deletion data/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from data.ds import (
JPEG2000_IDX, JPEG2000Lossless_IDX, JPEGBaseline_IDX,
JPEGExtended_IDX, JPEGLossless_IDX, JPEGLosslessSV1_IDX,
JPEGLS_IDX, JPEGLSLossless_IDX, LittleEndianExplicit_IDX
JPEGLS_IDX, JPEGLSLossless_IDX, LittleEndianExplicit_IDX,
RLELossless_IDX
)

DATA_DIR = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -30,6 +31,7 @@ def get_datasets(uid=None, as_dataset=False):
'1.2.840.10008.1.2.4.81' : 'JPEGLS',
'1.2.840.10008.1.2.4.90' : 'JPEG2000Lossless',
'1.2.840.10008.1.2.4.91' : 'JPEG2000',
'1.2.840.10008.1.2.5' : 'RLELossless',
}
subdir = uids[uid]
fnames = get_indices('ds')[subdir].keys()
Expand All @@ -51,6 +53,7 @@ def get_indexed_datasets(uid):
'1.2.840.10008.1.2.4.81' : 'JPEGLS',
'1.2.840.10008.1.2.4.90' : 'JPEG2000Lossless',
'1.2.840.10008.1.2.4.91' : 'JPEG2000',
'1.2.840.10008.1.2.5' : 'RLELossless',
}
subdir = uids[uid]
index = get_indices('ds')[subdir]
Expand Down Expand Up @@ -90,4 +93,5 @@ def get_indices(index_type='ds'):
'JPEGLS' : JPEGLS_IDX,
'JPEG2000Lossless' : JPEG2000Lossless_IDX,
'JPEG2000' : JPEG2000_IDX,
'RLELossless' : RLELossless_IDX,
}