# import 3D volume from itk to vtk

**URL:** https://discourse.itk.org/t/import-3d-volume-from-itk-to-vtk/1673
**Category:** Beginner Questions
**Created:** [March 15, 2019, 5:11pm UTC](https://discourse.itk.org/t/import-3d-volume-from-itk-to-vtk/1673 "2019-03-15T17:11:14Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)
#### Post date: [March 15, 2019, 6:30pm UTC](https://discourse.itk.org/t/import-3d-volume-from-itk-to-vtk/1673/4 "2019-03-15T18:30:09Z")

</div>

ITK in the module ITKVtkGlue provides a simple viewer for 2D and 3D ITK images using VTK.

Read more about it and see examples in this ITK discourse post: [Display 3D image using ITK and VTK](https://discourse.itk.org/t/display-3d-image-using-itk-and-vtk/897/10)

See an example here: [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Bridge/VtkGlue/test/runViewImage.cxx](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Bridge/VtkGlue/test/runViewImage.cxx)

and the MWE would be:

```auto
#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkViewImage.h"
int main(int argc, char *argv[])
{
  using PixelType = float;
  constexpr unsigned int Dimension = 3;
  using ImageType = itk::Image<PixelType, Dimension>;
  using ReaderType = itk::ImageFileReader<ImageType>;
  auto reader = ReaderType::New();
  reader->SetFileName("MR-head.nrrd");
  reader->Update();
  itk::ViewImage<ImageType>::View(reader->GetOutput());
}

```

![MR-headVIEW](https://discourse.itk.org/uploads/default/original/1X/0a7b44a5ec79d2340f4d92bbdd7e401095e4c6ed.gif)

Hope it helps

---

_[View the full topic](https://discourse.itk.org/t/import-3d-volume-from-itk-to-vtk/1673)._
