Azzera filtri
Azzera filtri

How do I load a 3D image(.tiff) into a 3D plot?

25 visualizzazioni (ultimi 30 giorni)
Dennis Nyanyo
Dennis Nyanyo il 3 Giu 2015
Commentato: Walter Roberson il 24 Ago 2016
I'm a new MATLAB user and I'm trying to load a 3d image(.tiff) into a 3d plot and be able to generate different projections in different planes. Can anyone recommend sample commands that would be useful or even how to go about this? Thanks
  2 Commenti
Walter Roberson
Walter Roberson il 3 Giu 2015
Do you mean that you have a TIFF that has Samples Per Pixel set to 3 times the number of color planes and the ExtraSamples is set to Unspecified Data for each sample beyond the usual 3?
Or do you mean that you have a TIFF file that has multiple IFD (file directories entries), each specifying an RGB image, and there is some kind of explicit or implicit Z stacking order for them?
3D images are usually saved in DICOM format, not in TIFF format.
Dennis Nyanyo
Dennis Nyanyo il 8 Giu 2015
I have a tiff file that has multiple RGB images arranged in a Z stack using ImageJ

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 8 Giu 2015
Basically, open the TIFF file, use the read() method to get the current image, use nextDirectory to position to the second image, read() its contents, and so on. Use lastDirectory to determine whether you have reached the end of the series.
  2 Commenti
SP
SP il 24 Ago 2016
Modificato: SP il 24 Ago 2016
Hello Walter, You are correct that DICOM is one of the standard formats for viewing such images. I used the methods you mentioned and DICOM library in MATLAB to convert my TIFF image stack into DICOM. However, I am still unable to view the DICOM in 3D in MATLAB-2015. How should I go about viewing this DICOM (X in the code below)?
% DICOM Example Script
clear all; close all; clc
% Read all Tiff images
obj = Tiff('Mouse1-Day1.tiff','r');
i = 1;
while 1
subimage = obj.read();
subimages(:,:,:,i) = subimage(:,:,1:3);
if (obj.lastDirectory())
break;
end
obj.nextDirectory()
i = i+1;
end
dicomwrite( subimages, 'output_image.dcm');
dicomanon('output_image.dcm', 'output_anon.dcm');
X = dicomread('output_image.dcm');
Walter Roberson
Walter Roberson il 24 Ago 2016
?? DICOM is not a standard for viewing images. DICOM is a multipart standard for storing images, transmitting images, and various other things, but not for viewing them. There is no advantage to converting the TIFF images to DICOM for viewing in MATLAB (though it could potentially be a useful step for third-party DICOM volume visualizers, some of which are quite good.)

Accedi per commentare.

Categorie

Scopri di più su DICOM Format in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by