Matlab-在DICOM堆栈上固定白噪声

Matlab-在DICOM堆栈上固定白噪声,matlab,dicom,Matlab,Dicom,我按照上的说明加载 我编写了以下代码 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 = (f

我按照上的说明加载

我编写了以下代码

 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
我看到了这个吵闹的堆栈:


我如何调整它以显示适当的对比度

看起来您正在使用一些任意值(0100)饱和图像强度。而不是

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

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

通常,这些类型的图像的最大强度远高于100甚至332,因此仔细检查
max(mri(:)
value

看起来您正在用一些任意值(0100)饱和图像强度。而不是

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

set (gca, 'clim', [minMRI ,maxMRI ]);
通常,这些类型的图像的最大强度远高于100甚至332,因此请仔细检查
max(mri(:)
value)