bitmap to dicom conversion problems

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
anil.g
Posts: 10
Joined: Fri, 2007-10-19, 11:47

bitmap to dicom conversion problems

#1 Post by anil.g »

hi,
Iam converting bmp to dicom ,in dicom converted file red and blue colours are interchanging ,how to resolve my problem


thanks &regards,
Anil

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1437
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

Uncompressed DICOM RGB images either order their samples by pixel (i.e., R1 G1 B1 R2 G2 B2 R3 G3 B3... in that order) or by plane (i.e., R1 R2 R3... G1 G2 G3... B1 B2 B3...), depending on the value of the PlanarConfiguration attribute. If your image source is a 24-bit "true color" Windows bitmap, then it may be in BGR order.

kattabomane
Posts: 43
Joined: Tue, 2005-02-01, 22:53

BMP to DICOM

#3 Post by kattabomane »

Hello,

Sorry to use the same post.
I am having the same problem. While converting bmp to dcm the image is bluish. Also while converting from jpeg format the result is the same.

What could be the problem ?
Should we swap the bytes ?

Thanks for you help

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

#4 Post by alwittta »

You can use swapBytes function of the dcswap.h file.

void swapBytes(void * value, const Uint32 byteLength,
const size_t valWidth);

Aimevous
Posts: 37
Joined: Thu, 2008-05-15, 11:02

#5 Post by Aimevous »

hi, could any of you guys send me the source for the conversion code?

I've been trying for the past few days to write a converter but i'm having a lot of problems trying to adapt from img2dcm.

What I did was simply create a new cpp file and copied the contents of img2dcm into it and and set the appropriate includes and lib. I'm quite sure I didnt miss out on any libraries because my other DICOM functions are working fine, like reading and modifying DICOM files.

But instead, I'm getting tonnes of LNK2019 linking errors.
example:
MSVC_Debug_Output wrote:DICOMv2 error LNK2019: unresolved external symbol "public: __thiscall I2DJpegSource::I2DJpegSource(void)" (??0I2DJpegSource@@QAE@XZ) referenced in function "class OFCondition __cdecl startConversion(class OFCommandLine &,int,char * * const)" (?startConversion@@YA?AVOFCondition@@AAVOFCommandLine@@HQAPAD@Z)
DICOMv2 error LNK2019: unresolved external symbol "public: __thiscall I2DOutputPlugNewSC::I2DOutputPlugNewSC(void)" (??0I2DOutputPlugNewSC@@QAE@XZ) referenced in function "class OFCondition __cdecl startConversion(class OFCommandLine &,int,char * * const)" (?startConversion@@YA?AVOFCondition@@AAVOFCommandLine@@HQAPAD@Z)
DICOMv2 error LNK2019: unresolved external symbol "public: __thiscall I2DOutputPlugSC::I2DOutputPlugSC(void)" (??0I2DOutputPlugSC@@QAE@XZ) referenced in function "class OFCondition __cdecl startConversion(class OFCommandLine &,int,char * * const)" (?startConversion@@YA?AVOFCondition@@AAVOFCommandLine@@HQAPAD@Z)
DICOMv2 error LNK2019: unresolved external symbol "public: __thiscall I2DOutputPlugVLP::I2DOutputPlugVLP(void)" (??0I2DOutputPlugVLP@@QAE@XZ) referenced in function "class OFCondition __cdecl startConversion(class OFCommandLine &,int,char * * const)" (?startConversion@@YA?AVOFCondition@@AAVOFCommandLine@@HQAPAD@Z)
DICOMv2 error LNK2019: unresolved external symbol "public: __thiscall Image2Dcm::~Image2Dcm(void)" (??1Image2Dcm@@QAE@XZ) referenced in function "class OFCondition __cdecl startConversion(class OFCommandLine &,int,char * * const)" (?startConversion@@YA?AVOFCondition@@AAVOFCommandLine@@HQAPAD@Z)
DICOMv2 error LNK2019: unresolved external symbol "public: __thiscall Image2Dcm::Image2Dcm(void)" (??0Image2Dcm@@QAE@XZ) referenced in function "class OFCondition __cdecl startConversion(class OFCommandLine &,int,char * * const)" (?startConversion@@YA?AVOFCondition@@AAVOFCommandLine@@HQAPAD@Z)
DICOMv2 error LNK2019: unresolved external symbol "public: class OFCondition __thiscall Image2Dcm::convert(class I2DImgSource *,class I2DOutputPlug *,class DcmDataset * &,enum E_TransferSyntax &)" (?convert@Image2Dcm@@QAE?AVOFCondition@@PAVI2DImgSource@@PAVI2DOutputPlug@@AAPAVDcmDataset@@AAW4E_TransferSyntax@@@Z) referenced in function "class OFCondition __cdecl startConversion(class OFCommandLine &,int,char * * const)" (?startConversion@@YA?AVOFCondition@@AAVOFCommandLine@@HQAPAD@Z)
do send it to caidingyan at gmail dot com.

thanks!

Post Reply

Who is online

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