DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Tue, 2017-05-23, 13:50

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat, 2015-08-01, 01:33 
Offline

Joined: Fri, 2012-10-12, 08:05
Posts: 14
I'm having a hell of a time trying to work out what's wrong with a conversion of a number of jpg (or bmp) files to DICOM.

Code:
img2dcm -df SC.dump -sc t2-00.jpg t2-00.dcm


When I run this, I get
Code:
W: DcmItem: Length of element (230a,2323) is odd
E: DcmElement: Unknown Tag & Data (230a,2323) larger (589505315) than remaining bytes in file
F: Error converting file: I/O suspension or premature end of stream


Perhaps the JPG is corrupt? I can open it up in any other file manipulation program just fine. I've even resorted to using a JPG identity file to check each JPG to ensure that it's valid and not corrupt. exiftool reports back:
Code:
root@dcs:/home/vroot/test# exiftool t2-00.jpg   
ExifTool Version Number         : 9.46
File Name                       : t2-00.jpg
Directory                       : .
File Size                       : 366 kB
File Modification Date/Time     : 2015:07:31 16:44:41-07:00
File Access Date/Time           : 2015:07:31 16:45:59-07:00
File Inode Change Date/Time     : 2015:07:31 16:44:41-07:00
File Permissions                : rw-rw-r--
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : inches
X Resolution                    : 600
Y Resolution                    : 600
Profile CMM Type                :
Profile Version                 : 2.1.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 0000:00:00 00:00:00
Profile File Signature          : acsp
Primary Platform                : Apple Computer Inc.
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             :
Device Model                    :
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.96419 1 0.82489
Profile Creator                 :
Profile ID                      : 0
Profile Description             : Artifex Software sRGB ICC Profile
Profile Copyright               : Copyright Artifex Software 2011
Media White Point               : 0.95045 1 1.08905
Media Black Point               : 0 0 0
Red Matrix Column               : 0.43607 0.22249 0.01392
Green Matrix Column             : 0.38515 0.71687 0.09708
Blue Matrix Column              : 0.14307 0.06061 0.7141
Red Tone Reproduction Curve     : (Binary data 2060 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 2060 bytes, use -b option to extract)
Blue Tone Reproduction Curve    : (Binary data 2060 bytes, use -b option to extract)
Image Width                     : 5100
Image Height                    : 6600
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 5100x6600


The input JPG is 366K in size, but I would find it hard to believe that img2dcm is having an issue with its filesize but in an attempt to be diligent, I converted the files into a smaller size (25K) and I'm getting the exact same issue.

I even tried the VLP.dump just in case it was a secondary capture issue as opposed to visible light, but I'm getting the exact same issue.

I'm running on Ubuntu 14.04.2LTS and installed DCMTK using
Code:
apt-get install dcmtk
which installed the stable release of 3.6.0-15.


Am I doing something wrong here?


Top
 Profile  
 
PostPosted: Sat, 2015-08-01, 20:19 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1807
Location: Oldenburg, Germany
Quote:
I'm having a hell of a time trying to work out what's wrong with a conversion of a number of jpg (or bmp) files to DICOM.

Reading the documentation would certainly help, especially the referenced section on "Input Templates" :-)


Top
 Profile  
 
PostPosted: Sun, 2015-08-02, 04:59 
Offline

Joined: Fri, 2012-10-12, 08:05
Posts: 14
Ok, message received and understood (and now using the "converted" SC.dcm file, I'm now getting different issues, but I think I can handle that)...

One thing that I should ask though : in the documentation (which I've been using for a few years now and have printed out into it's own binder) it's a little confusing when 7 examples are shown, but that only one (#4) makes any reference to having to use a template file ... unless of course, you don't have to - which begs the question - when do you need to and when you do not?


Top
 Profile  
 
PostPosted: Sun, 2015-08-02, 11:10 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1546
Location: Oldenburg, Germany
Hi,

you don't have to use a template file at all. It just makes sense if you have a lot of pre-defined tags that you do not want to add using the -k option.

Even if you use the default call "img2dcm input.jpg out.dcm" with no extra options, you will have a valid DICOM file in the end.

HTH,
Michael


Top
 Profile  
 
PostPosted: Mon, 2015-08-03, 06:21 
Offline

Joined: Fri, 2012-10-12, 08:05
Posts: 14
Michael,
It does thank you - I also found your other post about storescu and proposing JPEG8 for SC which helped me immensely.

Thanks again


Dave


Top
 Profile  
 
PostPosted: Mon, 2015-08-03, 15:20 
Offline

Joined: Fri, 2012-10-12, 08:05
Posts: 14
Michael / Herr Riesmeier,
A brief follow up on this - is there any way that img2dcm can process multiple (eg) JPGs and store them into a single DICOM file? I understand that the older SC IOD is a single frame, but with the "-nsc" switch I wondered if there's a way of storing a multiframe SC?

I've tried
Code:
img2dcm --data-set from SC.dcm -nsc img1.jpg img2.jpg test.dcm
but no luck :cry:


Top
 Profile  
 
PostPosted: Sat, 2015-08-08, 16:59 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1807
Location: Oldenburg, Germany
The short answer is no: img2dcm takes a single input (and a single output) filename.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: Baidu [Spider], Bing [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