Use this tag to ask question about processing/converting/creating/analyzing image instance in-memory/persistence-storage related to medical domain. This include DICOM images/pixel-data as well. Additional tag [tag:dicom] is only needed if question relates to DICOM Specifications. If question can stand without it, avoid using [tag:dicom] tag. This tag is agnostic to programming language or toolkit.
Questions tagged [medical-imaging]
250 questions
0
votes
0 answers
Is there a way to Plot with matplotlib in a new window and not in the jupyter output?
I'm working on a CT scan analyzer and i use this function to show some of the results:
def plot_slices(ct):
plt.figure()
plt.subplot(1,3,1)
plt.imshow(ct[int(ct.shape[0]/3),:,:], cmap = 'gray')
plt.subplot(1,3,2)
…
0
votes
0 answers
Medical Image Segmentation / Image Segmentation
Total Dataset :- 100 (on case level)
Training :- 76 cases (18000 slices) Validation :- 19 cases (4000 slices) Test :- 5 cases (2000 slices)
I have a dataset that consists of approx. Eighteen thousand images, out of which approx. Fifteen thousand…

kal1619
- 1
- 2
0
votes
1 answer
How to convert png to nrrd?
How to convert png to nrrd? I need help, thank you!
I use the following code:
img = cv2.imread(imgPath)
imgT = img.transpose(1,0,2)
img3d = imgT[..., np.newaxis]
nrrd.write(imgPath.split(".png")[0] + ".nrrd", img3d)
But the…

王瑩瑩
- 1
0
votes
0 answers
Pyradiomics firstorder features only returns zero values without giving an error
I'm trying to compute features from a masked numpy array (which I converted to a Simple ITK image and mask), but all my first order features are 0 except for uniformity (=1) and entropy (=-3.20e-16). I really don't understand what is causing…

Anne0102
- 1
- 1
0
votes
1 answer
Unable to apply/change colormaps with pydicom image
The colormaps in the code do not take any effect. I end up with getting a blue tinted image as shown. I then converted to the RGB colorspace with convert_color_space(). The colorspace changes however, the colormaps still don't work. How do I go…

Thangam
- 169
- 3
- 11
0
votes
1 answer
RuntimeError: expected input to have 3 channels, but got 4 channels instead
my medical PNG images for test have 3 channels as given below :
import cv2
from google.colab.patches import cv2_imshow
img= cv2.imread("a.png")
print('Image Dimensions :', img.shape)
img= cv2.imread("ax2.png")
print('Image Dimensions :',…

rezvan.ra
- 31
- 4
0
votes
1 answer
Issue with Organ Segmentation in resizing images
I am dealing with an issue while using my model to predict masks on MRI images. The thing is, I have two images which have different dimensions. My goal is to find out how different the mask is. However because my model only takes (256,256) images,…
0
votes
1 answer
Overlay contour to medical image
I am trying to plot the contour of an image and get it overlaid over the original image but without filling, I would like it to appear as an edge contour instead of a filled contour like the attached picture.
I used this command but the problem is…

Mrmr
- 35
- 4
0
votes
1 answer
How to remove CT bed/shadows in a CT image with python?
I am working with 3D CT images and trying to remove the lines from the bed.
A slice from the original Image:
Following is my code to generate the mask:
segmentation = morphology.dilation(image_norm, np.ones((1, 1, 1)))
labels, label_nb =…

Dushi Fdz
- 161
- 3
- 22
0
votes
0 answers
Issue with training single class for Unet++
model.train()
for epoch in range(3):
running_loss = 0.0
for i,data in enumerate(train_loader,0):
inputs,labels,_ = data
inputs = inputs[:,None,:]
#labels = labels[:,None,:]
print(inputs.shape)
inputs =…

Alvi Rahman
- 1
- 3
0
votes
1 answer
Numpyarray data stored in .pkl format file. How to get image from this Numpyarray stored in .pkl format?
I have data stored in the NumPy array in .pkl file format. I
only had an idea that data consists of low-dose CT DICOM images. But as the
data is in array format I don't know what the original images look
like. I am stuck at this point may be my…

Farah Jabeen
- 141
- 1
- 2
- 6
0
votes
0 answers
How to get the mask area of an image?
I am working with CT images and trying to remove the noise. Original image as follows:
I created a mask of the region I needed and my code is as follows:
def remove_noise(image):
segmentation = morphology.dilation(image, np.ones((1, 1, 1)))
…

Dushi Fdz
- 161
- 3
- 22
0
votes
0 answers
DICOM to NIFTI conversion
I have converted DICOM files to NIFTI format using dicom2nifti.dicom_series_to_nifti(case,output_path).
But when I see labels/ground truths on the NIFTI image they appear horizontally flipped so do not show a mask for the correct region in an…

Rohini Gaikar
- 1
- 2
0
votes
1 answer
How can I convert CT Nifti Files to Hounsfield Units?
What is the correct way to convert CT scan nifti files to Hounsfield units? My code is as follows:
path = 'input/volume/volume-0.nii'
img_obj = nib.load(path)
img_data = img_obj.get_fdata()
slope = img_obj.dataobj.slope
intercept =…

Dushi Fdz
- 161
- 3
- 22
0
votes
1 answer
Why is Hounsfiled Unite converted image black after normalization?
I am working with nifti images (CT scans) and when I normalize the Hounsfield Unit converted images, the output is just a full black image. My code to convert to HU scale is as follows:
def transform_to_hu(img_data, img_obj):
slope =…

Dushi Fdz
- 161
- 3
- 22