...
this.decompressor = ImageReaderFactory.getImageReader(param);
...
it throws a runtime exception :
No Image Reader for format: jpeg registered
Im watching it iterate through the ImageReaderSpi map in the ImageReaderFactory, but there isnt a JPEG reader in the list. Am I missing something ?
Nothing in the dcm2dcm that I can see is registering reader types.
Here is a code fragment from my stuff :
private byte[] extractCompressedFragments ( Object pixelData, Attributes dataset ){
byte[] uncompressedPixelData = null;
if ( pixelData != null ) {
DicomImage parentImage = getParentImage();
if ( parentImage != null ) {
Attributes fmi = parentImage.dicomMetaInformation;
String tsuid = fmi.getString( Tag.TransferSyntaxUID );
TransferSyntaxType tstype = TransferSyntaxType.forUID ( tsuid);
if ( tstype.isPixeldataEncapsulated() ) {
logger.info( "pixel data is encapsulated");
if (pixelData instanceof Fragments) {
logger.info( "its Fragments" );
Fragments pixeldataFragments = (Fragments) pixelData;
int numFragments = pixeldataFragments.size();
/* it said there are 2 */
try {
if ( Decompressor.decompress( dataset, tsuid ) ) {
uncompressedPixelData = dataset.getBytes(Tag.PixelData);
}
} catch ( IOException e ) {
logger.error ( "IOException Thrown : " + e.getMessage() );
} catch ( RuntimeException e ) {
logger.error ( "RuntimeException Thrown : " + e.getMessage() );
} catch ( Exception e ) {
logger.error( "General Exception thrown : " + e.getMessage() );
}
}
} else {
logger.info( "its no encapsulate not jpeg ! ");
}
}
}
return uncompressedPixelData;
}
Anyone know what I am doing wrong, or what would be a better way to get the uncompressed pixel data ?
thanks
an addendum, found a reason (and solution) for the problem !!!