Matz's Ruby Interpreter or Ruby MRI (also called CRuby) is the reference implementation of the Ruby programming language named after Ruby creator Yukihiro Matsumoto ("Matz"). Until the specification of the Ruby language in 2011, the MRI implementation was considered the de facto reference.
Questions tagged [mri]
103 questions
1
vote
0 answers
Undefined method 'unpack' for String when using Ruby 3.0+'s C API
I'm running into a rather strange bug when I use Ruby 3's C API in my C# program. I've been using Ruby 2.7 in my program for quite a while without any issues (in fact, the entire program depends on the fact that Ruby works), but it has stopped…

M3rein
- 187
- 1
- 13
1
vote
0 answers
Training a deep learning network for MRI reconstruction but loss and SSIM values go to NaN after a few iterations
I'm currently working on a project to train a deep learning network to denoise MRI reconstructions in Pytorch but I'm running into issues in the training process where my loss and SSIM becomes NaN after a few iterations. From what I've gathered so…

2fly2try
- 135
- 1
- 9
1
vote
1 answer
How to read multiple 3d images and store them in 4D array using numpy python?
I have used the code below to create an array with the shape of (2, 3, 365, 256, 256) (2, 365, 256, 256) for 3 images however I need my shape to be (2,365, 256, 256, 3) (2, 365, 256, 256) for my model to run, any tips please?
def…

Ehsan Alavi
- 11
- 2
1
vote
2 answers
Getting "Images Do Not Occupy Same Physical Space" Error When Trying to Multiply two .nii Files in Convert3d/ITK
I have to mask a .nii MRI image for an internship I'm doing. The method I'm using involves multiplying the proton density weighted version of the image (captured during the inversion pulse) by the original mp2rage image. In order to do this I'm…

JG98
- 43
- 5
1
vote
1 answer
How to resolve IndexError: index 440 is out of bounds for axis 0 with size 440 in Python?
The following method does exactly that, taking multiple horizontal slices and putting them in a 2D matrix
def slices_matrix_2D(img):
''' Transform a 3D MRI image into a 2D image, by obtaining 9 slices
and placing them in a 4x4…

ebubekir ırak
- 11
- 1
1
vote
0 answers
Can anyone please help me solve the issues regarding DPARSF?
I am currently doing an internship on fMRI analysis. The first step is preprocessing of fMRI data using DPABI. But I am facing this error while executing the DPARSF 5.2:
The first is when I am trying to set the nuisance regressors:
error while…

Arghya Saha
- 11
- 3
1
vote
1 answer
Load 3D Niftii images and save all slices for axial, coronal, saggital?
I have some 3D Niftii datasets of brain MRI scans (FLAIR, T1, T2,..).
The FLAIR scans for example are 144x512x512 with Voxel Size of 1.1, 0.5, 0.5 and I want to have 2D-slices from axial, coronal and sagittal view, which I use as input for my…

Nanex1011
- 39
- 5
1
vote
1 answer
How to build a function in Python (Jupyter) for calculation of Point Spread Function (image processing?)
In Image processing, the image is fourier transformed, then center transformed in fourier, and then under-sampled, and back to inverse center transform and back to image by inverse fourier transform. So, to calculate Point Spread Function, is the…

Grazel
- 111
- 2
1
vote
1 answer
2D CNN to classify 3D Greyscale MRI data, possible data labeling issue
I am trying to run a binary classification of 3D black and white MRI data. I'm using 2D convolutions due to the lack of channels inherent in B&W data. I've added a dimension to get the dimensionality to line up, and essentially the depth of this…

John Newberry
- 13
- 3
1
vote
0 answers
3D Image visualisation with nilearn
I used plot_glass_brain to visualize 3D image (Nifti) with nilearn but it is displayed incorrectly. see code and pictures below
The 2_1_t2.nii file is available on this link :…

Hela Yahyaoui
- 29
- 1
- 6
1
vote
1 answer
Python: update plot with image with slider weight
I loaded a .nii file in my application.
def show(self):
image = SimpleITK.ReadImage(file_name)
t1 = SimpleITK.GetArrayFromImage(image)
t2 = color.rgb2gray(t1[w.get()])
print(w.get())
print(t2.shape)
plt.ion()
fig =…

Cristina Bîrsan
- 11
- 2
1
vote
0 answers
CNN for Brain Tumour Detection using 3D MRI images
I am looking to implement a CNN to detect Alzheimer disease using 3D MRI dataset containing healthy and diseased samples. I am getting a very low efficiency using LeNet and VGG16. My models aren't learning and I have around 300 images total. I am…

FURION
- 11
- 2
1
vote
1 answer
How do you pass a block, written in C, to Ruby's rb_mod_refine?
Perhaps more generally, how do you pass a block, written in C, to another C function that accepts a block? I know I can do something like this:
VALUE refine_foobar(VALUE block_arg, VALUE data, int argc, VALUE* argv) {
// block code here
return…

Cameron
- 641
- 1
- 7
- 18
1
vote
0 answers
Skull removal from grey matter MRI
i'm working on brain images (nifti). I segmented the brain with SPM12. So the segmentation went fine but for some (a lot) of the subjects, i get this:
It's a 3D image (T1 MRI) from "ADNI" database.
Like you can see there are still pieces of the…

learners
- 195
- 1
- 12
1
vote
1 answer
Configure MRI Ruby GC to fail fast
I'm working on a Ruby on Rails application which has a memory leak, so eventually it crashes when there's no more memory.
However, in the final stage it basically only running the GC and processing very few requests, so basically DoS-ing itself.…

psmith
- 2,292
- 1
- 19
- 19