Questions tagged [nifti]

A data format used in biomedical imaging, proposed by the Neuroimaging Informatics Technology Initiative.

It can be used to represent the 2 current formats, NIfTI-1 or NIfTI-2, as well as the organization behind it, the Neuroimaging Informatics Technology Initiative.

179 questions
3
votes
0 answers

ITK-SNAP / C3D - IO factory can not create IO object

I am trying to manipulate .img or .nii files using C3D. However, when using those files, I get the following : Exception caught of type 16ConvertException Exception detail: Unable to read image (filename).nii; IO factory can not create IO…
Pollux
  • 349
  • 1
  • 3
  • 7
2
votes
1 answer

Merge channels of NIfTI (.nii) images in python

I am trying to superimpose a CT .nii image and its mask in another color (possibly red). This is easily achievable for example with imageJ, thanks to the "Merge Channels" functionality. What I would like to obtain looks like this: given my original…
Sala
  • 480
  • 4
  • 19
2
votes
1 answer

Conversion not working properly using dicom2nifti

I have a series of dicom files (.dcm) for each patient that I want to convert to nii.gz files, but nothing happens (even error info) with the following conversion... import dicom2nifti dicom2nifti.settings.set_gdcmconv_path('C:/Program Files/GDCM…
Linminxiang
  • 325
  • 2
  • 14
2
votes
1 answer

How to check NIFTI image is in the right orientation/position with Python

I am new here. Currently learning about medical imaging data on Python and wondering if it is possible to identify the NIFti image is in the right orientation and how to do the transformation. I looked up online and found some algorithm to 'rotate'…
amyleeslie
  • 21
  • 1
  • 3
2
votes
3 answers

How to resize a nifti (nii.gz medical image) file

I have some medical images of nii.gz format which are of different shapes. I want to resize all to the same shape inorder to feed to a deep learnig model, I tried using resample_img() of nibabel, but it destroys my images. I want to do some other…
Shilpa Mathew
  • 31
  • 1
  • 2
2
votes
2 answers

How to compute the volume of a single voxel of nifti medical image?

I have loaded a nifti image file using nibabel tool and I have played with some properties. But I don’t have idea how to compute the volume (in mm³) of a single voxel.
Carlao
  • 74
  • 1
  • 5
2
votes
1 answer

How to avoid big data problem when dealing nii.gz?

I have dataset of nii.gz files each around 1G including 4d tensor. There are two ways of reading them that I am aware of as the following: img = nib.load('fMRI.nii.gz') imgarr = np.array(img.dataobj) or img = nib.load('fMRI.nii.gz') imgarr =…
Saeed
  • 598
  • 10
  • 19
2
votes
0 answers

Learner.export() problem: Can’t pickle at 0x……..>: it’s not the same object as __main__.

I am new to fast-ai. I define my own transformation pad3d for databunch and create and train a learner using my own autoencoder models. But when we want to export the learner, I ran into an error: PicklingError: Can’t pickle
2
votes
0 answers

Convert .hdr to NiFti file conversion in python

I'm currently working on a project which handles .nii files from .hdr images.Is there anyway to convert from HDR to NiFti file in python? Please help. Thanks.
2
votes
1 answer

Nifti file into 4D-Tensor for C++

I am looking for a function that passing a 4D-Nifti file as an arg or filename, will churn out a 4D Tensor. Can you point me in a good direction or good library? 1)maybe you can add a concrete example for the answer from the post in VTK - How to…
user133100
  • 141
  • 5
1
vote
0 answers

upload .nii files to kaggle

I am working on some mri images that have .nii.gz form, and their respective masks that are .nrrd type. I ziped the folders containing the images and the masks and uploaded them on kaggle. The masks work file, but the the notebook does not seem to…
Iliasp
  • 143
  • 8
1
vote
0 answers

Kernel disconnecting on Google Colab with the error: XDG_RUNTIME_DIR not set in the environment

I am having trouble with theses disconnections, kernel keeps interrupting and restarting. I am trying to figure out why since earlier this day and I still don't get it. The code uses a re-implementation in Python, which can de found here…
Bruno Takara
  • 11
  • 1
  • 6
1
vote
0 answers

Need help fixing my K-means clustering on MRI-data Python script

I'm using KMeans clustering from the scikitlearn module, and nibabel to load and save nifti files. I want to: Load a nifti file Perform KMeans clustering on the data of this nifti file (acquired by using the .get_fdata() function) Take the labels…
Björn
  • 11
  • 2
1
vote
0 answers

How to load multiple nii.gz files from a specific folder with python?

I have a folder in which I keep multiple fmri images in the format nii.gz to which I want to apply a preprocessing script and then save the altered data. # I tried to do something like: subj = 1 folder_dir = r'C:\Users\myfolder' files =…
1
vote
1 answer

How can I one hot encode nii.gz files stored in two different folders?

I have read all those images, which I am going to use for binary classification, and stored them in two different NumPy arrays. Now, I need to one hot encode these images, and then feed it to a Neural network. I don't understand how I can one hot…
1
2
3
11 12