# How to show a DICOM image with ITK and Visual Studio?

**URL:** https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347
**Category:** Community
**Created:** [October 11, 2018, 4:08pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347 "2018-10-11T16:08:00Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Armando](https://discourse.itk.org/user_avatar/discourse.itk.org/armando/32/449_2.png) [@Armando](https://discourse.itk.org/u/Armando)
#### Post date: [October 11, 2018, 4:08pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347/1 "2018-10-11T16:08:00Z")

</div>

Hi.

I am learning to use ITK with visual studio. My question is: How can I, once I have read a DICOM file, be able to show it or load it in a PictureBox (System.Windows.Forms.PictureBox) component of Visual Studio?

Thanks any help.

---

<div class="post-metadata">

### Author: ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)
#### Post date: [October 11, 2018, 4:18pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347/2 "2018-10-11T16:18:24Z")

</div>

Hi Armando,  
the question is more about visualization rather than image reading or analysis, so you may want to see the resources provided by [VTK](https://www.vtk.org/) for visualization purposes.

It is quite a long time since I have not used the .NET framework, so I cannot tell much about it. Unless you are constrained by some requirements, using VTK as a means to display your images will save you a lot of time.

Finally, VTK is multi-platform, so you are not necessarily tied to MSVC.

HTH.

---

<div class="post-metadata">

### Author: ![Armando](https://discourse.itk.org/user_avatar/discourse.itk.org/armando/32/449_2.png) [@Armando](https://discourse.itk.org/u/Armando)
#### Post date: [October 11, 2018, 4:34pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347/3 "2018-10-11T16:34:53Z")

</div>

Hello, Jon Haitz Legarreta Gorroño.

Thank you very much for your reply. The project for which I am working needs to register multimodal images (CT and MRI) for stereotactic surgery planning, for this reason I use ITK. At the same time I need to visualize the images. As a beginner, I do not know if only with ITK I can solve everything I want. Personally I feel more comfortable using C ++ Builder, but it is currently not possible to compile ITK for Embarcadero C ++ Builder 10.2.3, for this reason I use Visual Studio, but if you have a suggestion to give based on your experience I will thank you very much.

Thanks again.

---

<div class="post-metadata">

### Author: ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)
#### Post date: [October 11, 2018, 4:59pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347/4 "2018-10-11T16:59:05Z")

</div>

Hi Armando,  
using MSVC is not a restriction to use VTK. VTK can be built for macOS, Linux and Windows platforms using a whole set of compilers, including MSVC.

For your problem, ITK will certainly be of help for the the registration process, but as said, you may want to try VTK for visualization.

The documentation is extensive. You would be amazed to know how powerful it is.

HTH.

---

<div class="post-metadata">

### Author: ![Armando](https://discourse.itk.org/user_avatar/discourse.itk.org/armando/32/449_2.png) [@Armando](https://discourse.itk.org/u/Armando)
#### Post date: [October 11, 2018, 5:07pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347/5 "2018-10-11T17:07:04Z")

</div>

Hi Jon.

I am now compiling VTK with MSVC.  
Is it possible to compile VTK with Embarcadero C ++ Builder 10.2.3? I’ve tried but it gives some me errors when I Configure. Any suggestions?

Thanks for your help.

---

<div class="post-metadata">

### Author: ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)
#### Post date: [October 11, 2018, 5:11pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347/6 "2018-10-11T17:11:53Z")

</div>

> [@Armando](#):
>
> Is it possible to compile VTK with Embarcadero C ++ Builder 10.2.3? I’ve tried but it gives some me errors when I Configure. Any suggestions?

You should ask to the VTK folks:  
[https://www.vtk.org/mailing-lists/](https://www.vtk.org/mailing-lists/)

I use MSVC for both ITK and VTK. If you get errors, they will certainly be happy to fix them and have VTK built in an even larger set of compilers.

---

<div class="post-metadata">

### Author: ![rasoul](https://discourse.itk.org/user_avatar/discourse.itk.org/rasoul/32/325_2.png) [@rasoul](https://discourse.itk.org/u/rasoul)
#### Post date: [October 11, 2018, 6:33pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347/7 "2018-10-11T18:33:19Z")

</div>

Hi @Armando,  
A suggestion could be making a bridge between itk and opencv. Then you can easilly see your images by several tools in that library.

---

<div class="post-metadata">

### Author: ![Armando](https://discourse.itk.org/user_avatar/discourse.itk.org/armando/32/449_2.png) [@Armando](https://discourse.itk.org/u/Armando)
#### Post date: [October 11, 2018, 6:35pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347/8 "2018-10-11T18:35:41Z")

</div>

Hi, rasoul.

Thanks for the idea.

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [October 11, 2018, 6:51pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347/9 "2018-10-11T18:51:05Z")

</div>

To add to the suggestions of @jhlegarreta and @Armando

- @phcerdan has added a nice default VTK-based image visualization to the _ITKVTKGlue_ module, which can help you get started. See:

- A bridge with OpenCV exists:

---

<div class="post-metadata">

### Author: ![Armando](https://discourse.itk.org/user_avatar/discourse.itk.org/armando/32/449_2.png) [@Armando](https://discourse.itk.org/u/Armando)
#### Post date: [October 11, 2018, 7:06pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347/10 "2018-10-11T19:06:31Z")

</div>

Hello Matt.

Thank you very much.  
I am viewing the post right now.

Regards.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.itk.org/user_avatar/discourse.itk.org/lassoan/32/27_2.png) [@lassoan](https://discourse.itk.org/u/lassoan)
#### Post date: [October 12, 2018, 10:06pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347/11 "2018-10-12T22:06:39Z")

</div>

I would recommend to build on an existing open-source application framework instead of redeveloping all basic infrastructure again.

For medical applications, you can use [3D Slicer](https://www.slicer.org) (that I’m one of the core developers of). Slicer uses ITK for image I/O and processing, VTK for visualization, and Qt for GUI. It already has all the features that you may need for stereotactic surgery planning and guidance, such as DICOM import, rich multimodality image and tool visualization, intensity-based multimodality image registration, patient registration, tool calibration, automatic stereotactic frame registration. All comes with open-source, restriction-free (BSD-type) license. It is used clinically (under IRB approval) for many procedures. It is used in several commercial products - you can apply your own branding, style sheet, etc. and use simplified, application-specific user interface.

If you have any questions you can post it on [Slicer forum](https://discourse.slicer.org).

---

<div class="post-metadata">

### Author: ![Armando](https://discourse.itk.org/user_avatar/discourse.itk.org/armando/32/449_2.png) [@Armando](https://discourse.itk.org/u/Armando)
#### Post date: [November 2, 2018, 5:25pm UTC](https://discourse.itk.org/t/how-to-show-a-dicom-image-with-itk-and-visual-studio/1347/12 "2018-11-02T17:25:42Z")

</div>

Hi Andras.

First of all, thank you very much for the information and advice. I very appreciate your help.  
I have been offline some days. I would like to be able to consult you about the project that I am developing and keep in touch with you. I’m catching up with 3D Slicer.

Best regards,  
Armando
