<div xmlns="http://www.w3.org/1999/xhtml"><div>Good afternoon.</div><div> </div><div>I try to create own program for visualization a series of slices from tiff format files. For development I use a bunch of Qt and VTK. I successfully managed to load data, which I checked on the values of individual pixels. However, when rendering, there is a problem with incorrect display. It feels like it displays only abrupt changes in brightness and fixes this border. No filters to the source data is not applied. Can someone help to understand the problem? I attach a part of the code and the source image and the result of the visualization (I render only 1 layer). Thank you for your answer.</div><div> </div><div><nabble_img src="source.png" border="0" alt="Source image"/></div><div><nabble_img src="result.png" border="0" alt="result of visualization"/></div><div> </div><div> </div><div>my code (I lowered part of loading images ):</div><div> </div><div>vtkNew<vtkRenderer> ren;</div><div>vtkNew<vtkVolume>v;</div><div>vtkNew<vtkGenericOpenGLRenderWindow> renderWindow;</div><div>vtkNew<vtkImageData> volume;</div><div>vtkNew<vtkAVIWriter> writer;</div><div>vtkNew<vtkWindowToImageFilter> windowToImageFilter;</div><div> </div><div>ui->VisWidget->SetRenderWindow(renderWindow);</div><div> </div><div>vtkNew<vtkUnsignedShortArray> ar;</div><div>ar->SetNumberOfValues(CountOfSliceInFolder*image_height*image_width); //  image_height =  image_width = 2000;</div><div> </div><div>QString tmp, res;</div><div>int z = 0;</div><div> </div><div>for(uint k = firstSliceNum; k < /*CountOfSliceInFolder +*/1+ firstSliceNum; k++) // try to load only one slice</div><div>{</div><div>    tmp = QString::number(k) + ".tif";</div><div>    while (tmp.length() < 8 )</div><div>    {</div><div>        tmp.push_front("0");</div><div>    }</div><div>    tmp = "s__rec" + tmp;</div><div>    res = ImageNames + tmp;</div><div> </div><div>    QByteArray ba = res.toLocal8Bit();</div><div>    const char *c_str2 = ba.data();</div><div> </div><div>    temp = tiff->openFile(c_str2, &wt, &ht);</div><div> </div><div>    if(temp == NULL)</div><div>    {</div><div>        qDebug() << "Ошибка набора данных";</div><div>        return;</div><div>    }</div><div> </div><div>    for (uint i = 0; i < image_height; i++)</div><div>    {</div><div>        for (uint j = 0; j < image_width; j++)</div><div>        {</div><div>            ar->InsertValue(z, temp[image_width*i+j]);</div><div>            z++;</div><div>        }</div><div>    }</div><div>}</div><div>    </div><div>volume->AllocateScalars(VTK_UNSIGNED_SHORT, 1);</div><div>volume->SetOrigin(0,0,0);</div><div>volume->SetExtent(0, image_width - 1, 0, image_height - 1, 0, /*CountOfSliceInFolder-*/1);</div><div>volume->SetSpacing(1,1,1);</div><div>volume->GetPointData()->SetScalars(ar);</div><div> </div><div>tkNew<vtkGPUVolumeRayCastMapper> volumeMapper;</div><div>volumeMapper->SetInputData(volume);</div><div>volumeMapper->AutoAdjustSampleDistancesOff();</div><div>volumeMapper->SetSampleDistance(0.1);</div><div> </div><div>v->SetMapper(volumeMapper);</div><div> </div><div>ren->AddViewProp(v);</div><div> </div><div>vtkCamera *camera = ren->GetActiveCamera();</div><div>double *c = v->GetCenter();</div><div>camera->SetViewUp(0, 0, -1);</div><div>camera->SetPosition(c[0] - 100, c[1] - 400, c[2] - 100);</div><div>camera->SetFocalPoint(c[0], c[1], c[2]);</div><div>camera->ComputeViewPlaneNormal();</div><div>camera->Azimuth(30.0);</div><div>camera->Elevation(30.0);</div><div> </div><div>ren->SetBackground(.3, .3, .3);</div><div> </div><div>ui->VisWidget->GetRenderWindow()->AddRenderer(ren);</div><div>    </div></div>