Using ManagedITK with C - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Using ManagedITK with C

Description:

National Library of Medicine(?????????) Insight Segmentation and ... C /CLI, VB.NET, IronPython4, F#5, Chrome (Object Pascal)6, and other languages ... – PowerPoint PPT presentation

Number of Views:190
Avg rating:3.0/5.0
Slides: 18
Provided by: moL55
Category:

less

Transcript and Presenter's Notes

Title: Using ManagedITK with C


1
Using ManagedITK with C(.Net)
  • Reporter ???

2
What is ITK
  • National Library of Medicine(?????????) Insight
    Segmentation and Registration Toolkit (ITK).
  • Image processing
  • Image Read/Write?Smoothing filters?Edge
    detection...
  • Segmentation
  • Region growing?Watershed?Level set?Feature
    extraction...
  • Registration
  • To determine the spatial transform that maps
    points from one image to homologous points on a
    object in the second image.
  • Open-source.
  • Developed by six principal organizations.
  • http//www.itk.org/index.htm

3
What is ITK
  • No Graphical User Interface (GUI)
  • No Visualization
  • Implemented in C
  • ITK is cross-platform, using the CMake build
    environment to manage the compilation process.

4
ITK Tutorials
  • http//www.itk.org/HTML/Tutorials.htm
  • Getting Started I Introduction to ITK. (HTML).
  • Getting Started II Using ITK with VTK.
  • Getting Started III ITK Architecture.
  • Getting Started IV ITK and GUIs (FLTK,QT).
  • Getting Started V Integrating ITK in your
    Application.

5
What is ManagedITK
  • The Insight Journal
  • http//insight-journal.org/midas/handle.php?handle
    1926/501
  • ManagedITK generates wrappers around ITK for .NET
    languages.
  • Supported languages include C, C/CLI, VB.NET,
    IronPython4, F5, Chrome (Object Pascal)6, and
    other languages which target the .NET CLR.
  • Windows Platform Only
  • Object Browser and Auto-complete

6
Using ManagedITK
  • Download and unzip
  • ManagedITK-bin-Win32-3.6.0.1.zip
  • Ensure the .NET Framework 2.0 is installed on
    your system.
  • Install the Microsoft Visual C 2005
    Redistributable Package.
  • vc_redist_x86.exe

7
Using ManagedITK
  • Open Visual Studio
  • Select Objects browser
  • Edit Custom Component Set

8
Using ManagedITK
  • Add Reference
  • Source Code
  • using itk

9
Documents and Examples
  • Documents
  • ItkSoftwareGuide-2.4.0.pdf
  • ManagedITK-3.6.0.2.pdf
  • Examples
  • ManagedITK-src-3.6.0.2.zip
  • Others
  • http//www.itk.org/HTML/Documentation.htm

10
ITK Data Representation
  • PointSet
  • a basic class intended to represent geometry in
    the form of a set of points in n-dimensional
    space.
  • Mesh
  • The class is intended to represent shapes in
    space.
  • Path
  • This class will typically be used for
    representing in a concise way the output of an
    image segmentation algorithm in 2D.
  • Image
  • ITK supports images with any pixel type and any
    spatial dimension.
  • TreeContainer

11
Data Representation - Image
  • We must decide with what type to represent the
    pixels and what the dimension of the image will
    be.
  • Type UC(unsigned char)?F(float)?SS(signed short)
  • A region is a subset of the image and indicates a
    portion of the image that may be processed by
    other classes in the system.
  • A region is defined by two classes the itkIndex
    and itkSize.
  • Index(int) The origin of the region within the
    image.
  • Size The size of the region.
  • Spacing?Origin(double)

12
Data Representation - Image
13
Example - Allocate
  • // Create an image using an explicit type
  • // Note "UC2" stands for itkImagelt unsigned
    char, 2 gt
  • itkImageBase image itkImage_UC2.New()
  • // Region
  • itkSize size new itkSize(128, 128)
  • itkIndex index new itkIndex(0, 0)
  • itkImageRegion region new itkImageRegion(size,
    index)
  • // Set the information
  • image.SetRegions(region)
  • image.Allocate()
  • image.Spacing new itkSpacing(1.0, 1.0)
  • image.Origin new itkPoint(0.0, 0.0)
  • // Test a pixel value
  • itkPixel pixel image.GetPixel(index)

14
Iterators
  • To use an ImageRegionIterator to iterate over the
    each pixel.
  • // Create iterators to walk the input image
  • itkImageRegionConstIterator_IUC2 inputIt
  • inputIt new itkImageRegionConstIterator_IUC2(in
    put, region)
  • // Walk the images using the iterators
  • foreach (itkPixel pixel in inputIt) ...

... for(int y0 y lt size1 y) for(int x0
x lt size0 x) itkIndex index new
itkIndex(x, y) itkPixel p image.GetPixel(inde
x) ... ...
15
RescaleIntensityImageFilter
  • The RescaleIntensityImageFilter linearly scales
    the pixel values in such a way that the minimum
    and maximum values of the input are mapped to
    minimum and maximum values provided by the user.
  • using FilterType itkRescaleIntensityImageFilter
  • // Apply the Rescale Intensity filter
  • FilterType f f.New(inputImage_UC,
    outputImage_F)
  • f.SetInput(input)
  • f.OutputMinimum 000.0F
  • f.OutputMaximum 255.0F
  • f.Update()
  • f.GetOutput(output)

16
Displaying itkImages
  • System.Drawing.Bitmap
  • The System.Drawing namespace is a managed wrapper
    around the Windows GDI library.
  • MSDN
  • BITMAP http//msdn2.microsoft.com/en-us/library/sy
    stem.drawing.bitmap(VS.80).aspx
  • Working with Images, Bitmaps, Icons, and
    Metafiles http//msdn2.microsoft.com/en-us/library
    /a343dky2(VS.80).aspx
  • The source code can be found in the file
  • ManagedITK-3.6.0.2 /Examples/Images/itk.Examples.I
    mages.FormBitmap1.c

17
  • AForge.NET
  • http//code.google.com/p/aforge/
  • AForge.NET is a C framework designed for
    developers and researchers in the fields of
    Computer Vision and Artificial Intelligence -
    image processing, neural networks, genetic
    algorithms, machine learning, etc.
  • MATITK
  • http//matitk.cs.sfu.ca/usageguide
  • With the help of MATITK, biomedical image
    computing researchers familiar with MATLAB can
    harness the power of ITK algorithms while
    avoiding learning C and dealing with low-level
    programming issues.
Write a Comment
User Comments (0)
About PowerShow.com