[Dcmlib] Re: write DICOM

Jean-Pierre Roux Jean-Pierre.Roux at creatis.insa-lyon.fr
Mon Dec 19 17:58:52 CET 2005


acid wrote:

>Dear sir,
>I got problems on writing dicom under win32,
>below is my code to write dicom,
>  
>
Your code seems to be OK (at least the part you show me).

If you created a Dicom file from scratch, did you check the
gdcm::FileHelper is OK?

Did you set the image sizes?

m_dicomw->InsertEntryString(strCol.str(),0x0028,0x0011); // Columns
m_dicomw->InsertEntryString(strRow.str(),0x0028,0x0010); // Rows

+ Bits Allocated (=8) , Bits Stored (=8), High Bit (=7), Pixel Representation (=1),
+ Samples Per Pixel (=3 ) + PlanarConfiguration (=1) 

HTH
Jean-Pierre Roux


>	int i,j,c;
>	unsigned char* DCM2;
>	DCM2 = new unsigned char[output->m_uXDim*output->m_uYDim*output->m_uNChannel];
>
>	for(j=0; j < m_ydim; j++)
>	{
>		for(c=0; c < m_Nchannel; c++)
>		{
>			for(i=0; i < m_xdim; i++)
>			{	
>				DCM2[i+c+m_xdim*m_Nchannel*j]
>				=output->m_buf(i,j,c);
>
>
>			}		
>		}
>	}
>	m_dicomw->SetImageData(DCM2, output->m_uXDim*output->m_uYDim*output->m_uNChannel);
>	m_dicomw->WriteDcmExplVR( m_outfile );
>
>and the program crashed at 	
>m_dicomw->SetImageData(DCM2, output->m_uXDim*output->m_uYDim*output->m_uNChannel);
>
>could you please help me out of here?
>
>Sincerely,Alison
>  
>




More information about the Dcmlib mailing list