LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-17-2013, 11:35 AM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
problems extracting images (a single image) from a dicom file


Hi!

I'm having problems extracting images from a dicom file (as a matter of fact it only has a single image).

When I try with medcon, I get this:

Code:
$ medcon -w -d  -v -o prueba -c png -f dicom.dcm
(X)MedCon-Message: Writing in little endian as default
(X)MedCon-Message: Read fallback format DICOM 3.0
(X)MedCon-Message: Files overwrite    is ON
(X)MedCon-Message: Color 24 bits RGB  is ON
(X)MedCon-Message: DICM Reading <dicom.dcm> ...
Jun 17 11:28:27 log[16548]: warning: LJPG compiled with 4096-wide image limit
Jun 17 11:28:27 log[16548]: warning: Check out 'jpegutil.c' file to increase
Jun 17 11:28:27 log[16548]: error: Decompression failed
Jun 17 11:28:27 log[16548]: error: No images found

(process:16548): (X)MedCon-WARNING **: Reading: DICM Error reading file
I tried recompiling and setting MDC_LJPG_LIMIT to much larger values (as much as 400x larger) and the same exact message (even saying the limit was set at 4096, not the newer value) was


Then I tried with mitools and I get a different kind of error:

Code:
$ miconv dicom.dcm resultado/
FileIO    |FileIO.autoread : Reading format DICOM
E: can't change to unencapsulated representation for pixel data
E: can't determine 'PhotometricInterpretation' of decompressed image
E: mandatory attribute 'PhotometricInterpretation' is missing or can't be determined
FileIO    |ERROR: DicomFormat.read : Unable to load DICOM image dicom.dcm - MissingAttribute
FileIO    |ERROR: FileIO.autoread : Cannot read file dicom.dcm
Data      |ERROR: miconv.main : autoread failed
What's going on?
 
Old 06-17-2013, 01:33 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
After using dcmj2pnm I was able to see the image and it's over 4096-pixel wide. I think the problem with medcon is that even though I change the limit in jpegutil.c, it's apparently not accounted for in compilation. Why is that?
 
Old 06-17-2013, 02:28 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
I think it's a problem in main.c. It has the limit hard coded there instead of using the limit set in jpegutil.c

Code:
int mdc_dicom_decompress(SINGLE *s, ELEMENT *e)
{
  switch (encapsyntax)
  {
    case COMPRESSED_RLE     :
        if (mdc_dicom_decomp_rle (stream,(U16*)e->value.OB,e->length))
          return(-1);
        break;
    case COMPRESSED_LOSSLESS:
        if (s->w > 4096) {
          dicom_log(WARNING,"LJPG compiled with 4096-wide image limit");
          dicom_log(WARNING,"Check out 'jpegutil.c' file to increase");
          return(-2);
        }
        if (mdc_dicom_decomp_ljpg(stream,(U16*)e->value.OB,e->length
                                        ,(unsigned)s->alloc*s->samples))
          return(-2);
        break;
    case COMPRESSED_LOSSLY  :
    default:
        /* no valid decompressor */
          return(-3);
  }

  return(0);

}
 
  


Reply

Tags
conversion, dicom, medcon, mitools



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple disk images from single read-only image FuzziBear Linux - Software 3 06-17-2011 04:20 AM
5 cd images to one single image farooq1220 Linux - General 1 10-20-2010 08:31 PM
[SOLVED] DICOM image file batch convert. kaz2100 Linux - Software 2 02-08-2009 09:17 AM
downloading DICOM images boakye Linux - Networking 0 02-02-2005 07:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration