public class DicomReader extends FormatReader
Modifier and Type | Field and Description |
---|---|
private static int |
AE |
private static int |
AS |
private static int |
AT |
private boolean |
bigEndianTransferSyntax |
private static int |
BITS_ALLOCATED |
private int |
bitsPerPixel
Bits per pixel.
|
private static int |
COLUMNS |
private Vector<String> |
companionFiles |
private static int |
CS |
private static int |
DA |
private String |
date |
static String |
DICOM_MAGIC_STRING |
private static String[] |
DICOM_SUFFIXES |
private static int |
DS |
private static int |
DT |
private int |
elementLength |
private static int |
FD |
private Hashtable<Integer,Vector<String>> |
fileList |
private static int |
FL |
private DicomReader |
helper |
private static int |
ICON_IMAGE_SEQUENCE |
private int |
imagesPerFile |
private String |
imageType |
private static int |
IMPLICIT_VR |
private boolean |
inSequence |
private boolean |
inverted |
private static int |
IS |
private boolean |
isDeflate |
private boolean |
isJP2K |
private boolean |
isJPEG |
private boolean |
isRLE |
private static int |
ITEM |
private static int |
ITEM_DELIMINATION |
private static int |
LO |
private int |
location |
private static int |
LT |
private byte[][] |
lut |
private int |
maxPixelValue |
private static int |
NUMBER_OF_FRAMES |
private static int |
OB |
private boolean |
oddLocations |
private long[] |
offsets |
private String |
originalDate |
private String |
originalInstance |
private int |
originalSeries |
private String |
originalTime |
private static int |
OW |
private static int |
PHOTOMETRIC_INTERPRETATION |
private static int |
PIXEL_DATA |
private static int |
PIXEL_REPRESENTATION |
private static int |
PIXEL_SIGN |
private static int |
PIXEL_SPACING |
private String |
pixelSizeX |
private String |
pixelSizeY |
private Double |
pixelSizeZ |
private static int |
PLANAR_CONFIGURATION |
private static int |
PN |
private static int |
QQ |
private static int |
RESCALE_INTERCEPT |
private static int |
RESCALE_SLOPE |
private double |
rescaleIntercept |
private double |
rescaleSlope |
private static int |
ROWS |
private static int |
SAMPLES_PER_PIXEL |
private static int |
SEQUENCE_DELIMINATION |
private static int |
SH |
private short[][] |
shortLut |
private static int |
SL |
private static int |
SLICE_SPACING |
private static int |
SQ |
private static int |
SS |
private static int |
ST |
private String |
time |
private static int |
TM |
private static int |
TRANSFER_SYNTAX_UID |
private static Hashtable<Integer,String> |
TYPES |
private static int |
UI |
private static int |
UL |
private static int |
UN |
private static int |
US |
private static int |
UT |
private int |
vr |
private static int |
WINDOW_CENTER |
private static int |
WINDOW_WIDTH |
core, coreIndex, datasetDescription, domains, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataOptions, metadataStore, normalizeData, resolution, saveOriginalMetadata, series, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSION
COMPRESSION_SUFFIXES, currentId, format, LOGGER, suffixes
CAN_GROUP, CANNOT_GROUP, MUST_GROUP
Constructor and Description |
---|
DicomReader()
Constructs a new DICOM reader.
|
Modifier and Type | Method and Description |
---|---|
private void |
addFileToList(String file,
boolean checkSeries)
Determine if the given file belongs in the same dataset as this file.
|
private void |
addInfo(int tag,
int value) |
private void |
addInfo(int tag,
String value) |
private void |
attachCompanionFiles()
DICOM datasets produced by:
http://www.ct-imaging.de/index.php/en/ct-systeme-e/mikro-ct-e.html
contain a bunch of extra metadata and log files.
|
private static Hashtable<Integer,String> |
buildTypes()
Assemble the data dictionary.
|
void |
close(boolean fileOnly)
Closes the currently open file.
|
int |
fileGroupOption(String id)
Returns an int indicating that we cannot, must, or might group the files
in a given dataset.
|
private String |
formatTag(int tag) |
short[][] |
get16BitLookupTable()
Gets the 16-bit color lookup table associated with
the most recently opened image.
|
byte[][] |
get8BitLookupTable()
Gets the 8-bit color lookup table associated with
the most recently opened image.
|
private String |
getHeaderInfo(int tag,
String value) |
private int |
getLength(RandomAccessInputStream stream,
int tag) |
private int |
getNextTag(RandomAccessInputStream stream) |
String[] |
getSeriesUsedFiles(boolean noPixels)
Returns an array of filenames needed to open the current series.
|
protected void |
initFile(String id)
Initializes the given file (parsing header information, etc.).
|
boolean |
isThisType(RandomAccessInputStream stream)
Checks if the given stream is a valid stream for this file format.
|
boolean |
isThisType(String name,
boolean open)
Checks if a file matches the type of this format reader.
|
private void |
makeFileList() |
byte[] |
openBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
Obtains a sub-image of the specified image plane
into a pre-allocated byte array.
|
private void |
scanDirectory(Location dir,
boolean checkSeries)
Scan the given directory for files that belong to this dataset.
|
addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMetaList, addMeta, addMetaList, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMetaList, close, coreIndexToSeries, flattenHashtables, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCoreIndex, getCoreMetadataList, getCorrection, getCurrentFile, getDatasetStructureDescription, getDetectorType, getDimensionOrder, getDimensionOrder, getDomains, getEffectiveSizeC, getExperimentType, getFilamentType, getFillRule, getFilterType, getFontFamily, getFontStyle, getGlobalMeta, getGlobalMetadata, getIlluminationType, getImageCount, getImmersion, getIndex, getIndex, getLaserMedium, getLaserType, getLineCap, getMarker, getMedium, getMetadataOptions, getMetadataStore, getMetadataStoreRoot, getMetadataValue, getMicrobeamManipulationType, getMicroscopeType, getModuloC, getModuloT, getModuloZ, getNamingConvention, getOptimalTileHeight, getOptimalTileWidth, getPixelType, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getRotationTransform, getSeries, getSeriesCount, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getSupportedMetadataLevels, getThumbSizeX, getThumbSizeY, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isSingleFile, isThisType, isThisType, isThumbnailSeries, isUsedFile, makeFilterMetadata, openBytes, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, reopenFile, seriesToCoreIndex, setCoreIndex, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataOptions, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries
checkSuffix, checkSuffix, getFormat, getNativeDataType, getSuffixes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFormat, getNativeDataType, getSuffixes
public static final String DICOM_MAGIC_STRING
private static final String[] DICOM_SUFFIXES
private static final int PIXEL_REPRESENTATION
private static final int PIXEL_SIGN
private static final int TRANSFER_SYNTAX_UID
private static final int SLICE_SPACING
private static final int SAMPLES_PER_PIXEL
private static final int PHOTOMETRIC_INTERPRETATION
private static final int PLANAR_CONFIGURATION
private static final int NUMBER_OF_FRAMES
private static final int ROWS
private static final int COLUMNS
private static final int PIXEL_SPACING
private static final int BITS_ALLOCATED
private static final int WINDOW_CENTER
private static final int WINDOW_WIDTH
private static final int RESCALE_INTERCEPT
private static final int RESCALE_SLOPE
private static final int ICON_IMAGE_SEQUENCE
private static final int ITEM
private static final int ITEM_DELIMINATION
private static final int SEQUENCE_DELIMINATION
private static final int PIXEL_DATA
private static final int AE
private static final int AS
private static final int AT
private static final int CS
private static final int DA
private static final int DS
private static final int DT
private static final int FD
private static final int FL
private static final int IS
private static final int LO
private static final int LT
private static final int PN
private static final int SH
private static final int SL
private static final int SS
private static final int ST
private static final int TM
private static final int UI
private static final int UL
private static final int US
private static final int UT
private static final int OB
private static final int OW
private static final int SQ
private static final int UN
private static final int QQ
private static final int IMPLICIT_VR
private int bitsPerPixel
private int location
private int elementLength
private int vr
private boolean oddLocations
private boolean inSequence
private boolean bigEndianTransferSyntax
private byte[][] lut
private short[][] shortLut
private long[] offsets
private int maxPixelValue
private double rescaleSlope
private double rescaleIntercept
private boolean isJP2K
private boolean isJPEG
private boolean isRLE
private boolean isDeflate
private boolean inverted
private String date
private String time
private String imageType
private String pixelSizeX
private String pixelSizeY
private Double pixelSizeZ
private int imagesPerFile
private String originalDate
private String originalTime
private String originalInstance
private int originalSeries
private DicomReader helper
public boolean isThisType(String name, boolean open)
FormatReader
FormatReader.isThisType(RandomAccessInputStream)
.isThisType
in interface IFormatReader
isThisType
in class FormatReader
open
- If true, and the file extension is insufficient to determine
the file type, the (existing) file is opened for further analysis.public boolean isThisType(RandomAccessInputStream stream) throws IOException
IFormatReader
isThisType
in interface IFormatReader
isThisType
in class FormatReader
IOException
public byte[][] get8BitLookupTable()
IFormatReader
IFormatReader.isIndexed()
returns
false, then this may return null. Also, if IFormatReader.getPixelType()
returns
anything other than FormatTools.INT8
or FormatTools.UINT8
,
this method will return null.get8BitLookupTable
in interface IFormatReader
get8BitLookupTable
in class FormatReader
public short[][] get16BitLookupTable()
IFormatReader
IFormatReader.isIndexed()
returns
false, then this may return null. Also, if IFormatReader.getPixelType()
returns
anything other than FormatTools.INT16
or FormatTools.UINT16
, this method will return null.get16BitLookupTable
in interface IFormatReader
get16BitLookupTable
in class FormatReader
public String[] getSeriesUsedFiles(boolean noPixels)
IFormatReader
getSeriesUsedFiles
in interface IFormatReader
getSeriesUsedFiles
in class FormatReader
public int fileGroupOption(String id) throws FormatException, IOException
IFormatReader
fileGroupOption
in interface IFormatReader
fileGroupOption
in class FormatReader
FormatException
IOException
public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class FormatReader
no
- the image index within the file.buf
- a pre-allocated buffer.x
- X coordinate of the upper-left corner of the sub-imagey
- Y coordinate of the upper-left corner of the sub-imagew
- width of the sub-imageh
- height of the sub-imagebuf
for convenience.FormatException
- if there was a problem parsing the metadata of the
file.IOException
- if there was a problem reading the file.IFormatReader.openBytes(int, byte[], int, int, int, int)
public void close(boolean fileOnly) throws IOException
IFormatReader
Closeable.close()
.close
in interface IFormatReader
close
in class FormatReader
IOException
protected void initFile(String id) throws FormatException, IOException
FormatReader
initFile
in class FormatReader
FormatException
- if a parsing error occurs processing the file.IOException
- if an I/O error occurs processing the fileprivate void addInfo(int tag, String value) throws IOException
IOException
private void addInfo(int tag, int value) throws IOException
IOException
private String getHeaderInfo(int tag, String value) throws IOException
IOException
private int getLength(RandomAccessInputStream stream, int tag) throws IOException
IOException
private int getNextTag(RandomAccessInputStream stream) throws FormatException, IOException
FormatException
IOException
private void makeFileList() throws FormatException, IOException
FormatException
IOException
private void scanDirectory(Location dir, boolean checkSeries) throws FormatException, IOException
FormatException
IOException
private void addFileToList(String file, boolean checkSeries) throws FormatException, IOException
FormatException
IOException
private String formatTag(int tag)
private void attachCompanionFiles() throws IOException
IOException
Copyright © 2015 Open Microscopy Environment