Modality LUT Sequence
Moderator: Moderator Team
Modality LUT Sequence
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?
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
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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.
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.
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);
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
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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?
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
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
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
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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.
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.
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.
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
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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 ...CMake always generate with /MT and /MTd even changed it.
-
- DCMTK Developer
- Posts: 120
- Joined: Thu, 2009-11-26, 08:15
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
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
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
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
Simeon Antonov
Who is online
Users browsing this forum: Bing [Bot] and 1 guest