# How to use "vtkMedicalImageProperties.h" functions in visual studio with QT C++

**URL:** https://discourse.vtk.org/t/how-to-use-vtkmedicalimageproperties-h-functions-in-visual-studio-with-qt-c/9597
**Category:** Support
**Tags:** code
**Created:** [October 13, 2022, 1:11pm UTC](https://discourse.vtk.org/t/how-to-use-vtkmedicalimageproperties-h-functions-in-visual-studio-with-qt-c/9597 "2022-10-13T13:11:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![a0980543469](https://discourse.vtk.org/user_avatar/discourse.vtk.org/a0980543469/32/5910_2.png) [@a0980543469](https://discourse.vtk.org/u/a0980543469)
#### Post date: [October 13, 2022, 1:11pm UTC](https://discourse.vtk.org/t/how-to-use-vtkmedicalimageproperties-h-functions-in-visual-studio-with-qt-c/9597/1 "2022-10-13T13:11:39Z")

</div>

Hello everybody,  
I would like to use “vtkMedicalImageProperties.h” functions to get the information of DICOM, but have no idea to use the function.  
Is there any example or format that I can understand how to make it working.

For example:  
How to get patient name?  
below is the part of code from “vtkMedicalImageProperties.h”

class VTKIOIMAGE\_EXPORT vtkMedicalImageProperties : public vtkObject  
{  
public:  
static vtkMedicalImageProperties\* New();  
vtkTypeMacro(vtkMedicalImageProperties, vtkObject);  
void PrintSelf(ostream& os, vtkIndent indent) override;  
/\*\*

- Convenience method to reset all fields to an empty string/value  
\*/  
virtual void Clear();

///@{  
/\*\*

- Patient name
- For ex: DICOM (0010,0010) = DOE,JOHN  
\*/  
vtkSetStringMacro(PatientName);  
vtkGetStringMacro(PatientName);  
///@}  
…  
}

Thanks

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [October 15, 2022, 2:43am UTC](https://discourse.vtk.org/t/how-to-use-vtkmedicalimageproperties-h-functions-in-visual-studio-with-qt-c/9597/2 "2022-10-15T02:43:32Z")

</div>

I would recommend to use [vtk-dicom](http://dgobbi.github.io/vtk-dicom/). It works much better than the old DICOM classes in VTK core.

---

<div class="post-metadata">

### Author: ![a0980543469](https://discourse.vtk.org/user_avatar/discourse.vtk.org/a0980543469/32/5910_2.png) [@a0980543469](https://discourse.vtk.org/u/a0980543469)
#### Post date: [October 15, 2022, 7:20am UTC](https://discourse.vtk.org/t/how-to-use-vtkmedicalimageproperties-h-functions-in-visual-studio-with-qt-c/9597/3 "2022-10-15T07:20:15Z")

</div>

Thank you, I will try it.

---

<div class="post-metadata">

### Author: ![a0980543469](https://discourse.vtk.org/user_avatar/discourse.vtk.org/a0980543469/32/5910_2.png) [@a0980543469](https://discourse.vtk.org/u/a0980543469)
#### Post date: [October 15, 2022, 3:43pm UTC](https://discourse.vtk.org/t/how-to-use-vtkmedicalimageproperties-h-functions-in-visual-studio-with-qt-c/9597/4 "2022-10-15T15:43:25Z")

</div>

Sorry about that, I still cannot understand how to use vtk-dicom to show the information of DICOM, I also read the exampes.  
What the function seems like?  
Thanks  
I type like below.

```auto
vtkSmartPointer<vtkDICOMReader> reader = vtkSmartPointer<vtkDICOMReader>::New();
	reader->UpdateInformation();
	vtkDICOMMetaData *meta = reader->GetMetaData();
	vtkDICOMValue vw = meta->Get(DC::WindowWidth);
	ui->labelManufacturer->setText(vw.AsString);

```

or like this

```auto
vtkSmartPointer<vtkDICOMReader> metaReader = vtkSmartPointer<vtkDICOMReader>::New();
	metaReader->UpdateInformation();
	vtkDICOMMetaData *meta = metaReader->GetMetaData();
	ui->labelManufacturer->setText(QString::fromStdString(meta->GetAttributeValue(DC::Manufacturer).AsString()));

```
