500 likes | 624 Views
I.R.SNApp Image Reconstruction and Segmentation for Neurosurgery Applications. May09-10. Aaron Logan Dylan Reid William Lim Kyungchul Song. THANK YOU: Dr. Namrata Vaswani , Chenlu Qiu , Dr. Greg Smith, Bill Zimmerman. Project Planning. Problem Statement & Client Needs.
E N D
I.R.SNApp ImageReconstructionandSegmentation forNeurosurgeryApplications May09-10 Aaron Logan Dylan Reid William Lim Kyungchul Song THANK YOU: Dr. NamrataVaswani, ChenluQiu, Dr. Greg Smith, Bill Zimmerman
Problem Statement & Client Needs • Problem: need real-time MRI • Current MRI is slow: many measurements • Slow acquisition (10’s of minutes scan time) • Slow reconstruction (Fourier/k-space spatial domain) • Slow and inefficient segmentation (image analysis) algorithms • Solution/ Client Needs: • MR image reconstruction algorithm using Compressed Sensing • New technique in statistical signal processing/ estimation theory • Permits signal estimation using fewer observations/ measurements • Result is faster acquisition & less computation faster imagereconstruction • Goal is real-time • Develop algorithm for sequential image segmentation • Sequentially segment deforming objects or ROI's from images • Utilize prior knowledge about shape change dynamics to segment noisy/low contrast imagery. Use only current and past images. • Goal is real-time
Reconstructed & segmented MR image Reconstructed MR image Raw MR data Image Reconstruction Image Segmentation System Description & Diagrams Requirements Specification • High-Level System Block Diagram
System Description & Diagrams Requirements Specification • Image Reconstruction Block Diagrams KFCS LSCS
Reconstructed & segmented MR image Reconstructed MR Image Manual ROI Selection – Algorithm Seed MATLAB Segmentation Code Additional Manual Tracing System Description & Diagrams Requirements Specification • Image Segmentation Block Diagram
System Description & Diagrams Requirements Specification • System GUI Sketches
Operating Environment & User Interface Requirements Specification • Operating Environment • High-performance computing • Lots of memory • High speed • Future work on this project may require parallel processing • Linux application servers meet these requirements • User interacts with algorithm primarily through scripts and commandline interfaces • User Interface • Command prompt windows • MATLAB command window • SSH access to Linux applications servers • Simple GUI for segmentation • User input to choose ROI location to seed algorithm • Allow user to select options • Visual image processing feedback
Project Requirements Requirements Specification • Functional Requirements • FR-1: Algorithms shall output correct data. • FR-2: Ported version of reconstruction algorithm shall runsignificantly faster than MATLAB prototype version. • FR-3: The entire image processing program shall be capable of real-time execution. • Non-functional Requirements • NFR-1: The reconstruction program shall be written in C/C++. • NFR-2: The segmentation program shall be written in MATLAB. • NFR-3: The program shall employ parallel processing. • NFR-4: The source code shall be well documented.
Deliverables Requirements Specification • A complete software system that • takes raw MRI data, • reconstructs the data into images, and • performs segmentation on those images. • Attributes of the system: • C/C++ code, well documented and working • Executable version of the code (MEX) • A basic GUI to assist segmentation process • Comprehensive test results
Resource Requirements Project Plan • C/C++ IDE and compiler • MATLAB installed with • Image Processing Toolbox • Other Toolboxes as necessary • GUI development environment • MATLAB/ GUIDE? • Visual Studio? • Eclipse with add-ons? • Test data • Raw MR data and corresponding images
Risks Project Plan • Segmentation • Very data-dependent • Image contrast, focus/resolution of objects, etc. influence final results • Mitigated with good image preprocessing • Contrast correction/normalization, filtering • “Good” segmentation algorithm difficult to define objectively • Reconstruction • KFCS algorithm could cause PCs to crash, resulting in data loss • Eliminated by testing only small images on PCs for frameworktesting; performing batch tests on full-size images on Linux clusters • Raw data acquisition • “Raw” MRI data only exists internal to the machine • HIPAA privacy laws may pose issue with acquisition
Understand Problem and Project Scope Understand Theory Learn Operating Environment Concept Testing Thanksgiving Break Learning Design and Implementation Testing Breaks Algorithm Development – Modules Winter Break Algorithm Development – Integration Test Algorithm Framework Test Algorithm for Robustness and Correctness Spring Break Miscellaneous Wrap-Up Tasks Work Breakdown & Schedule Project Plan • Image Reconstruction: • Aaron Logan, William Lim • Image Segmentation: • Kyungchul Song, Dylan Reid
Design Approach • Image Reconstruction • Specifications are determined with two goals in mind: • Runtime improvements • Use good programming style and documentation • Image segmentation: research-oriented • Experimentation with IPT functions • See what yields good segmentation results
System Design • Image Reconstruction
System Requirements System Design – Reconstruction • Port: MATLAB C • Faster • MATLAB prototype: ~6 minutes per 64 x 64 frame • (ChenluQiu’s PC) • Initial requirement: 3x faster • Identical output
Functional Decomposition & System Analysis System Design – Reconstruction • Implement KFCS Reconstruction
Engineering Specification • Image Reconstruction
Input / Output Specifications Engineering Specification – Reconstruction • Inputs • MR k-space (Fourier-domain measurement) data • Data file • Process control parameters • Passed to program either as input parameters or as .INI file. • Observation percentage • Others? • Input / output options and directory information • Outputs • An array representation of image • Primary output format, passed to image segmentation system • Uncompressed image file - .BMP • Optional: for visual inspection by user
User Interface Specification Engineering Specification – Reconstruction • Command line interfaces • Little return on investment for creating GUI • Research project! • Focus our time on client’s needs • Simplest interface to use for operating on Linux serverconnection
Hardware Specification Engineering Specification – Reconstruction • Small scale testing • PCs in 2046 Coover: • CPU: Intel® Pentium® D, 3.00 GHz • RAM: 2.00 GB @ 2.99 GHz • Large scale testing • ECpE Linux application servers
Software Specification Engineering Specification – Reconstruction • Language • C, not C++ • Compiles smaller than C++ • Runs faster – no overhead for OOP • Easier to learn; simple, yet powerful • Compiler • MinGW (Minimalist GNU for Windows) distribution of GCC (GNU Compiler Collection) • Implements ANSI-C99 standard • support for complex numbers • Behaves identically to most common C compilers on UNIX systems • Code compiled for PCs and Linux will behave very similarly
Software Specification Engineering Specification – Reconstruction • Libraries • CLAPACK (C Linear Algebra Package) • FFTW (Fast C implementation of Fourier Transform) • Discrete Wavelet Transform package • Still looking for a C library that can do this. Part of ongoingresearch • Good style • Good abstraction practices • Happy medium between huge, complicated functions & toomany small functions that bog down performance • No compiler warnings
Software Specification Engineering Specification – Reconstruction • Documentation • Function header comments /* * Function name * Thorough description of function * List of input arguments * Output * Revision History * Author & date */ • In-context explanations & clarifications y = x^2; // x squared
Test Specification Engineering Specification – Reconstruction • Automated test scripts • Generate / read program input • Run C and MATLAB algorithms in succession on same input • Compare output of each algorithm by differencing • Compute statistics on differences • Scripts written in MATLAB; access C algorithms through MEX (MATLAB executable) files
Prototyping Engineering Specification – Reconstruction • runsim: MATLAB reconstruction simulation • Generates test data by taking FFT of image set • 32 x 32 images – manageable size for testing on PC • Tests different reconstruction techniques and looks at error,runtime of each • Kalman Filtering • Compressed Sensing • Compressed Sensing, without deletions • Full Compressed Sensing (with deletions) • Genie-Aided Kalman Filtering • Full compressed sensing yielded best results • Full simulation on 1.5 GHz PC took roughly 25 minutes • 6 minutes for full KFCS
System Design • Image Segmentation
System Requirements System Design – Segmentation • Develop segmentation algorithm in MATLAB • Achieve a contour that is correct • Includes only the ROI, no extraneous / artifact regions
System Requirements System Design – Segmentation • Achieve a contour that is correct (cont.) • Correct by visual inspection • Good contour with fine width, fine precision • ~1 pixel width (8-connected) right wrong • Runtime upper bound: 1 sec/frame
System Analysis System Design – Segmentation • Input: MR images of brain or other organ of interest • Automatically segments images • Goal of segmentation: • Simplify and change the representation of an image intosomething that is more meaningful and easier to analyze • Extract exact location of regions of interest within image • Output: the segmented MR image
Functional Decomposition System Design – Segmentation Outputs: Display montage of original images Expanded on Next Slide Contour extraction Draw contour on original image Save segmented image in DICOM format Increment iuntil i= no.input images Input: MRimages Display montage of segmented images Text file of generated files and image run info
Functional Decomposition System Design – Segmentation Contour Extraction Read ithimage Threshold (convert to B/W) Detect edges Dilate the image Fill interior gaps Smooth the object Output the contour of object
Engineering Specification • Image Segmentation
Input / Output Specification Engineering Specification – Segmentation • Input: • MR Image sequence • File format: DICOM (Digital Imaging and Communications in Medicine)* • Size: 256 × 256 pixels* *NOTE: not limited to these • Grayscale • Directory information • Indices of images to process • Output: • MATLAB display: • the current segmented image • Display montage of the original and segmented images • a list of the image files that have been segmented • File output: • DICOM file of segmented image (original + contours overlaid) • CSV file of the contour pixel coordinates • Text file listing all the image filescreated,andexecution results.
User Interface Specification Engineering Specification – Segmentation • MATLAB Command Window • Segmentation GUI • File list, current segmented image, montages of original/ segmented images • Run and stop buttons; pertinent menu bar items • Prompts user with multiple dialog boxes • Input & Output Directories • Segmentation options
Hardware and Software Specification Engineering Specification – Segmentation • Hardware Specification • Must achieve 1 sec/frame with the following: • CPU: Intel® Pentium® D, 3.00 GHz • RAM: 2.00 GB @ 2.99 GHz • PCs in 2046 Coover meet this spec • Software Specification • MATLAB Version 7.6 (R2008a) • Image Processing Toolbox, Version 6.1 • Others: discussed for reconstruction • Documentation practices • Good data abstraction • No MATLAB Interpreter warnings
Test Specification Engineering Specification – Segmentation • Visual inspection of output contour • Simple and most robust method of checking that output meetsrequirements • Speed (throughput time) of the system • Measured using the timing functions available with MATLAB • tic and toc stopwatch functions • clock • MATLAB Profiler
Prototype Segmentation Algorithm (1/8) Engineering Specification – Segmentation • Step 1: Read Image • Original image • dicomread
Prototype Segmentation Algorithm (2/8) Engineering Specification – Segmentation • Step 2: Threshold Image • Threshold the grayscaleimage to black and white • im2bw
Prototype Segmentation Algorithm (3/8) Engineering Specification – Segmentation • Step 3: Edge Detection • Detect the edges withbinary gradient mask • edge, sobel • Does not yield a goodcontour • need the next steps toimprove
Prototype Segmentation Algorithm (4/8) Engineering Specification – Segmentation • Step 4: Image ContourDilation • Dilatethe objects in theimage using dilatedgradient mask • imdilate, strel
Prototype Segmentation Algorithm (5/8) Engineering Specification – Segmentation • Step 5: Hole Filling • Holes within objects arefilled • imfill
Prototype Segmentation Algorithm (6/8) Engineering Specification – Segmentation • Step 6: Object BoundarySmoothening by Erosion • Smoothen the white pixelboundaries using erosion • imerode, strel
Prototype Segmentation Algorithm (7/8) Engineering Specification – Segmentation • Step 7: Extraction ofContours • Extract the contour pixelsfrom the object boundaries • bwperim
Prototype Segmentation Algorithm (8/8) Engineering Specification – Segmentation • Step 8: Final SegmentedImage • Overlay extracted contours on original image
Project Design Summary • Implementation already in progress • Project risks: all can be eliminated or mitigated • Project feasibility • Low cost – all resources, except for test data, already available • Test data could be obtained as part of research agreement • Project success would help advance field of medical imaging • Project has been scoped well within our means
Wrap-up • Required and requested changes • Action items