OCT-Converter
OCT-Converter copied to clipboard
Issue when converting single image Dicom
Hi,
Thank you for the great tool! We are using it to convert all the formats however we are noticing that when a dicom file contains only a single image, the tool splits it into many single pixel slices. Do you know how we can prevent this or determine the if dicom is only a single image?
Thank you!
In the meantime I found I could determine the number of frames in dcm.py using the following code, however I don't know how to convert a single image dicom. Our application however doesn't require this.
if hasattr(dicom_data, 'NumberOfFrames'):
self.number_of_frames = dicom_data.NumberOfFrames
Hi, I haven't encountered single image slices but agree it would be useful to handle this. If you manage to extend it to handle this case feel free to submit a PR! Thanks, Mark
Hi Mark, it wasn't complicated to change the code to check NumberOfFrames before converting the image, however I found that also pydicom wasn't handling the colors correctly for my test image. I tried the myriad of solutions I saw for this but didn't yet get the image colors to come out correctly. It makes me wonder whether the multiple frame dcms will also have color issues with pydicom.
Hi Mark, it wasn't complicated to change the code to check NumberOfFrames before converting the image, however I found that also pydicom wasn't handling the colors correctly for my test image. I tried the myriad of solutions I saw for this but didn't yet get the image colors to come out correctly. It makes me wonder whether the multiple frame dcms will also have color issues with pydicom.
Hey! It would be helpful if you could post your code so far.
I simply used the code I posted above to exit if it isn’t a multi frame dcm, for a single frame dcm I would rather use a different tool which converts the colors correctly
I simply used the code I posted above to exit if it isn’t a multi frame dcm, for a single frame dcm I would rather use a different tool which converts the colors correctly
I understand that one - Moreover, I was wondering how you converted them smoothly into 3D .dcm in the first place. Thanks for replying so fast!
Users upload dcm and other oct files to our web app and then we need to display them. I'm using this project to convert them to images and then display them in the browser. We had an issue though where this tool isn't converting the single frame dcm files correctly, so for those I am using our original php nanodicom converter. I did manage to convert single frame dcms using pydicom, however for my test file the colors were not correct and I couldn't find a solution for this.
Closing as this seems to be an upstream problem with pydicom