Thread Subject: image processing

Subject: image processing

From: Peter Schreiber

Date: 7 Feb, 2009 17:15:04

Message: 1 of 4

Hi guys,
Is there any way to load pictures (any format would be okay, but high resolution) into matlab and rotate them in a 3d cartesian coordinate system? I have to make a 3d picutere, consisting of slices at different focal positions, where on each slice the intensity of the beam is shown.

Best Regards,
Peter

Subject: image processing

From: ImageAnalyst

Date: 7 Feb, 2009 22:48:48

Message: 2 of 4

On Feb 7, 12:15=A0pm, "Peter Schreiber" <schreiber.pete...@gmail.com>
wrote:
> Hi guys,
> Is there any way to load pictures (any format would be okay, but high res=
olution) into matlab and rotate them in a 3d cartesian coordinate system? I=
 have to make a 3d picutere, consisting of slices at different focal positi=
ons, =A0where on each slice the intensity of the beam is shown.
>
> Best Regards,
> Peter

------------------------------------------------------------------
Peter:
imrotate only rotates in 2D, so that won't help. imtransform() could
probably give you a 2D image of a projection of an image rotated in 3D
(in which case the 2D projection would look like it has a perspective
(vanishing point) in addition to the rotation.) You might try
tformarray() which can apply a transform to an N-D array. You may
have to load your 2D pictures into a 3D volume image array first
though (use the cat() function). I can't help you beyond that, as I
haven't used tformarray, so just try to understand the help and
examples for it. These all require the image processing toolbox.
Good luck,
ImageAnalyst

Subject: image processing

From: Pete

Date: 8 Feb, 2009 19:06:02

Message: 3 of 4

If I understand you correctly, one method would be to use SURF to display planes and use your image data to provide the colours/gray levels. For example, if your image is in a variable IM:

offset = 0;
[xx, yy] = meshgrid(1:size(im,2), 1:size(im,1));
zz = ones(size(xx)) * offset;
surf(xx, yy, zz, im, 'EdgeColor', 'none');
colormap gray

You can have multiple planes by varying the offset. You can also control the transparency of each plane with the 'FaceAlpha' property. The interactive controls will allow you to rotate in 3D, although I suspect that would be very slow for high resolution images. It could help to determine a nice display angle on a very low resolution version of your images, store it using the VIEW function and then use VIEW again to set the angle directly from the command line for the final plot.

Subject: image processing

From: Image Analyst

Date: 8 Feb, 2009 20:29:02

Message: 4 of 4

Pete
That wasn't what I was thinking. but who knows it might work for surfaces. Well for us, we don't bother with MATLAB for true 3D volume visualization. It's just not made for such things, as compared to others that are, such as
avizo: http://www.tgs.com/products/avizo.asp
amira: http://www.amiravis.com/
volvis: http://www.cs.sunysb.edu/~vislab/volvis_home.html
volview: http://www.kitware.com/products/volview.html
With these you can really do powerful volume visualization including cut-away views, projections, segmentation, transparent rendering, threshold-based rendering, rotation (like you want), cropping, resizing, converting to other formats, distance and volume measurement, and so much more.

If you really want to use MATLAB instead of some of the superior packages, then Google has quite a few ideas ("volume visualization in MATLAB" was one of it's automatically generated hints/suggestions):
http://www.google.com/search?hl=en&q=volume+visualization+in+matlab&aq=5&oq=volume+vis

Regards,
ImageAnalyst

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com