NIfTI-Image-Converter icon indicating copy to clipboard operation
NIfTI-Image-Converter copied to clipboard

how to use nii_to_png_converter.py

Open shabbirshuvo opened this issue 3 years ago • 4 comments

Hi, First of all thanks for writing such awesome code for helping others.

Now let's come to my problem. I was trying to use your code for my research. I successfully used "nii2png.py" to convert a single 3D nifti file. But did not find the use of "nii_to_png_converter.py" anywhere in your documentation. Can you please explain how to use it? That would be of great help. Thank you.

Sincerely, Shabbir

shabbirshuvo avatar Nov 26 '21 03:11 shabbirshuvo

@shabbirshuvo This code can be used to convert single/multiple NIfTI image files (.nii or .ni.gz) into .png/JPEG/JPG/TIFF/TIF images. All the raw image data (.nii or .ni.gz) should be in the same folder. This code will create multiple folders with .png/JPEG/JPG/TIFF/TIF images based on the filename. Change rotation angle if required. Default is set to 90.

I recently made some changes in the code and created a PR request, which is still pending by the admin.

If you're using previous code use the below command to run the script: python3 nii_to_pngs_converter.py --input_path /data/path/to/you/raw_nii/file/path

If you are using the modified code use the below command to run the script. In the modified code I just set the "save_image_path", which was previously "base_path".

python3 nii_to_pngs_converter.py --input_path /data/path/to/you/raw_nii/file/path --save_image_path /path/where/you/want/to/save/the/images

Let me know if you have any doubts. "nii_to_png_converter.py" can be used if you have multiple files.

monjoybme avatar Dec 03 '21 14:12 monjoybme

@shabbirshuvo There isn't any response. I'm hoping the problem has been resolved. I'm going to close this case. If you believe the problem has not been rectified, please reopen this ticket.

monjoybme avatar Dec 22 '21 13:12 monjoybme

Where I can find how to install nii_to_pngs_converter.py? from the installation described I got only nii2png.py

Planetdtudy avatar May 30 '23 16:05 Planetdtudy

@Planetdtudy You don't need to install nii_to_pngs_converter.py if you have followed installation instructions of nii2png.py. Just run the code by setting the required arguments.

monjoybme avatar May 30 '23 17:05 monjoybme