I would like to know if there is a way to obtain json file from nii.gz images. I need the json file but I do not have the previous DICOM archives to do the usual convertion. Is there any possibility to get this?
Any sugestions would be helpful
Thank you in advance
I'm not an expert but since nobody has replied to your enquiry yet I'd give it a try.
I'm afraid you're probably out of luck: nii files usually lack the rich medata dcm files provide you with. In case you're thinking of json files the kind of which dcm2niix emits along with the nii.gz files for example, it's precisely because the resulting nii files can't contain the metadata that the tool emits json files to begin with.
In fact, nii file format has the provision for metadata: you can have them between its header and voxel data portions (please refer to https://brainder.org/2012/09/23/the-nift... for more info), but personally I've never seen any such nii files with the metadata with them yet.
Just in case, you can check if your nii.gz file do contain the metadata by following this procedure in a terminal session (I'm assuming you're using a linux or a mac):
- First you need to unzip the .nii.gz and extract .nii by: `unzip
- Then you can check its header portion by: `hexdump -x -n 112
If your output ends with `0000 43b0` as in `00000060 (omitted) 0000 43b0` (which probaly will be) then it means your nii file doesn't contain any such metadata.
(nii files do have some minimal metadata in its standard header portion, but it's not enough to fill a full-fledged json.)
Thank you so much Horsng Junn, I´ll give it a try