Table Of Contents

Previous topic

Introduction

Next topic

Spherical Parameterization

Data Preparation

This step is designed for preprocessing 3D binary image data. If your data are surface meshes, you can ignore this step.

In medical imaging domain, many structures of interest are obtained by manual or automated segmentation from volumetric scans (e.g., MRI, CT, etc.), and are often described as 3D binary images. This data preparation step deals with how to remove noises (e.g., 3D holes, bad edge connectivity, bad vertex connectivity, etc) in a 3D binary object so that its voxel surface has a spherical topology. Note that SPHARM-MAT can be used to model arbitrarily shaped but simply connected 3D objects. That is, the object surface needs to have a spherical topology (i.e., genus-zero surface).

If there are small vacancies or discontinuities between image voxels, they can be repaired using the “TopologyFix” tool which will remove any possible sources of error without significantly altering the original image. SPHARM-MAT has two options to do the topology fix: (1) an in-house tool (see Exercise 2.1: In-house Topology Fix for a demo), and (2) an alternative tool integrated from SPHARM-PDM (see Exercise 2.2: SPHARM-PDM Topology Fix for a demo).

Exercise 2.1: In-house Topology Fix

This exercise was tested on a WinXP machine (3GHz CPU, 3.25G RAM) running Matlab 7.7.0 (R2008b). It took a few minutes to finish.

Major Steps

  1. Topology Fix
  2. Binary Object Visualization (Solid with Mesh)

Topology Fix

Task

Fix the topology of a set of 3D binary objects so that their voxel surfaces have a spherical topology

Input

SpharmMatDir/data/Ex0201/hip01_bim/*_bim.mat

Output

SpharmMatDir/data/Ex0201/hip02_fix/*_fix.mat

Steps

  1. Run SPHARM_MAT.m under Matlab
  2. Select TopologyFix under the Utils pop-up menu (bottom-left corner)
  3. In the right panel, let Method be InHouse_Fix
  4. Make an output directory SpharmMatDir/data/Ex0201/hip02_fix
  5. In the right panel, select SpharmMatDir/data/Ex0201/hip02_fix as OutDirectory
  6. In the right panel, click ..... button next to Select Input, and select all the *_bim.mat files under SpharmMatDir/data/Ex0201/hip01_bim as input files
  7. Click OK button (See Screen Capture for In-House Topology Fix)
_images/Ex0201-fig01.png

Screen Capture for In-House Topology Fix

Binary Object Visualization (Solid with Mesh)

Task

Visualize the binary objects before and after topology fix

Input

SpharmMatDir/data/Ex0201/hip01_bim/*_bim.mat or

SpharmMatDir/data/Ex0201/hip02_fix/*_fix.mat

Output

SpharmMatDir/data/Ex0201/hip01_bim/PNG/*.png or

SpharmMatDir/data/Ex0201/hip02_fix/PNG/*.png

Steps

  1. Select DisplayObjs under the Utils pop-up menu (bottom-left corner)
  2. In the right panel, let Space be object, Mesh be orig, Shade be both, Overlay be none, Export be PNG
  3. In the right panel, click ..... button next to Select Input, and select either all the SpharmMatDir/data/Ex0201/hip01_bim/*_bim.mat files or all the SpharmMatDir/data/Ex0201/hip02_fix/*_fix.mat as the input files
  4. Click OK button (See Screen Capture for Display Binary Objects (Solid with Mesh))
_images/Ex0201-fig02.png

Screen Capture for Display Binary Objects (Solid with Mesh)

Notes

_images/Ex0201-fig03.png

Binary Object Visualization (Solid with Mesh)

Exercise 2.2: SPHARM-PDM Topology Fix

This exercise was tested on a WinXP machine (3GHz CPU, 3.25G RAM) running Matlab 7.7.0 (R2008b) and SPHARM-PDM (WinXP-v1.3). It took a few minutes to finish. In order to run this exercise, you need to install the SPHARM-PDM package (see Install SPHARM-PDM).

Major Steps

  1. Format Conversion bim2gipl
  2. Topology Fix
  3. Format Conversion gipl2bim
  4. Binary Object Visualization (Mesh)

Format Conversion bim2gipl

Task

Convert matlab 3D binary image format to gipl format used by SPHARM-PDM

Input

SpharmMatDir/data/Ex0202/hip01_bim/*_bim.mat

Output

SpharmMatDir/data/Ex0202/hip02_gipl/*.gipl

Steps

  1. Run SPHARM_MAT.m under Matlab
  2. Select FormatConvert under the Utils pop-up menu (bottom-left corner)
  3. In the right panel, let Method be bim2gipl
  4. Make an output directory SpharmMatDir/data/Ex0202/hip02_gipl
  5. In the right panel, select SpharmMatDir/data/Ex0202/hip02_gipl as OutDirectory
  6. In the right panel, click ..... button next to Select Input, and select all the *_bim.mat files under SpharmMatDir/data/Ex0202/hip01_bim as input files
  7. Click OK button (See Screen shot for Format Conversion bim2gipl.)
_images/Ex0202-fig01.png

Screen shot for Format Conversion bim2gipl.

Topology Fix

Task

Fix the topology of a set of 3D binary objects so that their voxel surfaces have a spherical topology

Input

SpharmMatDir/data/Ex0202/hip02_gipl/*.gipl

Output

SpharmMatDir/data/Ex0202/hip03_gipl_fix/*_fix.gipl

Steps

  1. Run SPHARM_MAT.m under Matlab
  2. Select TopologyFix under the Utils pop-up menu (bottom-left corner)
  3. In the right panel, let Method be PDM_Fix
  4. Make an output directory SpharmMatDir/data/Ex0202/hip03_gipl_fix
  5. In the right panel, select SpharmMatDir/data/Ex0202/hip03_gipl_fix as OutDirectory
  6. In the right panel, click ..... button next to Select Input, and select all the *.gipl files under SpharmMatDir/data/Ex0202/hip02_gipl as input files
  7. Click OK button (See Screen Shot for SPHARM-PDM Topology Fix)
_images/Ex0202-fig02.png

Screen Shot for SPHARM-PDM Topology Fix

Format Conversion gipl2bim

Task

Convert gipl format used by SPHARM-PDM to matlab 3D binary image format

Input

SpharmMatDir/data/Ex0202/hip03_gipl_fix/*_fix.gipl

Output

SpharmMatDir/data/Ex0202/hip04_fix/*_fix.mat

Steps

  1. Run SPHARM_MAT.m under Matlab
  2. Select FormatConvert under the Utils pop-up menu (bottom-left corner)
  3. In the right panel, let Method be gipl2bim
  4. Make an output directory SpharmMatDir/data/Ex0202/hip04_fix
  5. In the right panel, select SpharmMatDir/data/Ex0202/hip04_fix as OutDirectory
  6. In the right panel, click ..... button next to Select Input, and select all the *_fix.gipl files under SpharmMatDir/data/Ex0202/hip03_gipl_fix as input files
  7. Click OK button (See Screen shot for Format Conversion gipl2bim)
_images/Ex0202-fig03.png

Screen shot for Format Conversion gipl2bim

Binary Object Visualization (Mesh)

Task

Visualize the binary objects before and after topology fix

Input

SpharmMatDir/data/Ex0202/hip01_bim/*_bim.mat or

SpharmMatDir/data/Ex0202/hip04_fix/*_fix.mat

Output

SpharmMatDir/data/Ex0202/hip01_bim/PNG/*.png or

SpharmMatDir/data/Ex0202/hip04_fix/PNG/*.png

Steps

  1. Select DisplayObjs under the Utils pop-up menu (bottom-left corner)
  2. In the right panel, let Space be object, Mesh be orig, Shade be both, Overlay be none, Export be PNG
  3. In the right panel, click ..... button next to Select Input, and select either all the SpharmMatDir/data/Ex0202/hip01_bim/*_bim.mat files or all the SpharmMatDir/data/Ex0202/hip04_fix/*_fix.mat as the input files
  4. Click OK button (See Screen shot for Format Conversion gipl2bim)
_images/Ex0202-fig04.png

Display binary objects (mesh)

Notes

  • The visualization results are saved as PNG files under SpharmMatDir/data/Ex0202/hip01_bim/PNG and SpharmMatDir/data/Ex0201/hip04_fix/PNG.
  • A couple of examples are available in Binary Object Visualization (Mesh).
_images/Ex0202-fig05.png

Binary Object Visualization (Mesh)

Relevant Information

Notes

  • In Screen Shot for SPHARM-PDM Topology Fix, the space option is set as 0.75 0.75 0.75 , meaning the voxel size for each resulting binary volume is 0.75-by-0.75-by-0.75. Therefore, these binary volumes are not only topologically fixed but also re-sliced by SPHARM-PDM; see Binary Object Visualization (Mesh) for a sample comparison before and after topology fix and reslicing.

Useful Tips