DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Fri, 2018-01-19, 20:28

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed, 2017-09-27, 14:04 
Offline

Joined: Wed, 2015-09-02, 09:24
Posts: 34
Hi,
I have a single-frame dicom file in originally in 'LittleEndianImplicit'. It says
Quote:
E: can't convert input pixel data, probably unsupported compression
when I try to read it with
Code:
DcmFileFormat * format = new DcmFileFormat;
OFCondition cond = format->loadFile(/*path*/);
if(cond.good() && format->chooseRepresentation(EXS_LittleEndianExplicit, NULL).good())
{
   DicomImage * image = new DicomImage(format, EXS_LittleEndianExplicit);
}
where the codecs have been registered in advance.
Apparently, chooseRepresentation() didn't help, nor is it relevant. If I first convert the file with 'dcmconv' into 'LittleEndianExplicit', then everything works fine as expected.
I wonder how to properly convert from 'LittleEndianImplicit' to 'LittleEndianExplicit'?


Top
 Profile  
 
PostPosted: Wed, 2017-09-27, 19:59 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1889
Location: Oldenburg, Germany
Why do you call chooseRepresentation() at all?


Top
 Profile  
 
PostPosted: Thu, 2017-09-28, 12:09 
Offline

Joined: Wed, 2015-09-02, 09:24
Posts: 34
My bad.. It seems to be specific to the file, because many other files in little endian implicit seem to work without a problem.

For this file with a problem, I took off the 'chooseRepresentation()':
Code:
DcmFileFormat * format = new DcmFileFormat;
OFCondition cond = format->loadFile(/*path*/);
if(cond.good() && format->getDataset()->tagExistsWithValue(DCM_PixelData))
{
   DicomImage * image = new DicomImage(format, EXS_Unknown); /* or EXS_LittleEndianImplicit */
}
it says the same
Quote:
E: can't convert input pixel data, probably unsupported compression
I wonder why the 'conversion' is still called? Dcmdump shows everything normal in the output, where else should I look for the problem?
Thanks!


Top
 Profile  
 
PostPosted: Thu, 2017-09-28, 12:13 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1889
Location: Oldenburg, Germany
If the required decompression codec (decoder) is registered, the DicomImage class is able to access decompressed pixel data (internally, it is decompressed for further processing).

Quote:
Dcmdump shows everything normal in the output, where else should I look for the problem?

What is the transfer syntax of this particular DICOM image?


Top
 Profile  
 
PostPosted: Thu, 2017-09-28, 12:15 
Offline

Joined: Wed, 2015-09-02, 09:24
Posts: 34
well, here is the first few lines of dcmdump:
Quote:
# Dicom-Meta-Information-Header
# Used TransferSyntax: Little Endian Explicit
(0002,0000) UL 224 # 4, 1 FileMetaInformationGroupLength
(0002,0001) OB 00\01 # 2, 1 FileMetaInformationVersion
(0002,0002) UI =XRayAngiographicImageStorage # 28, 1 MediaStorageSOPClassUID
(0002,0003) UI [1.3.12.2.1107.5.4.5.158073.30000017092706023131200000194.4] # 58, 1 MediaStorageSOPInstanceUID
(0002,0010) UI =LittleEndianImplicit # 18, 1 TransferSyntaxUID
(0002,0012) UI [1.2.276.0.7230010.3.0.3.6.2] # 28, 1 ImplementationClassUID
(0002,0013) SH [OFFIS_DCMTK_362] # 16, 1 ImplementationVersionName
(0002,0016) AE [PACSWFM6AZUUR] # 14, 1 SourceApplicationEntityTitle

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Implicit
(0008,0005) CS [ISO_IR 100] # 10, 1 SpecificCharacterSet
(0008,0008) CS [DERIVED\PRIMARY\SINGLE PLANE\SINGLE A\STORE FLUORO] # 50, 5 ImageType
(0008,0016) UI =XRayAngiographicImageStorage # 28, 1 SOPClassUID


Top
 Profile  
 
PostPosted: Thu, 2017-09-28, 12:17 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1889
Location: Oldenburg, Germany
So, the image is uncompressed (according to the transfer syntax given in the file meta information header).

Are you able to process the image (pixel data) with "dcm2pnm"?


Top
 Profile  
 
PostPosted: Thu, 2017-09-28, 12:21 
Offline

Joined: Wed, 2015-09-02, 09:24
Posts: 34
Just tried. It worked with dcm2pnm. The resulting image 'test.pgm' opens fine in ImageJ. So it must be something I did wrong...


Top
 Profile  
 
PostPosted: Thu, 2017-09-28, 14:09 
Offline

Joined: Wed, 2015-09-02, 09:24
Posts: 34
I was confused with a few different files earlier and now it seems clear:

1) problem has nothing to do with 'LittleEndianImplicit', nor is it related to DcmFileFormat::chooseRepresentation()
2) it goes wrong only with large files which are multi-frame. The error
Quote:
E: can't convert input pixel data, probably unsupported compression
comes with insufficient memory.
3) solution
Code:
DicomImage * dicom = new DicomImage(format, EXS_Unknown, CIF_MayDetachPixelData | CIF_UsePartialAccessToPixelData, (unsigned long) 0, (unsigned long) 1);
Thank you for helping!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group