# How to volume rendering raw file what was wrrite by C++ stl;

**URL:** https://discourse.vtk.org/t/how-to-volume-rendering-raw-file-what-was-wrrite-by-c-stl/10669
**Category:** Development
**Tags:** doxygen, code, proposal
**Created:** [February 14, 2023, 9:08am UTC](https://discourse.vtk.org/t/how-to-volume-rendering-raw-file-what-was-wrrite-by-c-stl/10669 "2023-02-14T09:08:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![wulicheng](https://discourse.vtk.org/user_avatar/discourse.vtk.org/wulicheng/32/1990_2.png) [@wulicheng](https://discourse.vtk.org/u/wulicheng)
#### Post date: [February 14, 2023, 9:08am UTC](https://discourse.vtk.org/t/how-to-volume-rendering-raw-file-what-was-wrrite-by-c-stl/10669/1 "2023-02-14T09:08:16Z")

</div>

I was write a raw file liking this:

```auto
unsigned long FileSize = 0;//height * width * slices;
const Uint16* FileData = new Uint16(FileSize);
metaInfo->findAndGetUint16Array(DCM_PixelData, FileData, &FileSize);
//_strFileName a raw file name like xxx.raw
std::fstream myFileStream(_strFileName.c_str(), std::ios::binary | std::ios::out);
if (myFileStream.is_open())
{
	myFileStream.write((char*)FileData, FileSize * sizeof(Uint16));

}
myFileStream.close();
delete FileData;

```

Now I want to read the raw data and rendering it . How should i do ? any suggistions.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [February 14, 2023, 10:22pm UTC](https://discourse.vtk.org/t/how-to-volume-rendering-raw-file-what-was-wrrite-by-c-stl/10669/2 "2023-02-14T22:22:43Z")

</div>

Hello,

Can you please enclose your code between a ```cpp and a ```? This way you make it way more readable.

best,

Paulo
