Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9173895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:39:39+00:00 2026-06-17T16:39:39+00:00

I loaded this dicom stack of images following the instructions on this tutorial video

  • 0

I loaded this dicom stack of images following the instructions on this tutorial video.

I wrote the following code

 clear all; close all; clc; imtool close all; 

  %loads the full dicom stack
  fileFolder = fullfile (pwd, 'dicom_test'); %se debe estar al mismo nivel de la carpeta 
  files = dir (fullfile(fileFolder, '*.dcm'));
  fileNames = (files.name);

  %%examine file header (metadata, from DICOM stack)
  info = dicominfo (fullfile (fileFolder, fileNames)); %%fileNames{1} or fileName[1] both fail

  %extract size info from metadata
  voxel_size = [info.PixelSpacing; info.SliceThickness]';

  %read one file to get size
  I = dicomread(fullfile(fileFolder, fileNames));
  classI = class(I);
  sizeI  = size(I);
  numImages = length (fileNames);

  %read slice images; populate 3D matrix
  bWaitBar = waitbar (0, 'reading DICOM files');

  %create array to store the images
  mri = zeros(sizeI(1), sizeI(2), numImages, classI);

  %load the images into the mri array 
  for i=length(fileNames): -1:1
      fname = fullfile(fileFolder, fileNames);
      mri(:,:,i) = uint16(dicomread(fname));
      waitbar((length(fileNames)-i+1)/length(fileNames));
  end


  delete (bWaitBar);


  %explore dataset as a montage
  % imtool close all
  minMRI = min(mri(:)); %min is 0 %%variables no usadas
  maxMRI = max(mri(:)); %max is 332 %%variables no usadas
  montage (reshape(uint16(mri),[size(mri,1), size(mri,2), 1, size(mri,3)]));
  set (gca, 'clim', [0,100]); % got this value by call to imcontrast

I got this noisy visualization of the stack:

enter image description here

How can I fix it to show proper contrast?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:39:40+00:00Added an answer on June 17, 2026 at 4:39 pm

    looks like you are saturating the image intensity with some arbitrary values (0,100). instead of

    set (gca, 'clim', [0,100]); 
    

    write:

    set (gca, 'clim', [minMRI ,maxMRI ]);
    

    Usually these type of images have a much higher max intensity than 100 or even 332, so double check max(mri(:)) value

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

would someone please write this code: this.Loaded += (s, e) => this.loaded = true;
I made this code outside the methods because I need to close and dispose
Assume that an XmlDocument is successfully loaded with this code: var doc = new
I have been using the following preload script to load all the images and
I have a plugin that is loaded by this application.. This plugin calls some
I'm trying to load one page into another using the .load() method. This loaded
I have this script loaded on a page: (function() { window.alert('bookmarklet started'); function AjaxSuccess(data,
This is a basic question - when spring bean is loaded and if i
I have loaded the calendar in my LWUIT based UI. Thanks to this thread
Given a loaded Bitmap object. I want to slice up this image into 256x256

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.