In IDL converting images from other formats to DICOM involves the following steps:
Step 1: Import the other image files into a 2D or 3D IDL image array variable.
Step 2: Create (and open) a general DICOM output file with an initialization call to the IDLffDicomEx class, e.g.:
oDicomImage = OBJ_NEW('IDLffDicomEx', 'aMRImg.dcm', $
SOP_CLASS = 'STANDARD_MR', /CREATE, /NON_CONFORMING )
Step 3: Use the 'IDLffDicomEx::SetPixelData' method to assign the image data from step 1 to your new DICOM file "object".
Step 4: Call 'IDLffDicomEx::Commit' to write the 'IDLffDicomEx' object's properties out to its file, e.g.:
oDicomImage->Commit
Step 5: As with all objects, when they are done doing their work, destroy the object, e.g.:
obj_destroy, oDicomImage
An example of exactly the above, of exactly what you want to do, is shown in the IDL Online Help for the 'IDLffDicomEx::SetPixelData' method. Click on the 'Examples' link at the top of that Help page, or just open:
'.../[your IDL root directory]/examples/doc/dicom/dicomex_importimage_doc.pro'
Note that users need a 'dicom_rw' DICOM Read/Write license in order to initialize an 'IDLffDicomEx' object
|