Modality LUT Sequence

All other questions regarding DCMTK

Moderator: Moderator Team

Message
Author
simeon
Posts: 35
Joined: Fri, 2006-09-15, 09:25
Location: Bulgaria
Contact:

Modality LUT Sequence

#1 Post by simeon »

I have DICOM image with Modality LUT Sequence.
But when I display image, the LUT is not apply and I can't display it.
DICOM image is:
http://debian.fmi.uni-sofia.bg/~tarikat ... 1.anon.dcm

Can someone help me?
Simeon Antonov

alwittta
Posts: 111
Joined: Wed, 2006-03-15, 08:30

#2 Post by alwittta »

I think you are using wrong window width/level for this image.

Try reading the image with setMinMaxWindow function of the DicomImage Class.

Cheers
Alvin

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

#3 Post by Jörg Riesmeier »

I checked the file: There seems to be an issue with the "implicit encoding" of the modality LUT (i.e. with the Implicit VR Little Endian transfer syntax).
This issue should be solved with the latest snapshot of the DCMTK. At least the modality LUT seems to be applied correctly and the resulting image looks good to me.

simeon
Posts: 35
Joined: Fri, 2006-09-15, 09:25
Location: Bulgaria
Contact:

#4 Post by simeon »

Thanks for replies.

Jörg Riesmeier,
I build DCMTK with VS. Will I be easily build snapshot on Windows OS.

alwitta, I use setMinMaxWindow.
Sample code:
m_pFileFormat = DcmFileFormatPtr(new DcmFileFormat());
OFCondition cond = m_pFileFormat->loadFile(strFileName.c_str(), EXS_Unknown, EGL_withoutGL, DCM_MaxReadLength);
if (cond.bad())
{
m_pFileFormat.reset();
return false;
}
DcmXfer xfer = m_pFileFormat->getDataset()->getOriginalXfer();
CDcmDecoderRegistration* decoder = NULL;

if (xfer.isEncapsulated())
decoder = new CDcmDecoderRegistration();

m_pDicomImage = DicomImagePtr( new DicomImage(m_pFileFormat.get(), xfer.getXfer(), CIF_AcrNemaCompatibility));

if (xfer.isEncapsulated())
delete decoder;

if (m_pDicomImage.get() != NULL && m_pDicomImage->getStatus() == EIS_Normal)
{
m_pDicomImage->setMinMaxWindow();

return true;
}

.....
void *buffer = NULL;
unsigned long bufSize = 0;
BITMAPINFO bi = _CreateBitmapInfo(m_pDicomImage->getWidth(), m_pDicomImage->getHeight());
bufSize = m_pDicomImage->createWindowsDIB(buffer, bufSize, nFrame, bi.bmiHeader.biBitCount, 1);
Simeon Antonov

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

#5 Post by Jörg Riesmeier »

I build DCMTK with VS. Will I be easily build snapshot on Windows OS.
We tested the latest snapshot with VS 2005 and VS 2008 on Windows XP.

simeon
Posts: 35
Joined: Fri, 2006-09-15, 09:25
Location: Bulgaria
Contact:

#6 Post by simeon »

Thanks.
I will build it this evening.
Simeon Antonov

simeon
Posts: 35
Joined: Fri, 2006-09-15, 09:25
Location: Bulgaria
Contact:

#7 Post by simeon »

I try to build snapshot. But when I make changes in CMake, after generation of project, changes missing.
I try to add /D_BIND_TO_CURRENT_VCLIBS_VERSION, but it not appear in generated projects.
When I open some project, preprocessor Definitions are DCMTK_BUILD_DATE=\"2009-12-22\",_REENTRANT,CMAKE_INTDIR=\"Debug\".
Also I want to build with /MD, but in generate projects is /MT.
Jörg Riesmeier can you help?
Simeon Antonov

simeon
Posts: 35
Joined: Fri, 2006-09-15, 09:25
Location: Bulgaria
Contact:

#8 Post by simeon »

I build it.
I notice few problem.
When I build my application it has error in oflog/streams.h
LOG4CPLUS_STREAM_NAMESPACE is not define.
I must define as: #define LOG4CPLUS_STREAM_NAMESPACE std

Other problem is with OFString.
Let value of DCM_WindowCenter is 123\123.

OFString WC;
pDataSet->findAndGetOFString(DCM_WindowCenter, WC);
cout << wc.c_str();
This code will output: 123123
I debug it and then notice that WC.theCString =123123 and WC.theSize = 3
But wc.c_str() return pointer to whole string in WC.theCString

Otherwise I open problem DICOM image and I'm happy ;)
Simeon Antonov

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 »

The first issue (LOG4CPLUS_STREAM_NAMESPACE not defined) was unknown. Checking the source code I would guess that on your system UNICODE is defined (see "streams.h" in oflog module). So, we will probably fix this with the next snapshot ...

For the second issue, this is a known bug in OFString that is already fixed in our internal development version. Switching to the standard string class (define HAVE_STD_STRING) the issue should also be fixed. Furthermore, the required patch to OFString can be found in another thread that was posted a couple of days ago.

simeon
Posts: 35
Joined: Fri, 2006-09-15, 09:25
Location: Bulgaria
Contact:

#10 Post by simeon »

Thanks
I haven't seen reporting for second issue. Sorry

Also I said for generating project files with CMake.
CMake always generate with /MT and /MTd even changed it.
I append other defines as /D_BIND_TO_CURRENT_VCLIBS_VERSION.
and it also missing form generate projects.

I try with new version of Cmake and other things but nothing helped.
Then I change all project in VS. I change my setting to /MD and /MDd and add preprocessor Definitions.
Simeon Antonov

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 »

CMake always generate with /MT and /MTd even changed it.
As far as I remember, you need to change the compiler settings in the main CMakeLists.txt file and not in the GUI. After you've made your changes, re-run CMake (configure, generate) and the changes should also be visible in the VS project files. Please note that it might be required to delete the CMake cache before you re-run ...

simeon
Posts: 35
Joined: Fri, 2006-09-15, 09:25
Location: Bulgaria
Contact:

#12 Post by simeon »

I build version 3.5.4 many times. I make changes in GUI not in CMakeLists.txt

When I open generate project, preprocessor Definitions are DCMTK_BUILD_DATE=\"2009-12-22\",_REENTRANT,CMAKE_INTDIR=\"Debug\".
It is very strange.
Simeon Antonov

Uli Schlachter
DCMTK Developer
Posts: 120
Joined: Thu, 2009-11-26, 08:15

#13 Post by Uli Schlachter »

Could you describe your build environment?
Which windows version are you using? Which cmake version, which MSVC version?
Any ideas why UNICODE could be defined?

Also, please open the top-level CMakeLists.txt with any text editor and search for "/MT" and "/MTd".

simeon
Posts: 35
Joined: Fri, 2006-09-15, 09:25
Location: Bulgaria
Contact:

#14 Post by simeon »

I test it on Windows XP and Windows 7(x64).
MSVC 2008 SP1
My application is unicode and for that reason is defined UNICODE.

Which CMakeList.txt?
I download dcmtk-3.5.5_20091222.tar.gz. Exctract it. And in root there is CMakeList.txt. I find in /MT and /MTd flags in it.

After that I load CMake and I add define /D_BIND_TO_CURRENT_VCLIBS_VERSION.

see screenshot Image

Note that there is /MD and /MDd (I am not change it)
And also it has other defines as: /DWIN32 /DWINDOWS etc
But when I generate projects, my define and other in CMake missing.
Also /MT and /MTd are set.
see screenshots
Image
Image
Simeon Antonov

simeon
Posts: 35
Joined: Fri, 2006-09-15, 09:25
Location: Bulgaria
Contact:

#15 Post by simeon »

When I choose 'Visual Studio 9 2008 Win64' in Cmake is OK with generating project.
Image
Simeon Antonov

Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 1 guest