]> Creatis software - clitk.git/commitdiff
Debug --contour while opening
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 18 Feb 2016 09:09:38 +0000 (10:09 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 18 Feb 2016 09:09:38 +0000 (10:09 +0100)
vv/vvMainWindow.cxx
vv/vvMesh.cxx
vv/vvMeshActor.cxx
vv/vvMeshReader.cxx

index 45f848a5e19144af25b08af1311ab3caaac9ddc4..1b6eb607b847090655541490ae68defcd1938f39 100644 (file)
@@ -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));
index e7045f58d84a19889f0f8abd97a4698587b237bb..15be4a4bedc7e0696bd13ac0aa4441f66989eef7 100644 (file)
@@ -138,6 +138,7 @@ void vvMesh::ComputeMasks(vtkImageData* sample,bool extrude)
     vtkSmartPointer<vtkImageData> binary_image=vtkSmartPointer<vtkImageData>::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();
index d8741aa5448cbc1e5cff6b5b4962267d3df0ba6d..1d6f19b2465cf680439c19a440b890c4cd96f4b2 100644 (file)
@@ -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)
index 75afc697748c1677316d434ac4beb700efb47a3c..0feabf3fac5dc8123b5c12b4f468ebf2c97432bd 100644 (file)
@@ -224,13 +224,6 @@ std::vector<vvMesh::Pointer> vvMeshReader::readSelectedContours()
 {
   std::vector<vvMesh::Pointer> 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();