From c74c7098e31ec54ac50aa2aff5dc1c21bc4179c8 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Thu, 18 Feb 2016 10:09:38 +0100 Subject: [PATCH] Debug --contour while opening --- vv/vvMainWindow.cxx | 2 +- vv/vvMesh.cxx | 18 +++--------------- vv/vvMeshActor.cxx | 1 + vv/vvMeshReader.cxx | 7 ------- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 45f848a..1b6eb60 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -469,7 +469,7 @@ void vvMainWindow::AddContour(int image_index, vvMesh::Pointer contour, bool pro brush.setColor(QColor(contour->r*255,contour->g*255,contour->b*255)); brush.setStyle(Qt::SolidPattern); item->setData(COLUMN_IMAGE_NAME,Qt::BackgroundRole,brush); - // item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,contour->structure_name.c_str()); + item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,contour->structure_name.c_str()); for (int j = 1; j <= 4; j++) item->setData(j,Qt::CheckStateRole,DataTree->topLevelItem(image_index)->data(j,Qt::CheckStateRole)); diff --git a/vv/vvMesh.cxx b/vv/vvMesh.cxx index e7045f5..15be4a4 100644 --- a/vv/vvMesh.cxx +++ b/vv/vvMesh.cxx @@ -138,6 +138,7 @@ void vvMesh::ComputeMasks(vtkImageData* sample,bool extrude) vtkSmartPointer binary_image=vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 binary_image->SetScalarTypeToUnsignedChar(); +#endif ///Use the smallest mask in which the mesh fits // Add two voxels on each side to make sure the mesh fits double * samp_origin=sample->GetOrigin(); @@ -152,22 +153,9 @@ void vvMesh::ComputeMasks(vtkImageData* sample,bool extrude) binary_image->SetExtent(0,ceil((bounds[1]-origin[0])/spacing[0]+4), 0,ceil((bounds[3]-origin[1])/spacing[1]+4), 0,ceil((bounds[5]-origin[2])/spacing[2])+4); +#if VTK_MAJOR_VERSION <= 5 binary_image->AllocateScalars(); #else - ///Use the smallest mask in which the mesh fits - // Add two voxels on each side to make sure the mesh fits - double * samp_origin=sample->GetOrigin(); - double * spacing=sample->GetSpacing(); - binary_image->SetSpacing(spacing); - - /// Put the origin on a voxel to avoid small skips - binary_image->SetOrigin(floor((bounds[0]-samp_origin[0])/spacing[0]-2)*spacing[0]+samp_origin[0], - floor((bounds[2]-samp_origin[1])/spacing[1]-2)*spacing[1]+samp_origin[1], - floor((bounds[4]-samp_origin[2])/spacing[2]-2)*spacing[2]+samp_origin[2]); - double * origin=binary_image->GetOrigin(); - binary_image->SetExtent(0,ceil((bounds[1]-origin[0])/spacing[0]+4), - 0,ceil((bounds[3]-origin[1])/spacing[1]+4), - 0,ceil((bounds[5]-origin[2])/spacing[2])+4); binary_image->AllocateScalars(VTK_UNSIGNED_CHAR, 1); #endif memset(binary_image->GetScalarPointer(),0,binary_image->GetDimensions()[0]*binary_image->GetDimensions()[1]*binary_image->GetDimensions()[2]*sizeof(unsigned char)); @@ -206,7 +194,7 @@ void vvMesh::ComputeMasks(vtkImageData* sample,bool extrude) stencil->SetStencil(sts->GetOutput()); stencil->SetInput(binary_image); #else - stencil->SetStencilData(sts->GetOutput()); + stencil->SetStencilConnection(sts->GetOutputPort()); stencil->SetInputData(binary_image); #endif stencil->Update(); diff --git a/vv/vvMeshActor.cxx b/vv/vvMeshActor.cxx index d8741aa..1d6f19b 100644 --- a/vv/vvMeshActor.cxx +++ b/vv/vvMeshActor.cxx @@ -77,6 +77,7 @@ void vvMeshActor::Init(vvMesh::Pointer mesh,int time_slice,vvImage::Pointer vf) mActor->GetProperty()->EdgeVisibilityOn(); mActor->GetProperty()->SetEdgeColor(mMesh->r,mMesh->g,mMesh->b); mActor->GetProperty()->SetLineWidth(2.); + mActor->GetProperty()->SetOpacity(0.995); //in order to get VTK to turn on the alpha-blending in OpenGL } void vvMeshActor::SetCutSlice(double slice) diff --git a/vv/vvMeshReader.cxx b/vv/vvMeshReader.cxx index 75afc69..0feabf3 100644 --- a/vv/vvMeshReader.cxx +++ b/vv/vvMeshReader.cxx @@ -224,13 +224,6 @@ std::vector vvMeshReader::readSelectedContours() { std::vector result; #if GDCM_MAJOR_VERSION == 2 - -#if CLITK_USE_SYSTEM_GDCM == 0 - - clitkExceptionMacro("ERROR ! You need to compile vv with itk4 + system_gdcm to use this function"); - -#endif - gdcm::Reader reader; reader.SetFileName(filename.c_str()); reader.Read(); -- 2.45.1