Open poppynikou opened 3 months ago
It would be useful to have a bit more information about the requirements. In particular:
header_source
.)Try forcing the image loaded from the NIfTI source to be represented as if loaded from a DICOM source:
from skrt import Image
im = Image("/path/to/nifti/source").astype("dcm")
(See the documentation of Image.astype() for why NIfTI and DICOM representations are different.)
Hi - thank you for all your help ! I spent a lot of time working on this, and the problem can be solved if the original data is converted to a nifti using scikit-rt and then back to dicom using scikit-rt. It must have been some discrepancy in the way that the nifti is created using other libraries.
convert dicom--> nifti do some processing and create synthetic CTs convert nifti --> dicom
To import the data back in the TPS I found the only tags which had to match the original planning CT were the 'Patient Name' and 'Patient ID', which can be added manually to the dicom header afterwards creating it.
I have a pipeline which works a little like:
convert dicom--> nifti (this was done a while ago using a different library)
do some processing and create synthetic CTs
convert nifti --> dicom
re-import into TPS as an additional image set for dose calcs
I am attempting to convert the nifti --> dicom using the scikit-rt library. I am using the write() function from the Image class. I am having two issues:
(1) I would like to use the header_source from the original dicom, so that the affine is kept and the voxel spacing etc are preserved. However, when I do this the TPS thinks that this image is the same file as the original image. I think this stems from the fact that the UIDs are copied over, so they are exactly the same. Is there of way of converting the image so that it is still identified as the same patient, but as a separate image set. (2) The nifti --> dicom conversion flips the image left to right. Is there a way of stopping this?