public class JPEG2000MetadataParser extends Object
Modifier and Type | Field and Description |
---|---|
private long |
codestreamOffset
Offset to first contiguous codestream.
|
private Integer |
codestreamPixelType
Pixel type as specified in the JPEG 2000 codestream..
|
private Short |
codestreamSizeC
Number of channels the image as specified in the JPEG 2000 codestream.
|
private Integer |
codestreamSizeX
Width of the image as specified in the JPEG 2000 codestream.
|
private Integer |
codestreamSizeY
Height of the image as specified in the JPEG 2000 codestream.
|
private ArrayList<String> |
comments
List of comments stored in the file.
|
private Integer |
headerPixelType
Pixel type as specified in the header.
|
private Short |
headerSizeC
Number of channels the image has as specified in the header.
|
private Integer |
headerSizeX
Width of the image as specified in the header.
|
private Integer |
headerSizeY
Height of the image as specified in the header.
|
private loci.common.RandomAccessInputStream |
in
Stream that we're parsing metadata from.
|
private boolean |
isRawCodestream
Whether or not the codestream is raw and not JP2 boxed.
|
private static org.slf4j.Logger |
LOGGER
Logger for this class.
|
private int[][] |
lut
Color lookup table stored in the file.
|
private long |
maximumReadOffset
Maximum read offset within in the stream.
|
private Integer |
resolutionLevels
Number of JPEG 2000 resolution levels the file has.
|
Constructor and Description |
---|
JPEG2000MetadataParser(loci.common.RandomAccessInputStream in)
Constructs a new JPEG2000MetadataParser.
|
JPEG2000MetadataParser(loci.common.RandomAccessInputStream in,
long maximumReadOffset)
Constructs a new JPEG2000MetadataParser.
|
Modifier and Type | Method and Description |
---|---|
private int |
convertPixelType(int type) |
long |
getCodestreamOffset()
Retrieves the offset to the first contiguous codestream.
|
Integer |
getCodestreamPixelType()
Returns the pixel type as specified in the header.
|
Short |
getCodestreamSizeC()
Returns the number of channels the image has as specified in the header.
|
Integer |
getCodestreamSizeX()
Returns the width of the image as specified in the header.
|
Integer |
getCodestreamSizeY()
Returns the height of the image as specified in the header.
|
ArrayList<String> |
getComments()
Retrieves the list of comments stored in the file.
|
Integer |
getHeaderPixelType()
Returns the pixel type as specified in the header.
|
Short |
getHeaderSizeC()
Returns the number of channels the image has as specified in the header.
|
Integer |
getHeaderSizeX()
Returns the width of the image as specified in the header.
|
Integer |
getHeaderSizeY()
Returns the height of the image as specified in the header.
|
int[][] |
getLookupTable()
Returns the color lookup table stored in the file, or null if a lookup
table is not present.
|
Integer |
getResolutionLevels()
Returns the number of resolution levels the file JPEG 2000 data has.
|
boolean |
isRawCodestream()
Whether or not the codestream is raw and not JP2 boxed.
|
private void |
parseBoxes()
Parses the JPEG 2000 JP2 metadata boxes.
|
private void |
parseContiguousCodestream(long length)
Parses the JPEG 2000 codestream metadata.
|
private static final org.slf4j.Logger LOGGER
private loci.common.RandomAccessInputStream in
private long codestreamOffset
private long maximumReadOffset
private Integer headerSizeX
private Integer headerSizeY
private Short headerSizeC
private Integer headerPixelType
private Integer codestreamSizeX
private Integer codestreamSizeY
private Short codestreamSizeC
private Integer codestreamPixelType
private boolean isRawCodestream
private Integer resolutionLevels
private int[][] lut
public JPEG2000MetadataParser(loci.common.RandomAccessInputStream in) throws IOException
in
- Stream to parse JPEG 2000 metadata from.IOException
- Thrown if there is an error reading from the file.public JPEG2000MetadataParser(loci.common.RandomAccessInputStream in, long maximumReadOffset) throws IOException
in
- Stream to parse JPEG 2000 metadata from.maximumReadOffset
- Maximum read offset within the stream when
parsing.IOException
- Thrown if there is an error reading from the file.public long getCodestreamOffset()
public ArrayList<String> getComments()
private void parseBoxes() throws IOException
IOException
- Thrown if there is an error reading from the file.private void parseContiguousCodestream(long length) throws IOException
length
- Total length of the codestream block.IOException
- Thrown if there is an error reading from the file.public boolean isRawCodestream()
true
if the codestream is raw and false
otherwise.public Integer getResolutionLevels()
null
if the
number cannot be parsed.public Integer getHeaderSizeX()
public Integer getHeaderSizeY()
public Short getHeaderSizeC()
public Integer getHeaderPixelType()
public Integer getCodestreamSizeX()
public Integer getCodestreamSizeY()
public Short getCodestreamSizeC()
public Integer getCodestreamPixelType()
public int[][] getLookupTable()
private int convertPixelType(int type)
Copyright © 2017 Open Microscopy Environment