Hi!<br><br><span id="result_box" class="short_text" lang="en"><span class="hps">I'm working on</span> <span class="hps">a Windows port of code</span></span> which was written under Linux and OS X, and I have strange problem with vtkImageViewer2, under Windows it shows only a black screen.<br>
<br>All data are loaded from raw file and mapped by vtkImageData<br><br><br>vtkSmartPointer< vtkImageData > CaseDataImage::GetVTKImage()<br>{ <br> if(image || ReadFromCache()) {<br> m_ReferenceCount++;<br> <br>
m_ToVTK->SetWholeExtent( 0, image->row_size - 1, 0, image->col_size - 1, 0, image->depth_size - 1 );<br> m_ToVTK->SetDataExtentToWholeExtent();<br> <br> if(GetDataType() == VFF_TYP_1_BYTE ) {<br>
<br> m_ToVTK->SetDataScalarTypeToUnsignedChar();<br> <br> } else if (GetDataType() == VFF_TYP_2_BYTE ) {<br> <br> m_ToVTK->SetDataScalarTypeToUnsignedShort();<br> }<br> m_ToVTK->SetNumberOfScalarComponents( 1 );<br>
m_ToVTK->SetImportVoidPointer( image->image_data );<br> m_ToVTK->Update();<br> <br> return m_ToVTK->GetOutput();<br> <br> } else {<br> <br> return NULL;<br> }<br>}<br><br>And vtkImageViewer2:<br>
<br>m_MainViewer = vtkSmartPointer< vtkImageViewer2 >::New();<br>m_MainViewer->SetInput( MagazinClass::imageData->GetVTKImage() );<br>m_MainViewer->SetColorLevel( -200.0 + MagazinClass::imageData->GetShiftToPositive() );<br>
m_MainViewer->SetColorWindow( 500.0 );<br>m_MainViewer->SetRenderWindow( vtkData2DMainSlice->GetRenderWindow() );<br>m_MainViewer->SetupInteractor( vtkData2DMainSlice->GetRenderWindow()->GetInteractor() );<br>
m_MainViewer->SetSliceOrientation( axis );<br>m_MainViewer->SetSlice( slice );<br><br>Strange because under Linux and OS X everything works great.<br><br><br><br>