# How to display a 2D square as a 3D cube

5 visualizaciones (últimos 30 días)
Elysi Cochin el 19 de Mzo. de 2022
Editada: Elysi Cochin el 23 de Mzo. de 2022
How can i display the attached 2D square input as a 3D cube from?
I used the same image in all slice. But the display is not clear.
Please can someone help me with displaying
##### 0 comentariosMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos

Iniciar sesión para comentar.

Abolfazl Chaman Motlagh el 19 de Mzo. de 2022
Editada: Abolfazl Chaman Motlagh el 19 de Mzo. de 2022
Use volshow function :
thisSlice = double(thisSlice);
thisSlice = (thisSlice-min(thisSlice(:)))/(max(thisSlice(:))-min(thisSlice(:)));
thisSlice = uint8(255*thisSlice);
volSlice = repmat(thisSlice,[1,1,100]);
queryPoints = 0:255;
alpha = [0 0.01 0.02 .05 0.9];
intensity = linspace(0,255,5);
alphamap = interp1(intensity,alpha,queryPoints)';
volshow(volSlice,'Alphamap',alphamap)
change Alphamap and Colormap option of volshow to have better representation for your application. there is a simple example in documentation of dicomreadvolume in MATLAB documentation.
the image in final step :
3D volumetric plot :
##### 4 comentariosMostrar 3 comentarios más antiguosOcultar 3 comentarios más antiguos
Abolfazl Chaman Motlagh el 20 de Mzo. de 2022
as i said earlier, you can change alphamap and colormap to see what is best illustration for your work.
for example if you don't use any option even dark pixels have intensity in volumentric figure:
volshow(volSlice)
but for example a little more precise number would be this: (i see that most pixel in box have intensity grater than 130 in 8bit image so i did this:)
queryPoints = 0:255;
alpha = [0 0.01 0.02 .6 1 1];
intensity = [0 50 100 130 200 255];
alphamap = interp1(intensity,alpha,queryPoints)';
volshow(volSlice,'Alphamap',alphamap)

Iniciar sesión para comentar.

### Categorías

Más información sobre Images en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by