Apply Non Linear VOILut

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ali.m.habib
Posts: 85
Joined: Sun, 2010-12-26, 17:34

Apply Non Linear VOILut

#1 Post by ali.m.habib » Tue, 2011-04-26, 13:46

Hi,

We're having a dicom file which contains a non linear VOI Lut , How to open it correctly & apply the nonLinear VoiLut using the DicomImage class..
Any help with sample code will be appreciated.

Thanks

omarelgazzar
Posts: 101
Joined: Wed, 2009-07-08, 16:06
Location: Oldenburg, Germany

#2 Post by omarelgazzar » Tue, 2011-04-26, 14:31

In the case of non-linear VOI Lut, you might have multiple VOI items in the sequence (see PS 3.3 C.8.11.3.1.5). You can use the function setVoiLut which takes the index of the item you wish to apply. Although not tested, your code should look like

Code: Select all

DicomImage *image = new DicomImage("/* filename*/");
if ((image != NULL) && (image->getStatus() == EIS_Normal))
{
  // Apply first image VOI lut data
  image->setVoiLut(0);
}

ali.m.habib
Posts: 85
Joined: Sun, 2010-12-26, 17:34

#3 Post by ali.m.habib » Tue, 2011-04-26, 14:45

it's not working .. is there another way to apply the non Linear Voi Lut ?

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier » Tue, 2011-04-26, 14:57

I'm sorry, but "it's not working" it not very helpful.

Have you already tried to use "dcm2pnm" with the appropriate option, i.e. --use-voi-lut? If so, what is the debug output?

ali.m.habib
Posts: 85
Joined: Sun, 2010-12-26, 17:34

#5 Post by ali.m.habib » Tue, 2011-04-26, 15:44

the file is JPEG lossless and when i opened it and displayed it the image seems corrupted , but when i decompress the image to implicit little indian it works fine ...

is there any idea why ? & how to over come this problem ?

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#6 Post by Jörg Riesmeier » Tue, 2011-04-26, 15:49

the file is JPEG lossless and when i opened it and displayed it the image seems corrupted
Which software did you use to display the image, and what is the debug output and rendered image output of "dcmj2pnm"?

ali.m.habib
Posts: 85
Joined: Sun, 2010-12-26, 17:34

#7 Post by ali.m.habib » Tue, 2011-04-26, 16:00

I am not using software , I am rendering the image on UIImageView on iPad and it works fine with all images also with the image causing problem it works when uncompressed
but i noticed this in the Console when this file is compressed JPEGLossless

W: computed (3356700) and stored (772057) pixel count differ

do you have any idea what that means ?

i haven't yet tried the dcmpng ..
if you want me to send u the file it's ok .

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#8 Post by Jörg Riesmeier » Tue, 2011-04-26, 16:06

I am not using software, I am rendering the image on UIImageView on iPad ...
So, you are definitely using software :) Probably software that is written by yourself based on the DCMTK, right?
W: computed (3356700) and stored (772057) pixel count differ
do you have any idea what that means ?
Yes, it means that something is probably wrong with the image file because the DCMTK routine processing the data expects more pixel data than actually stored in the PixelData element.
haven't yet tried the dcmpng ..
But that would be really helpful and that's the reason why I was asking for it (see my above postings).
if you want me to send u the file it's ok .
That would also be ok. So, please send the DICOM image file by email to dicom/at/offis/dot/de.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#9 Post by Jörg Riesmeier » Tue, 2011-04-26, 16:26

This is easy: The DICOM image file you've sent to us is corrupt (in many ways). The main issue is that the pixel data is not encoded in an encapsulated manner (sequence of pixel items) as it is required by the DICOM standard:

Code: Select all

(0002,0010) UI =JPEGLossless:Non-hierarchical-1stOrderPrediction #  22, 1 TransferSyntaxUID
[...]
(7fe0,0010) OW fffe\e000\0000\0000\fffe\e000\8fa2\0017\d8ff\e0ff\1000\464a\4649... # 1544114, 1 PixelData

ali.m.habib
Posts: 85
Joined: Sun, 2010-12-26, 17:34

#10 Post by ali.m.habib » Tue, 2011-04-26, 16:28

is there a way to handle this ?

As i already loaded the same file using itk and it works fine ..

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#11 Post by Jörg Riesmeier » Tue, 2011-04-26, 17:52

Change the VR to "OB" and the length to "0xffffffff" (i.e. undefined) and the image might look like expected.

I've added an entry to our to-do list that we might add a new "compatibility option" to the DCMTK that allows for supporting such an incorrectly encoded DICOM image.

Post Reply

Who is online

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