I'm new with the Dcmtk library so I need to ask some questions to start in the right direction.
I need to split a multiframe DICOM image into separate DICOM files, one file per frame. I wouldn't change the compression and I prefer to keep overlays. I suppose each individual DICOM file must contain the same dataset? Only the DCM_NumberOfFrames property will change?
I looked at the dcml2pnm because I saw that DICOM files were splitted into JPEG images, for example. I think it is a good starting point for me because I just have to handle the DICOM file creation.
Could you tell me if I'm wrong.
In the switch...case which is in the for (unsigned int frame = 0; frame < fcount; frame++) loop, I will add a case to handle the DICOM output file.
1. I need to create a FileFormat to be able to generate the DICOM file?
2. I need to copy the original dataset without pixels inside this FileFormat. How can I do that? It seems that the pixels contained inside the DcmDataset object are empty when this dataset has already been attached with a DicomImage object so I need to keep a copy of this dataset?
3. I need to copy the pixels of the frame numbered n. How can I do that? I have a DcmElement containing pixels data. I got this object with the DCM_PixelData and a print of this object give me the output :
Code: Select all
(7fe0,0010) OB (PixelSequence #=13) # u/l, 1 PixelData
(fffe,e000) pi 00\00\00\00\a2\21\01\00\54\45\02\00\5c\6d\03\00\68\99\04\00\d6\c5\05\00\46\f3\06\00\3e\21\08\00\92\4e\09\00\90\7c\0a\00\4a\ab\0b\00\da\da\0c\00 # 48, 1 Item
(fffe,e000) pi (not loaded) # 74138, 1 Item
(fffe,e000) pi (not loaded) # 74666, 1 Item
(fffe,e000) pi (not loaded) # 75776, 1 Item
(fffe,e000) pi (not loaded) # 76804, 1 Item
(fffe,e000) pi (not loaded) # 76902, 1 Item
(fffe,e000) pi (not loaded) # 77160, 1 Item
(fffe,e000) pi (not loaded) # 77296, 1 Item
(fffe,e000) pi (not loaded) # 77132, 1 Item
(fffe,e000) pi (not loaded) # 77302, 1 Item
(fffe,e000) pi (not loaded) # 77490, 1 Item
(fffe,e000) pi (not loaded) # 77704, 1 Item
(fffe,e000) pi (not loaded) # 77542, 1 Item
(fffe,e0dd) na (SequenceDelimitationItem) # 0, 0 SequenceDelimitationItem
4. I need to set the number of frames to 1 with putAndInsertString() function, because each dicom output file will contain only one frame?
5. I save the file with the saveFile from FileFormat but I can't give it a FILE object, so it will take a path as char *.
Best regards.
toto1024