metia vs 2010 parallelization of native c++ code reduces...

15
Parallelization of Native C++ Code Helps Reduce 3-D Image-Processing Times by a Factor of 20 Overview Country or Region: United States Industry: Healthcare Customer Profile Massachusetts General Hospital (MGH) is the oldest and largest teaching affiliate of Harvard Medical School. It has more than 22,000 employees and is located in Boston, Massachusetts. Business Situation To support efficient, mass screening for colon cancer, researchers in the 3-D Imaging Research group at MGH had to reduce the time required to electronically cleanse a 3-D model by more than a factor of 10. Solution MGH surpassed its performance goals and streamlined clinical workflow by working with Microsoft, Intel, Vectorform, and consultant Dr. Joe Hummel to optimize its software for parallel processing and develop new solution components for rendering and viewing 3-D images. Benefits Rapid parallelization of “An optical colonoscopy interrupts a patient’s life for two days. Our virtual colonoscopy approach can be completed in as little as 30 minutes, with minimal inconvenience, risk, or discomfort to the patient before, during, or after the procedure.” To make colon cancer screening more broadly accessible, Massachusetts General Hospital (MGH) sought to reduce the time required to electronically cleanse and view a three- dimensional (3-D) model of the colon from an hour to five minutes. MGH reduced processing times to two minutes by optimizing its native Visual C++ code for 64-bit execution and using the Microsoft Parallel Patterns Library to parallelize the code, achieving the performance required to support mass colon cancer screening. The screening approach pioneered by MGH can also drastically decrease costs and is far more patient friendly, avoiding the many negatives of an optical colonoscopy. Radiologists can navigate and interpret the 3-D images of a colon by using gestures on a touchscreen-enabled PC, and diagnostic accuracy Microsoft Visual Studio 2010 Customer Solution Case Study

Upload: phungthuan

Post on 19-Mar-2018

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

Parallelization of Native C++ Code Helps Reduce 3-D Image-Processing Times by a Factor of 20

OverviewCountry or Region: United StatesIndustry: Healthcare

Customer ProfileMassachusetts General Hospital (MGH) is the oldest and largest teaching affiliate of Harvard Medical School. It has more than 22,000 employees and is located in Boston, Massachusetts.

Business SituationTo support efficient, mass screening for colon cancer, researchers in the 3-D Imaging Research group at MGH had to reduce the time required to electronically cleanse a 3-D model by more than a factor of 10.

SolutionMGH surpassed its performance goals and streamlined clinical workflow by working with Microsoft, Intel, Vectorform, and consultant Dr. Joe Hummel to optimize its software for parallel processing and develop new solution components for rendering and viewing 3-D images.

Benefits Rapid parallelization of native

Visual C++ code Streamlined clinical workflow Improved patient convenience

and safety

“An optical colonoscopy interrupts a patient’s life for two days. Our virtual colonoscopy approach can be completed in as little as 30 minutes, with minimal inconvenience, risk, or discomfort to the patient before, during, or after the procedure.”

Dr. Hiro Yoshida, PhD, Director of 3-D Imaging Research at Massachusetts General Hospital and Associate Professor of Radiology at Harvard Medical School

To make colon cancer screening more broadly accessible, Massachusetts General Hospital (MGH) sought to reduce the time required to electronically cleanse and view a three-dimensional (3-D) model of the colon from an hour to five minutes. MGH reduced processing times to two minutes by optimizing its native Visual C++ code for 64-bit execution and using the Microsoft Parallel Patterns Library to parallelize the code, achieving the performance required to support mass colon cancer screening. The screening approach pioneered by MGH can also drastically decrease costs and is far more patient friendly, avoiding the many negatives of an optical colonoscopy. Radiologists can navigate and interpret the 3-D images of a colon by using gestures on a touchscreen-enabled PC, and diagnostic accuracy is improved through computer-aided identification of potential polyps.

Microsoft Visual Studio 2010Customer Solution Case Study

Page 2: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

SituationMassachusetts General Hospital (MGH), a founding member of the Partners HealthCare System, offers sophisticated diagnostic and therapeutic care in virtually every specialty and subspecialty of medicine and surgery. MGH has been consistently named one of the best hospitals in the United States by U.S. News & World Report and is the oldest and largest teaching affiliate of Harvard Medical School, where nearly all the hospital’s physicians are faculty members.

Like MGH itself, the hospital’s Radiology department is world renowned. In 1999, the department established its 3-D Imaging Service. With three-dimensional (3-D) imaging, data from cross-sectional com-puterized tomography (CT) and magnetic resonance imaging (MRI) studies is run through specialized software to create lifelike 3-D images, which physicians can use to visualize a patient’s anatomy and apply that knowledge to diagnoses, treatment, and surgical planning. In the 3-D Imaging Research group at MGH, a team of researchers works to apply 3-D imaging and computer-aided diagnosis to new areas of patient care. One effort is the “virtual colonoscopy,” a noninvasive alternative to a traditional, optical colonoscopy. With the traditional procedure, which is performed by a gastroenterologist and an assisting nurse, a flexible tube with a camera on its end is passed through the anus

to examine the colon, as a means of visually diagnosing conditions such as colon cancer or the presence of pre-cancerous polyps.

Although an optical colonoscopy is an effective means of diagnosing colon cancer, it can be highly unpleasant. Patients must prepare the day before by drinking up to a gallon of a nondigestible liquid that flushes the colon of all solid matter, thereby requiring frequent visits to the toilet for several hours. Before the procedure, which takes approximately 20 minutes, the patient is given a drug intended to sedate, minimize pain during the procedure, and inhibit unpleasant memories by inducing a state of twilight amnesia. However, many people still recall the procedure and complain of significant discomfort. After the procedure, the patient must spend time recovering from the sedation before being driven home.

“More than 50,000 people die from colon cancer in the United States each year, making it the second-leading cause of cancer-related death among men and women,” says Dr. Hiro Yoshida, PhD, Director of 3-D Imaging Research at MGH and Associate Professor of Radiology at Harvard Medical School. “However, colon cancer is highly preventable if polyps are detected and removed before they turn cancerous—a process that usually takes 8 to 10 years. Unfortunately, current optical screening methods are costly and unpleasant, covering only 5 percent

214

“We now have a working, end-to-end solution capable of supporting colon cancer screening for the entire at-risk population.”

Dr. Hiro Yoshida, PhD, Director of 3-D Imaging Research at Massachusetts

General Hospital and Associate Professor of Radiology at Harvard

Medical School

Page 3: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

of the 80 million people over age 50 for whom screening is recommended. Our goal is to apply 3-D imaging and computer-aided diagnosis to enable screening for polyps in a cost-effective, streamlined, and patient-friendly manner, as a means of extending the process to the entire target population.”

With the approach pioneered at MGH, preparatory laxative cleansing of the colon is not required. Instead, the patient drinks a small amount of a neutral-taste contrast agent with food and water before coming to the hospital so that the contrast agent mixes with the solid matter in the digestive tract. At the hospital, a thin-section CT scan is performed, and the hundreds of cross-sectional images captured during the scan are processed by using computer software developed by Yoshida’s team. The software builds a 3-D volume model of the colon, and it uses the presence of the contrast agent to “erase” the solid matter from within the colon—a step in the process called “electronic cleansing.” The software also identifies suspicious shapes that may be polyps within the 3-D volume to aid radiologists in diagnosis. The final 3-D images are then reviewed by using a traditional radiology workstation.

“A year ago, we had most of the process figured out, with one major challenge remaining: the processing time required to electronically cleanse the 3-D model of the colon,” says Yoshida. “That computationally

intensive process alone took 45 minutes to complete, and it took an additional 15 minutes to load the image for viewing. To streamline clinical workflow, we had to get the entire one-hour process down to less than 5 minutes—so that the resulting 3-D image can be reviewed while the patient is still present.”

SolutionBy working with Microsoft, Intel, Vectorform, and technology consultant Dr. Joe Hummel, MGH was able to get total processing times for constructing and loading an electronically cleansed 3-D image for viewing down to just two minutes—a twenty-fold performance gain made possible by optimizing the code to take full advantage of modern multicore processors and multiprocessor servers. The joint effort also yielded improvements in other parts of the clinical workflow, such as the ability for radiologists to view the 3-D images from any location on the hospital’s network by using natural touchscreen gestures on a multitouch-enabled computer screen.

“We now have a working, end-to-end solution capable of supporting colon cancer screening for the entire at-risk population—in a manner that’s more patient friendly and a fraction of the cost of traditional screening techniques,” says Yoshida.

Cleansing the 3-D ModelThe creation of the solution began when researchers from the 3-D

314

“The next step is to deploy the solution to MGH and other hospitals for clinical use. If all goes as planned, it may be available for clinical use next year.”

Dr. Hiro Yoshida, PhD, Director of 3-D Imaging Research at Massachusetts

General Hospital and Associate Professor of Radiology at Harvard

Medical School

Page 4: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

Imaging Research group at MGH participated in a two-week engagement at the Microsoft Technology Center in Boston, Massachusetts. The original purpose of the engagement was to determine whether the performance of the algorithm for cleansing the 3-D image could be improved by adapting it to run on a 16-node high-performance computing (HPC) cluster.

At that time, the algorithm was written in native Microsoft Visual C++ code and ran on the 32-bit version of the Windows operating system. Although not explicitly designed for HPC, the application was intended to take advantage of parallel processing by creating multiple threads of execution. However, when the application was run on a 16-core server in the lab, it proved unable to fully utilize the available processing power. While some processors showed nearly 100 percent utilization at some point in time, most showed little or no activity at any given point—a pattern that indicates poor processor utilization and therefore lack of efficient parallelization.

Further analysis of the code revealed several other problem areas, such as severe I/O constraints, leading to the following set of recommendations:

Convert parts of the code to the Microsoft Visual C# programming language, as needed to fully take advantage of the parallel processing support provided in the Microsoft .NET Framework 4.

Refactor the code to improve performance and replace custom-developed functions with functionality provided natively by the .NET Framework 4.

Modify the code to run on the Windows Server 2008 R2 operating system on a 64-bit server, as needed to take advantage of a greater amount of physical memory.

Read and write from separate copies of the 3-D volume. The locking required to perform both read and write operations on the same copy of the volume was causing significant input-output delays.

Rewrite the existing libraries used to access the 3-D volumes, which had been ported from Linux and which were significantly limiting application performance.

MGH agreed with all of the recommendations, except for one: porting its code to Visual C#. The image-cleansing algorithms written in native C++ had already been validated as accurate, and doing so again would have required significant effort. In addition, only one developer in the lab was well versed in C#. Fortunately, the Microsoft Parallel Patterns Library (PPL) for native C++, which provides functionality similar to the Task Parallel Library (TPL) in the .NET Framework 4, gave MGH a viable option.

414

“A virtual colonoscopy can be performed for about one-fifth of the cost of a traditional optical procedure.”

Dr. Hiro Yoshida, PhD, Director of 3-D Imaging Research at Massachusetts

General Hospital and Associate Professor of Radiology at Harvard

Medical School

Page 5: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

“We walked MGH developers through both TPL and PPL, explaining the differences,” recalls Curt Devlin, Principal Architect Evangelist on the Developer Platform and Evangelism group at Microsoft, who worked with MGH at the Microsoft Technology Center. “PPL met their needs in terms of parallel programming functionality and was a better match with their skill set and other requirements.”Following the visit to the Microsoft Technology Center, Dr. Yin Wu, Principal Computer Scientist in the 3-D Imaging Research group at MGH, spent the next few months preparing to parallelize the code. She ported it to 64-bit, implemented separate read and write copies for the 3-D volumes, rewrote the libraries used to access the volumes, and made several other algorithmic enhancements. By the time she finished, the application was still written entirely in native C++ and delivered processing times of six to eight minutes.

To assist MGH with parallelizing its code, Microsoft enlisted the aid of consultant Joe Hummel, PhD, currently a visiting professor in the Department of Information and Computer Science at the University of California, Irvine. Intel joined the project to assist in using its Intel® Parallel Studio 2011 tool suite to optimize the parallelized code.

In parallelizing the electronic cleansing application, MGH relied upon the following PPL constructs:

parallel_for and parallel_for_each for simple data parallel loops

task_group for task parallelism and complex data parallel loops

combinable for reductions, such as computing the sum, min, or max of a collection of values

critical_section for when locking was necessary

Figure 1 shows an example of a data loop before and after parallelization. Noteworthy in the code sample is how lambda expressions—which were recently added to the new C++ language standard (often referred to as C++0x) and are fully supported by Visual C++ 2010 and the PPL—make parallelizing the loop a trivial exercise. “Lambda expressions, which are similar to anonymous methods, enable the developer to pass a code block into the PPL and have that code block executed in parallel,” says Dr. Hummel. “Other libraries such as OpenMP also support parallel for loops, but they don’t provide support for C++0x features such as lambda expressions that make it a lot easier to write parallel code.”

PPL also provided a means to parallelize loops that don’t fit the simple foreach iteration style. “In the electronic cleansing app, the primary data structure is a 3-D volume, in which a typical image may be 1,024 × 1,024 × 1,024 volumetric pixel elements—essentially a billion

514

Figure 1. Using the Parallel Patterns Library to parallelize a simple for loop.

Page 6: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

voxels,” explains Dr. Hummel. “Because multiple volumes may be in memory at the same time—at the very least, one input and one output volume are needed―the volumes are sparse, meaning that uniform blocks within them are stored as a single value and expanded when necessary. A typical loop iterates through the source volume, analyzing voxels and filling the destination volume with results.”

Figure 2 shows an example of such a loop using sequential code. It iterates through the source volume using a density mask to help identify the colon wall.Figure 3 shows the same code after parallelization. “Given the complex control structure of this loop, we used a task_group to process each block in parallel and then wait for all the blocks to finish,” explains Dr. Hummel. “Even though the outer loop has to run sequentially through the volume to spawn off tasks, the size of the blocks is large enough to hide most of this latency. This approach also has the advantage of avoiding the creation of parallel tasks for uniform blocks, of which there can be a significant number. The only tricky

part of this transformation was moving the volume iterators srcVolIter and destVolIter inside each task, as these objects maintain state and cannot be shared across parallel tasks.”

Capabilities provided in the Microsoft Visual Studio 2010 development system and Intel Parallel Studio were also helpful in parallelizing the code. “We were very productive with Visual Studio 2010, taking great advantage of IntelliSense, Visual Studio 2010 profiling tools, and multicore compilation support, which cut build times at least in half,” says Dr. Hummel. “We also took advantage of Intel Parallel Studio, which plugs into Visual Studio. In particular, we found the correctness analysis of Intel’s Parallel Inspector to be a great help, both in confirming our approach and, in one case, in identifying an unsafe parallelization. We also took advantage of Intel’s Integrated Performance Primitives (IPP) for speeding up some of the lower-level image-processing algorithms.”

614

SEQUENTIAL CODE

for (int i = 0; i < N; i++){

B[i] = computation(A[i], c);}

PARALLEL CODE

parallel_for(0, N, [&B, &A, c](int i){

B[i] = computation(A[i], c);});

Page 7: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

By parallelizing its native Visual C++ code with PPL, MGH was able to

714

task_group tg;

// for each block in source volume:for ( srcVolIter.SetPos(0, 0, 0), destVolIter.SetPos(0, 0, 0); srcVolIter.IsNotAtEnd(); srcVolIter.NextBlockZYX(), destVolIter.NextBlockZYX() ){

if (srcVolIter.GetCurrentBlock().IsUniform()) // skip this entire block:continue;

VolumePoint srcpos = srcVolIter.GetPos(), dstpos = destVolIter.GetPos();

// launch a task to process block in parallel:tg.run( [&srcVol, &destVol, srcpos, dstpos, uMask]{

BlockVolumeUInt8Iterator srcVolIter (srcVol, srcpos); BlockVolumeBoolIterator destVolIter (destVol, dstpos);

for ( ; srcVolIter.IsNotAtEndOfBlock(); srcVolIter.NextZYXInsideBlock(), destVolIter.NextZYXInsideBlock() )

{if (srcVolIter.GetVoxel() & uMask)

destVolIter.SetVoxel(true);}

});}

// wait for all parallel tasks to finish:tg.wait();

BlockVolumeUInt8Iterator srcVolIter(srcVol); // source volume iterator:BlockVolumeBoolIterator destVolIter(destVol); //destination volume iterator:

// for each block in source volume:for ( srcVolIter.SetPos(0, 0, 0), destVolIter.SetPos(0, 0, 0); srcVolIter.IsNotAtEnd(); srcVolIter.NextBlockZYX(),destVolIter.NextBlockZYX() ){

if (srcVolIter.GetCurrentBlock().IsUniform()) // skip this entire block:continue;

// consider each voxel in block and set mask appropriately:for ( ;

srcVolIter.IsNotAtEndOfBlock(); srcVolIter.NextZYXInsideBlock(),destVolIter.NextZYXInsideBlock() )

{if (srcVolIter.GetVoxel() & uMask)

destVolIter.SetVoxel(true);}

}

Figure 2. A typical sequential loop from the electronic cleansing application.

Figure 3. Using PPL to parallelize the sequential code from Figure 2.

Page 8: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

reduce processing times to two minutes on a server with several multicore processors. “By the end of the process, we didn’t even need an HPC cluster,” says Yoshida. “We were able to surpass our original performance goal by simply modifying the application to take advantage of the processing power provided by a single, modern multiprocessor server.”

Rendering and Viewing the Virtual ImageHaving reached its performance goals for cleansing the 3-D model, the team turned its attention to what could be done to improve how radiologists view the model. At the time, MGH was using software that it had written in OpenGL (Open Graphics Library). Even with that viewing software running on a powerful workstation, it took about 15 minutes to load the image and compute the centerline of the colon, which was required for navigation through the image by using a traditional keyboard and  mouse.

The team’s research led to work done by Toby Sharp and others at Microsoft Research, who had developed an innovative 3-D rendering engine. Called the 3-D GPU Volume Rendering Engine, it takes advantage of server-side rendering and uses dedicated graphics processing units (GPUs) instead of the server’s CPUs to support the visualization of 3-D data on demand and in real time, by multiple simultaneous users, with low latency even on low-bandwidth

networks and on thin-client devices. The engine can also support client-side rendering on a PC that has an appropriate graphics card. Either way, radiologists can begin viewing high-definition, diagnostic-quality images virtually immediately.

“The benefit of rendering on the server is that radiologists no longer need to be in the same place as the data, nor do they need to be tethered to an expensive 3-D workstation,” says Yoshida.

After the decision to use the rendering engine from Microsoft Research, one piece of the puzzle remained: how to enable radiologists to interact with the data in the most efficient and productive way possible. The team turned to Vectorform, a Microsoft Registered Partner, which had extensive experience with 3-D visualization—and had recently expanded its business to include a new healthcare business unit.

By using the application programming interfaces (APIs) provided for the rendering engine, Vectorform developed a custom-built virtual colonoscopy viewer capable of working on PCs and devices that run the Windows 7 operating system. The engine renders the 3-D volume data as a two-dimensional (2-D) stream in real time, with the 2-D images transmitted frame by frame to the Vectorform client in a manner similar to that of the Microsoft Remote Desktop Protocol. The Vectorform client, which supports touchscreen

814

“If we can screen the entire at-risk population for precancerous polyps and remove them before they turn malignant, we can significantly reduce the incidence of colon cancer deaths.”

Dr. Hiro Yoshida, PhD, Director of 3-D Imaging Research at Massachusetts

General Hospital and Associate Professor of Radiology at Harvard

Medical School

Page 9: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

navigation and natural user interface gestures, is written in Visual C# and is based on Windows Presentation Foundation. A future version for Windows Phone will be based on Microsoft Silverlight browser technology.

The Vectorform client works with the GPU Volume Rendering Engine to enable fly-through navigation of the 3-D volume—complete with lifelike color and lighting to help radiologists identify features inside the colon (see Figure 4). During the electronic cleansing process, the centerline of the colon is computed and saved as part of the 3-D volume. The radiologist starts by “entering” the image of the colon through the rectum, using a touch-enabled slider at the bottom of the screen to easily move forward or back along the centerline.

When the radiologist sees a point of interest, such as a potential polyp, he or she can double-tap it on the screen. This switches the virtual camera to an orbiting function, upon which the radiologist can pan right, left, up, or down to view the potential polyp from different angles. Similarly, the radiologist can pinch or stretch to zoom in or out.

Next StepsDevelopment of the proof of concept began in December 2009 and took approximately 150 days. MGH demonstrated it at Supercomputing 2010 and at the 2010 Radiological Society of North America (RSNA)

conference, where it won the Excellence in Design award. “The next step is to deploy the solution to MGH and other hospitals for clinical use. If all goes as planned, it may be available for clinical use next year,” says Yoshida.

Yoshida also describes how the individual solution components can be applied to other areas. “Each part of the solution is modular—from the 3-D image construction and cleansing algorithms to the rendering engine to the viewer,” he states. “We can adapt the work we’ve done to support image-based screening such as lung and breast cancer screening, time-critical quantitative imaging such as pneumothoraces volumetry for emergency trauma care, image-guidance for interventional proce-dures such as radiofrequency ablation and thrombolysis, and so on.”

914

Figure 4. By using the virtual colonoscopy viewer developed by Vectorform, radiologists can use touchscreen navigation to navigate a 3-D model of a patient’s colon.

Page 10: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

Yoshida’s team is now exploring running the compute-intensive cleansing engine in the cloud, on the Windows Azure platform, as a means of making it readily available to hospitals across the United States. The team also plans to explore running the solution on Windows HPC Server 2008 R2 to further improve performance. Finally, the team is looking at the Microsoft HealthVault healthcare website technology to store cleansed 3-D volume models, as a way to make that data portable for patients—and available to consulting caregivers who do not have access to the system in which a hospital stores its radiology images.

“The move to multi-machine will allow us to achieve runtimes of less than 30 seconds, for which we’re exploring a variety of approaches that include MPI [Messaging Passing Interface] and Windows Server AppFabric,” says Dr. Hummel, who is now working with MGH on next steps. “Windows Azure

has the potential to bring virtual colonoscopy to a much wider audience, but also presents a number of new issues that we’re just starting to consider—such as data transfer, security considerations, and virtual machine size in terms of the number of cores and amount of RAM.”BenefitsThrough its work with Microsoft, Intel, Vectorform, and Dr. Joe Hummel, MGH overcame the last obstacles that it faced in building a solution capable of supporting colon cancer screening for the entire target population. Not only does the lab’s current solution improve the speed with which patients can be screened, but it does so while drastically reducing costs. The approach pioneered by MGH is also more patient friendly, eliminating the extensive preparation, sedation, and risk of complications associated with an optical colonoscopy. The solution is also more convenient for radiologists, who are no longer bound to an expensive, 3-D workstation for viewing the 3-D images. And it provides an opportunity for improved diagnostic accuracy through the application of software designed to detect suspicious shapes and tissue densities within the data.

“The virtual colonoscopy in itself is not new—it’s been around for more than 10 years—but it still required traditional methods of laxative cleansing of the colon prior to a CT

1014

“Being able to use the Microsoft Parallel Patterns Library to parallelize our native Visual C++ code was key to our success, as it enabled us to take advantage of our existing skill set and avoid rewriting algorithms we’ve already invested significant effort in validating.”

Dr. Yin Wu, Principal Computer Scientist,

3-D Imaging Research at Massachusetts General Hospital

Page 11: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

scan,” says Yoshida. “The virtual, laxative-free cleansing part is what’s new and, through our work with Microsoft and others, we’ve been able to achieve the image preparation times required to streamline clinical workflow. With the speed issues now addressed, we’re ready to take the next steps toward extending the screening process to the entire population for whom such screening is recommended.”

Rapid Parallelization of Native C++ CodeBy working with Microsoft, Intel, and Dr. Joe Hummel, MGH was able to optimize its code for parallel processing—leading to a 2,000 percent performance gain on a four-core server with 12 gigabytes of RAM. Improvements to the electronic cleansing step reduced the time required from 45 minutes to 2 minutes, and use of the 3-D GPU Volume Rendering Engine from Microsoft Research reduced the 15 minutes required to begin rendering the cleansed 3-D image to just a few seconds.

Just as impressive, MGH was able to achieve all this within a 150-day window. ”Being able to use the Microsoft Parallel Patterns Library to parallelize our native Visual C++ code was key to our success, as it enabled us to take advantage of our existing skill set and avoid rewriting algo-rithms we’ve already invested significant effort in validating,” says Wu. “A lot of credit also goes to Dr. Hummel, who was immensely helpful

in helping us get started with—and get the most out of—the parallel programming aids provided by Microsoft.”

Adds Dr. Hummel, “The effort required just to parallelize the code was less than 30 days. At most, it required changing only a few hundred lines out of roughly 10,000.”

Streamlined Clinical WorkflowGiven that a CT scan takes only a few minutes to perform, two-minute image preparation times will enable the data capture, image preparation, and review of the 3-D images all to occur within the duration of a standard patient appointment. “It’s important for clinical workflow that the results can be interpreted while the patient is still present, as needed to give patients immediate peace of mind that everything looks normal—or, if an issue is detected, to schedule an appoint for the removal of polyps or to capture another scan for presurgical evaluation and planning,” says Yoshida.

Improved Patient Convenience and SafetyThrough the approach pioneered by MGH, patient convenience and safety are significantly improved over the traditional, optical colonoscopy. Unpleasant advance flushing of the colon with laxatives is eliminated, no sedation is required, no discomfort is involved, postprocedure recovery in the hospital is no longer necessary, and no ride home is needed. The virtual approach also avoids the

1114

Page 12: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

potential complications of an optical colonoscopy, which can range from a bad drug reaction to perforation of the colon, which, although rare, often requires immediate surgical treatment.

“An optical colonoscopy interrupts a patient’s life for two days,” says Yoshida. “Our virtual colonoscopy approach can be completed in as little as 30 minutes, with minimal inconvenience, risk, or discomfort to the patient before, during, or after the procedure.”

Cost Reduced by 80 PercentAccording to Yoshida, a virtual colonoscopy may practically cost only about one-fifth the cost of an optical colonoscopy, which typically costs between U.S.$2,000 and $5,000, including the cost of sedation provided by an anesthesiologist. In contrast, up until the images are ready for review by a radiologist, the entire virtual colonoscopy process can be managed by a radiology technician.

“A virtual colonoscopy can be performed for about one-fifth of the cost of a traditional optical procedure,” says Yoshida. “The patient simply comes in, lies on the CT scanner, and the data is captured in 20 seconds. With our latest technology, the results are ready for interpretation a couple of minutes

later. Unlike with an optical colonoscopy, there’s no need for sedative drugs, sterile equipment, a gastroenterologist to conduct the exam, a hospital bed for the patient to recover, or a wheelchair ride to the front door of the hospital.”

Greater Convenience for RadiologistsMGH has also improved convenience for radiologists by incorporating the 3-D GPU Volume Rendering Engine and Vectorform virtual colonoscopy viewer into its solution, which eliminates the need for a high-end radiology workstation for image interpretation—and the need to wait 15 minutes for images to load. Instead, images are rendered virtually immediately, and because the processing required to render the 3-D volume as 2-D image frames is done on the server, the images can be viewed on any device running Windows 7.

“The rendering engine and viewer work very similarly to how Terminal Services in Windows Server works—a technology that’s already used in many hospitals,” says Patrick Samona, Director of the new healthcare business unit at Vectorform. “Frames are rendered on the server and sent to the client for display, and the touch inputs for navigation are transmitted in the other direction. The solution performs

1214

Page 13: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

beautifully over a traditional wired or wireless network.”

Improved Diagnostic AccuracyWith a complete 3-D model of the colon and the flexibility provided by the Vectorform viewer, radiologists can easily view areas that would be difficult to see with a traditional colonoscopy, such as a hidden polyp. In addition, Yoshida is already working to introduce other work being done by the 3-D Imaging Research group into the solution—namely, his ongoing research in computer-aided diagnosis, which would provide a “second set of eyes” for radiologists reviewing the 3-D images through software-based detection and flagging of suspicious shapes and tissue densities.

“With all the data that’s captured in the 3-D image, we can apply computer-aided diagnosis to locate, characterize, and flag potential polyps,” says Yoshida. “For example, polyps are typically cap shaped; the colon’s haustral folds are ridge shaped; and the colon wall is typically cup, rut, or saddle shaped. By identifying these shapes with software, we can flag suspicious areas, with the final diagnostic decision to be made by the radiologists.”

Fewer Colon Cancer DeathsWith its fast and cost-effective approach to colon cancer screening, MGH is making it possible to screen all the at-risk population for colon cancer—or, more accurately, for precancerous polyps. “Colorectal cancers are highly preventable, as the majority develop slowly from benign adenomas, with an average dwell time—the time it takes to turn cancerous—of 8 to 10 years,” explains Yoshida. “The objective of screening is to find and remove these polyps when they’re small, because less than 1 percent of polyps that are less than 5 millimeters in size harbor malignancy. If we can screen the entire at-risk population for precancerous polyps and remove them before they turn malignant, we can significantly reduce the incidence of colon cancer deaths.”

Microsoft Visual Studio 2010

1314

For More InformationFor more information about Microsoft products and services, call the Microsoft Sales Information Center at (800) 426-9400. In Canada, call the Microsoft Canada Information Centre at (877) 568-2495. Customers in the United States and Canada who are deaf or hard-of-hearing can reach Microsoft text telephone (TTY/TDD) services at (800) 892-5234. Outside the 50 United States and Canada, please contact your local Microsoft subsidiary. To access information using the World Wide Web, go to:www.microsoft.com

For more information about Intel Corporation, visit the website at: www.intel.com

For more information about Vectorform, visit the website at:www.vectorform.com For more information about Dr. Joe Hummel, visit the website at:www.joehummel.net

For more information about Massachusetts General Hospital, visit the website at:www.massgeneral.org

This case study is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.

Page 14: Metia VS 2010 Parallelization of Native C++ Code Reduces ...download.microsoft.com/.../Files/4000010935/MGHPPLca…  · Web viewParallelization of Native C++ Code Helps Reduce 3

Microsoft Visual Studio 2010 is an integrated development system that helps simplify the entire development process from design to deployment. Unleash your creativity with powerful prototyping, modeling, and design tools that help you bring your vision to life. Work within a personalized environment that helps accelerate the coding process and supports the use of your existing skills, and target a growing number of platforms, including Microsoft SharePoint Server 2010 and cloud services. Also, work more efficiently thanks to integrated testing and debugging tools that you can use to find and fix bugs quickly and easily to help ensure high-quality solutions.

For more information about Visual Studio 2010, go to www.msdn.microsoft.com/vstudio

1414

Software and Services Microsoft Server Product Portfolio

− Windows Server 2008 R2 Enterprise

Windows 7 Microsoft Visual Studio

− Microsoft Visual Studio 2010 Technologies

− 3-D GPU Volume Rendering Engine (Microsoft Research)

− Microsoft .NET Framework 4− Microsoft Visual C++− Windows Presentation

Third-Party Software− Intel Parallel Studio 2011

Partners Intel Vectorform Joe Hummel, PhD (independent

consultant)