title: Matlab 3D Volume visualization - dicom file
body: <p>I am looking forward to visualize a 3D matrix into matlab from dicom files. As I am not quite familiar with matlab, i managed to get help from <a href="https://stackoverflow.com/questions/2942251/matlab-3d-volume-visualization-and-3d-overlay">this post</a>:</p>
  
  <p>The difference is that my matrix is not made of 1 and 0 but negative numbers that are correctly red with <code>imshow(dicomeread(dicomFile))</code></p>
  
  <p>How can I get to the same contrast but with a 3D rendering ?</p>
  
  <p>My code :</p>
  
  <pre><code>dicomFilesZm = dir(fullfile(myDcmFolder, 'SLZ-*.dcm')); %Get files name
  dicomFilesZp = dir(fullfile(myDcmFolder, 'SLZ+*.dcm')); %~
  
  Z = dicomFilesZm(end:-1:1); % sort
  
  dicomFilesZ = [Z ; dicomFilesZp]; % recompose final array with files name
  
  Iz1 = fullfile(myDcmFolder, dicomFilesZ(1).name); 
  v = NaN([size(dicomread(Iz1)) numel(dicomFilesZ)]); % creation of empty matrix with the good size    
  for i = 1 : numel(dicomFilesZ)
      Iz = fullfile(myDcmFolder, dicomFilesZ(i).name);
      v(:,:,i) = dicomread(Iz); % fill the matrix with each image
  end
  
  p = patch( isosurface(v,0) );
  isonormals(v, p)
  set(p, 'FaceColor','r', 'EdgeColor','none')
  daspect([1 1 1])
  </code></pre>
  
  <p>Thank you for your help.</p>