matlab and amira; how to integrate complex calculus into Amira using MATLAB

http://www.amiravis.com/documentation/521/amira/usersguide/tutmatlab.html

2.14 Using MATLAB Scripts

In this tutorial you will learn how to integrate complex calculus into Amira using MATLAB (The MathWorks, Inc) by the means of the CalculusMatlab module.

In order to use the CalculusMatlab module, MATLAB 7 must be correctly installed on your computer. The CalculusMatlab module establishes a connection to the MATLAB computational engine that was registered during installation. If you did not register during installation, on the Windows command line you can enter the command:

  • matlab /regserver

The limitations of the CalculusMatlab module are listed in its documentation.

This tutorial covers the following topics:

  1. Loading and executing a MATLAB script.
  2. Lowpass filtering on images.
  3. Controlling the script with a time slider.
  4. Thresholding on a volume.

2.14.1 Lowpass Filtering on Images

In this section we will learn how to apply a lowpass filter on an Amira image using the MATLAB Fourier transformation. This example shows how to pass data and control variables from Amira to MATLAB, execute a MATLAB script, and import the data back into Amira

.

  • Load the lena.png image file located in subdirectory data/tutorials/matlab.
  • Choose Luminance in the Channel Conversion field as shown in Figure 34.
  • Right click on the green icon and choose CalculusMatlab from the Compute section.

A new red icon appears, the CalculusMatlab module that will try to connect to the MATLAB engine. This may take a while.

Figure 34: Loading the image
  • Load the script lowpass.m located in subdirectory data/tutorials/matlab by clicking the Read button of the File port.
  • Execute the script by clicking on the buffer button of the Execute port.
  • Connect an OrthoSlice to the filtered image result.

The module uses the MATLAB computation engine which has its own user interface.

You can easily show or hide the MATLAB console using the checkbox in the options field. The MATLAB console is very useful for debugging purposes because it allows you to access variables of the MATLAB workspace. Any variable not cleared by the MATLAB « clear » command in the script is accessible in the MATLAB workspace, even after finishing the current CalculusMatlab computation (see the CalculusMatlab documentation).

Figure 35: The CalculusMatlab module

In addition you can control scalar parameters of the script using time sliders:

  • Create a time slider (File/Create/Data/Time).
  • Connect the CalculusMatlab module to the time slider.
  • Change the line cutoff=0.05 to cutoff=t in the script (see the CalculusMatlab documentation for more information about the keyword t).
  • Click on the time slider and adjust the value that will be assigned to w. Right mouse click in the text field of the time slider and select Configure to adjust the data range of the parameters.

Figure 36: Left: original Right: lowpass filtered

Note: To handle RGBA image filtering, you must load the image with Color Field Channel Conversion and treat each channel separately in the script.

2.14.2 Thresholding on a Volume

In this section we will learn how to apply a threshold to a volume. This is done by setting a value for a threshold. If the value for the voxel is less than the threshold, the voxel value is assigned the value of zero. If it is above the threshold, it is assigned a value of 255.

  • Load the file lobus.am located in subdirectory data/tutorials.
  • Right click on the green icon and choose CalculusMatlab from the Compute section.
  • Load the script threshold.m located in subdirectory data/tutorials/matlab by clicking the Read button of the File port.
  • Execute the script by clicking on the buffer button of the Execute port.

A new green icon appears, the Lattice that will hold the threshold result. Connect an OrthoSlice or a Voltex to see the result.

Note: Any variable accessed by MATLAB and pushed back into the Amira workspace will lose its voxel size information. You will need to correct the voxel size manually using the Crop Editor.

1 Response to “matlab and amira; how to integrate complex calculus into Amira using MATLAB”


  1. 1 damba nadhir 27 juin 2010 à 2:48

    je suis damande l’aide de cet logeciel amira
    « colonne vértibrale


Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s




I MOVED THIS BLOG FROM WORDPRESS TO BLOGGER. Ce blog est à
ex-ample.blogspot.com

Blog Stats

  • 206,687 hits

localization

Flickr Photos

Iceland

Plus de photos
octobre 2009
L M M J V S D
« Sep    
 1234
567891011
12131415161718
19202122232425
262728293031  

%d blogueurs aiment cette page :