Hi, and yet again, thank you for your quick and kind responses. I have joined the Julia Slack and I’ll check the channel.
I apologize for not being clear. I’m loading a DICOM dataset that has been encoded and encapsulated with a JPEG format. I know this because of the field TransferSyntaxUID which is, 1.2.840.10008.1.2.4.70, which I thought it was JPEG2000 but it was JPEG Lossless, Nonhierarchical, First- Order Prediction. I wanted to extract the information in a 3d array, like I would do in MATLAB or Python, for implementing an algorithm of k-means segmentation for each image.
This is a project for University studies but I wanted to focus on a language that wasn’t MATLAB, and that was faster than Python.
I also noticed the Pixel Data of my dataset, adding to the fact that the size changes within every file, is in an encapsulated format, or so do I think. My own dataset gave the following variable:
julia> data[1].PixelData
2-element Vector{Any}:
UInt8[]
UInt8[0xff, 0xd8, 0xff, 0xe0, 0x00, 0x0f, 0x4c, 0x4a, 0x49, 0x46 … 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xd9]
Whilst the dataset you kindly have provided is as following:
julia> data[1].PixelData
352×352 Matrix{UInt16}:
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 … 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
⋮ ⋮ ⋱ ⋮ ⋮
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 … 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
That’s why I was separating the pixel values and then transforming then with ImageMagick. My final goal here is obtain a matrix of that type that I know I can simply display and work with.
If any more information is needed, I’ll be happy of sharing it. I think I can manage to anonymize the dataset and provide you with just the DICOM file, but as it is I can’t share it, if that plays by the rules.
Also, thanks Jakub, although my current problem isn’t visualization but data manipulation. I’ll be checking the libraries you posted as they show promising for segmentation.
Thanks in advance!
Kindly, Matías.