DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Sat, 2017-11-25, 10:16

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon, 2017-07-24, 10:22 
Offline

Joined: Wed, 2012-06-06, 07:38
Posts: 32
Hi,Everyone.
I'm using DcmDataset class to encapsulate a series of dicom files.
I can read the single dicom, But can't open these dicoms for 3D reconstruction with 3D slicer software after writing raw data to these dicom files as a series .

Is there some error in my method?
or is there a example code in encapsulating a study or a series ?

Thanks all.


1.a signle dicom encapsulated by my program.
Image

2.My writing code:
Code:
OFCondition status;   
   //create DICOM file
   m_DcmFileFormat = new DcmFileFormat();
   m_DcmDataset = m_DcmFileFormat->getDataset();
   
   //encapsulate SOP Common Module
   m_DcmDataset->putAndInsertString(DCM_SOPClassUID,UID_CTImageStorage);
   
   char uid[100];
   m_DcmDataset->putAndInsertString(DCM_SOPInstanceUID,dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT));
   m_DcmDataset->putAndInsertString(DCM_SpecificCharacterSet,"ISO_IR 100");
   DcmDate *instanceCreationDate = new DcmDate(DCM_InstanceCreationDate);
   status = instanceCreationDate->setCurrentDate();
   if (!status.good())
   {
      qDebug()<<"Create InstanceCreationDate error!";
   }
   m_DcmDataset->insert(instanceCreationDate);
   instanceCreationDate = NULL;

   

   //pixel data
   DcmPixelData *pixelData = new DcmPixelData(DCM_PixelData);
        status = pixelData->putUint16Array(vo_PixelData,m_DicomSize);



    if (!status.good())
    {
        qDebug()<<"pixelData->putUint16Array error!";
    }
    //pixelData->putFloat32Array(vo_PixelData,m_DicomSize);

    status = m_DcmDataset->insert(pixelData);
    if (!status.good())
    {
        qDebug()<<"m_DcmDataset->insert(pixelData) error!";
    }

   qDebug()<<"add:"<<QString::number(vo_InstanceNumber);



3. I can't open these dicoms with 3D slicer.
Image


Last edited by qimo601 on Tue, 2017-07-25, 07:25, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon, 2017-07-24, 13:24 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1635
Location: Oldenburg, Germany
Scanning over your code it seems you are generally doing the right thing; I did not check each value though.

Whenever *I* create DICOM objects, I check them with a DICOM checker tool first. I can recommend dciodvfy from David Clunie for this task. It finds out whether you are setting all values required for a CT Image IOD, whether values are correct regarding their DICOM datatype and so on. dciodvfy is part of the dicom3tools with Windows binaries available here.

Best regards,
Michael


Top
 Profile  
 
PostPosted: Tue, 2017-07-25, 07:26 
Offline

Joined: Wed, 2012-06-06, 07:38
Posts: 32
Michael Onken wrote:
Scanning over your code it seems you are generally doing the right thing; I did not check each value though.

Whenever *I* create DICOM objects, I check them with a DICOM checker tool first. I can recommend dciodvfy from David Clunie for this task. It finds out whether you are setting all values required for a CT Image IOD, whether values are correct regarding their DICOM datatype and so on. dciodvfy is part of the dicom3tools with Windows binaries available here.

Best regards,
Michael


Thank you,Michael.

I will try it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

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


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group