From minaninina1 at gmail.com Fri Apr 1 05:27:13 2016 From: minaninina1 at gmail.com (aria dob) Date: Fri, 1 Apr 2016 02:27:13 -0700 (MST) Subject: [vtkusers] collision detection Message-ID: <1459502833568-5737477.post@n5.nabble.com> Hi; How can we detect collision between two actors in the scene using VTK? that's with vtk obbtree i guess but i didn't khnow how we can extract the Points from the modele to do the test of collision can someone help me to do that please Thanks -- View this message in context: http://vtk.1045678.n5.nabble.com/collision-detection-tp5737477.html Sent from the VTK - Users mailing list archive at Nabble.com. From AlexUtrobin at yandex.ru Fri Apr 1 07:16:48 2016 From: AlexUtrobin at yandex.ru (AlexUtrobin) Date: Fri, 1 Apr 2016 04:16:48 -0700 (MST) Subject: [vtkusers] vtkPlotting and vtkTable Message-ID: <1459509408521-5737478.post@n5.nabble.com> I use Java VTK. I am trying to repeat the example of http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/ScatterPlot But vtkTable class does not contain a method setValue (table-> SetValue (i, 0, i + 1);). Please, help me. -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkPlotting-and-vtkTable-tp5737478.html Sent from the VTK - Users mailing list archive at Nabble.com. From rogertrullo at hotmail.com Fri Apr 1 07:40:37 2016 From: rogertrullo at hotmail.com (rogertrullo) Date: Fri, 1 Apr 2016 04:40:37 -0700 (MST) Subject: [vtkusers] How to get a fixed number of vertices after decimation in VTK In-Reply-To: <1459437913322-5737463.post@n5.nabble.com> References: <1458832734304-5737349.post@n5.nabble.com> <1459437913322-5737463.post@n5.nabble.com> Message-ID: <1459510837509-5737479.post@n5.nabble.com> Thanks, I have tried with the option 1, however sometimes it gives me surfaces with 1 or 2 vertex difference. The problem is that I have a set of meshes and I need them to have the same *exact* number of vertices. About the option 2, I am not very familiar with this function, but if it mask some points, how does it deal with the connection between them? Thanks for your help! -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-a-fixed-number-of-vertices-after-decimation-in-VTK-tp5737349p5737479.html Sent from the VTK - Users mailing list archive at Nabble.com. From jan.hirsch at st.ovgu.de Fri Apr 1 08:44:06 2016 From: jan.hirsch at st.ovgu.de (jhirsch) Date: Fri, 1 Apr 2016 05:44:06 -0700 (MST) Subject: [vtkusers] How to get a fixed number of vertices after decimation in VTK In-Reply-To: <1459510837509-5737479.post@n5.nabble.com> References: <1458832734304-5737349.post@n5.nabble.com> <1459437913322-5737463.post@n5.nabble.com> <1459510837509-5737479.post@n5.nabble.com> Message-ID: <1459514646794-5737480.post@n5.nabble.com> Hello, I've also experienced the same effect with the decimationPro algorithm, that it is not possible to determine the exact number of points. I guess that's an inherent property of the process... And with the second option, we are in the same situation. ;) As far as I know, the conncetion between the points is lost. You got only a point cloud, maybe with the scalar information attachted to it. My next step is to make this point cloud a mesh again...maybe vtkMarchingCubes can do that. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-a-fixed-number-of-vertices-after-decimation-in-VTK-tp5737349p5737480.html Sent from the VTK - Users mailing list archive at Nabble.com. From richard.j.brown at live.co.uk Fri Apr 1 08:52:26 2016 From: richard.j.brown at live.co.uk (mbcx9rb9) Date: Fri, 1 Apr 2016 05:52:26 -0700 (MST) Subject: [vtkusers] vtkDICOMReader and vtkGDCMImageReader orientation Message-ID: <1459515146888-5737481.post@n5.nabble.com> Hi all, I'm having some troubles with orientation and location of my DICOMs when loaded with vtkDICOMReader and vtkGDCMImageReader. To illustrate my problems, I opened the same files with both the readers and performed marching cubes on them to display 3D surfaces. I also displayed an annotated orientation cube to allow me to compare these surfaces with Slicer3D (which I'm assuming correctly calculates orientation etc.). In the ideal world, the 3D surfaces should superpose perfectly, but this is not the case. My pipeline for reading DICOMs with vtkGDCMImageReader is: gdcm::IPPSorter <-- Calculates the proper z-spacing vtkGDCMImageReader vtkImageChangeInfromation <-- Applies the corrected z-spacing that was calculated by IPPSorter My pipeline for reading DICOMs with vtkDICOMReader is simply: vtkDICOMReader and then actor->SetUserMatrix(reader->GetPatientMatrix()) My problem is that the 3D structures are not in the same position nor the same orientation. Furthermore, one might agree with Slicer3D for one image but not for the next... I guess my main question is - What is the correct way to systematically open DICOM files (using either vtkDICOMReader or vtkGDCMImageReader, I'm not fussy)? Below are two images, one of a human skull and one of a pig skull (chosen at random). Each time, the red is rendered from vtkGDCMImageReader, the black is rendered from vtkDICOMReader (turns black when I use SetUserMatrix, not sure why...) and the last is from Slicer3D. With the human skull, we see that vtkGDCMImageReader agrees with slicer, whereas vtkDICOMReader is upside-down (Superior-Inferior reflection). However for the pig, vtkGDCMImageReader is upside-down (Superior-Inferior reflection) (PLUS something funny has happened to the spacing), whereas vtkDICOMReader is facing the anterior direction as opposed to the superior direction. Below is the code I have used for both. Any pointers on the correct way to consistently read DICOM images correctly would be appreciated. Regards, Richard P.S. A very important question - is my vtkAnnotatedCubeActor correctly annotated? If not, the comparison between my 3D structures and Slicer3D is useless until this is corrected... #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main() { // -------------------------------------------------------------------------------------------- // // // Get filenames // // -------------------------------------------------------------------------------------------- // // Get all DCM files in directory vtkSmartPointer filenames = vtkSmartPointer::New(); QDirIterator iterator("/Scan/Directory/", QStringList("*.dcm"), QDir::Files, QDirIterator::Subdirectories); while (iterator.hasNext()) { filenames->InsertNextValue(iterator.next().toUtf8().data()); } // Sort vtkSmartPointer sorter = vtkSmartPointer ::New(); sorter->SetInputFileNames(filenames); sorter->Update(); // Get most numerous series int numSeries = sorter->GetNumberOfSeries(); int mostNumerousSeriesIndex = 0; for (int i=0; iGetFileNamesForSeries(i)->GetNumberOfValues() > sorter->GetFileNamesForSeries(mostNumerousSeriesIndex)->GetNumberOfValues()) { mostNumerousSeriesIndex = i; } } vtkStringArray *seriesFilenames = sorter->GetFileNamesForSeries(mostNumerousSeriesIndex); // -------------------------------------------------------------------------------------------- // // // Setup renderer etc. // // -------------------------------------------------------------------------------------------- // vtkSmartPointer renderer = vtkSmartPointer::New(); renderer->SetGradientBackground(1); renderer->SetBackground(.5,.5,.5); renderer->SetBackground2(0,0,0); vtkSmartPointer renWin = vtkSmartPointer::New(); renWin->AddRenderer(renderer); renWin->SetSize(1000,1000); vtkSmartPointer interactorStyle = vtkSmartPointer::New(); vtkSmartPointer renWinInt = vtkSmartPointer::New(); renWinInt->SetRenderWindow(renWin); renWinInt->SetInteractorStyle(interactorStyle); // -------------------------------------------------------------------------------------------- // // // vtkGDCMImageReader // // -------------------------------------------------------------------------------------------- // // need to convert from vtkStringArray to std::vector to be able to sort... std::vector seriesFilenames_stdVector; for (int i=0; iGetNumberOfValues(); i++) { seriesFilenames_stdVector.push_back(seriesFilenames->GetValue(i).c_str()); } // sort and get z-spacing gdcm::IPPSorter IPPs; IPPs.SetComputeZSpacing(true); IPPs.SetZSpacingTolerance(1e-3); IPPs.Sort(seriesFilenames_stdVector); // Convert the sorted std::vector back to vtkStringArray to be able to use with vtkGDCMImageReader... vtkSmartPointer seriesFilenames_vtkStringArray_sorted = vtkSmartPointer::New(); for (size_t i=0; iInsertNextValue(IPPs.GetFilenames().at(i)); } // GDCM reader vtkSmartPointer gdcmReader = vtkSmartPointer::New(); gdcmReader->SetFileNames(seriesFilenames_vtkStringArray_sorted); gdcmReader->FileLowerLeftOn(); // correct z-spacing vtkSmartPointer changeInfo = vtkSmartPointer::New(); changeInfo->SetInputConnection(gdcmReader->GetOutputPort()); changeInfo->SetOutputSpacing(gdcmReader->GetOutput()->GetSpacing()[0], gdcmReader->GetOutput()->GetSpacing()[1], IPPs.GetZSpacing()); changeInfo->Update(); // Marching cubes vtkSmartPointer gdcmMC = vtkSmartPointer::New(); gdcmMC->SetInputConnection(changeInfo->GetOutputPort()); gdcmMC->SetNumberOfContours(1); gdcmMC->GenerateValues(1,700.,3000.); vtkSmartPointer gdcmNormals = vtkSmartPointer::New(); gdcmNormals->SetInputConnection(gdcmMC->GetOutputPort()); gdcmNormals->SetFeatureAngle(60.0); vtkSmartPointer gdcmStripper = vtkSmartPointer::New(); gdcmStripper->SetInputConnection(gdcmNormals->GetOutputPort()); vtkSmartPointer gdcmMapper = vtkSmartPointer::New(); gdcmMapper->SetInputConnection(gdcmStripper->GetOutputPort()); gdcmMapper->ScalarVisibilityOff(); gdcmMapper->Update(); vtkSmartPointer gdcmActor = vtkSmartPointer::New(); gdcmActor->SetMapper(gdcmMapper); gdcmActor->GetProperty()->SetColor(1.0,0.0,0.0); gdcmActor->GetProperty()->SetOpacity(1.); renderer->AddActor(gdcmActor); // -------------------------------------------------------------------------------------------- // // // vtkDICOMReader // // -------------------------------------------------------------------------------------------- // // DCM reader vtkSmartPointer dcmReader = vtkSmartPointer::New(); dcmReader->SetFileNames(seriesFilenames); dcmReader->Update(); // Marching cubes vtkSmartPointer dcmMC = vtkSmartPointer::New(); dcmMC->SetInputConnection(dcmReader->GetOutputPort()); dcmMC->SetNumberOfContours(1); dcmMC->GenerateValues(1,700.,3000.); vtkSmartPointer dcmNormals = vtkSmartPointer::New(); dcmNormals->SetInputConnection(dcmMC->GetOutputPort()); dcmNormals->SetFeatureAngle(60.0); vtkSmartPointer dcmStripper = vtkSmartPointer::New(); dcmStripper->SetInputConnection(dcmNormals->GetOutputPort()); vtkSmartPointer dcmMapper = vtkSmartPointer::New(); dcmMapper->SetInputConnection(dcmStripper->GetOutputPort()); dcmMapper->ScalarVisibilityOff(); dcmMapper->Update(); vtkSmartPointer dcmActor = vtkSmartPointer::New(); dcmActor->SetUserMatrix(dcmReader->GetPatientMatrix()); dcmActor->SetMapper(dcmMapper); dcmActor->GetProperty()->SetColor(0.0,1.0,0.0); dcmActor->GetProperty()->SetOpacity(1.); renderer->AddActor(dcmActor); // -------------------------------------------------------------------------------------------- // // // Orientation cube // // -------------------------------------------------------------------------------------------- // vtkSmartPointer annotatedCubeActor = vtkSmartPointer::New(); annotatedCubeActor->SetXPlusFaceText ("L (+X)"); annotatedCubeActor->SetXMinusFaceText("R (-X)"); annotatedCubeActor->SetYPlusFaceText ("P (+Y)"); annotatedCubeActor->SetYMinusFaceText("A (-Y)"); annotatedCubeActor->SetZPlusFaceText ("S (+Z)"); annotatedCubeActor->SetZMinusFaceText("I (-Z)"); annotatedCubeActor->SetZFaceTextRotation(90); annotatedCubeActor->GetCubeProperty()->SetColor(0.5, 1.0, 1.0); annotatedCubeActor->GetTextEdgesProperty()->SetLineWidth(1.0); annotatedCubeActor->GetTextEdgesProperty()->SetDiffuse(0.0); annotatedCubeActor->GetTextEdgesProperty()->SetAmbient(1.0); annotatedCubeActor->GetTextEdgesProperty()->SetColor(0.18, 0.28, 0.23); annotatedCubeActor->SetFaceTextScale(0.2); annotatedCubeActor->GetXPlusFaceProperty()->SetColor(0.0,0.0,1.0); annotatedCubeActor->GetXPlusFaceProperty()->SetInterpolationToFlat(); annotatedCubeActor->GetXMinusFaceProperty()->SetColor(0.0,0.0,1.0); annotatedCubeActor->GetXMinusFaceProperty()->SetInterpolationToFlat(); annotatedCubeActor->GetYPlusFaceProperty()->SetColor(0.0,1.0,0.0); annotatedCubeActor->GetYPlusFaceProperty()->SetInterpolationToFlat(); annotatedCubeActor->GetYMinusFaceProperty()->SetColor(0.0,1.0,0.0); annotatedCubeActor->GetYMinusFaceProperty()->SetInterpolationToFlat(); annotatedCubeActor->GetZPlusFaceProperty()->SetColor(1.0,0.0,0.0); annotatedCubeActor->GetZPlusFaceProperty()->SetInterpolationToFlat(); annotatedCubeActor->GetZMinusFaceProperty()->SetColor(1.0,0.0,0.0); annotatedCubeActor->GetZMinusFaceProperty()->SetInterpolationToFlat(); vtkSmartPointer widget = vtkSmartPointer::New(); widget->SetOutlineColor( 0.9300, 0.5700, 0.1300 ); widget->SetOrientationMarker( annotatedCubeActor ); widget->SetInteractor( renWinInt ); widget->SetViewport( 0.0, 0.0, 0.2, 0.2 ); widget->SetEnabled( 1 ); widget->InteractiveOn(); // -------------------------------------------------------------------------------------------- // // // Render // // -------------------------------------------------------------------------------------------- // renderer->ResetCamera(); renWin->Render(); renWinInt->Start(); return 0; } -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkDICOMReader-and-vtkGDCMImageReader-orientation-tp5737481.html Sent from the VTK - Users mailing list archive at Nabble.com. From rogertrullo at hotmail.com Fri Apr 1 09:24:05 2016 From: rogertrullo at hotmail.com (rogertrullo) Date: Fri, 1 Apr 2016 06:24:05 -0700 (MST) Subject: [vtkusers] How to get a fixed number of vertices after decimation in VTK In-Reply-To: <1459514646794-5737480.post@n5.nabble.com> References: <1458832734304-5737349.post@n5.nabble.com> <1459437913322-5737463.post@n5.nabble.com> <1459510837509-5737479.post@n5.nabble.com> <1459514646794-5737480.post@n5.nabble.com> Message-ID: <1459517045256-5737482.post@n5.nabble.com> Thanks, I figured out that openflipper uses openmesh, and in there I can set the desired number of vertices and so far it has worked. The problem is that I am using python and sometimes my program crashes due to this library... -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-a-fixed-number-of-vertices-after-decimation-in-VTK-tp5737349p5737482.html Sent from the VTK - Users mailing list archive at Nabble.com. From tjlp at netease.com Fri Apr 1 10:31:02 2016 From: tjlp at netease.com (Liu_tj) Date: Fri, 1 Apr 2016 22:31:02 +0800 (CST) Subject: [vtkusers] vtkImageMapToColors doesn't work on vtkImageViewer2 Message-ID: <4540f9ce.18.153d23c06a3.Coremail.tjlp@netease.com> Hi, VTK guys, I use vtkImageViewer2 to display DICOM series. Now I want to display special color for some grayscale threshold. But it doesn't work. Any steps do I miss? Below is my C# code. Segament_Threshold is a defined class including two members: Min_Threshold and Max_Threshold. private void GrayToColors( Segament_Threshold threshold) { m_scalarrange = new double[2]; m_scalarrange = m_imageViewer.GetInput().GetScalarRange(); vtkLookupTable lookupTable = vtkLookupTable.New(); double validmin = System.Math.Max(m_scalarrange[0], threshold.Min_Threshold); double validmax = System.Math.Min(m_scalarrange[1], threshold.Max_Threshold); int number = (int)(m_scalarrange[1] - m_scalarrange[0] + 1); lookupTable.SetRange(m_scalarrange[0], m_scalarrange[1]); lookupTable.SetNumberOfTableValues(number); lookupTable.Build(); for (int i = (int)(m_scalarrange[0]); i < (int)(validmin); i++) { lookupTable.SetTableValue(i - (int)m_scalarrange[0], 0.0, 0.0, 0.0, 0.0); } for (int i = (int)(validmin); i <= (int)(validmax); i++) { lookupTable.SetTableValue(i - (int)m_scalarrange[0], 0x66 / 0xff, 1.0, 1.0, 1.0); } for (int i = (int)(threshold.Max_Threshold) + 1; i < (int)(m_scalarrange[1]); i++) { lookupTable.SetTableValue(i - (int)m_scalarrange[0], 0.0, 0.0, 0.0, 0.0); } vtkImageMapToColors colormapper = vtkImageMapToColors.New(); colormapper.SetInputData(m_imageViewer.GetInput()); colormapper.SetOutputFormatToRGB(); colormapper.PassAlphaToOutputOn(); colormapper.SetLookupTable(lookupTable); colormapper.Update(); if (m_colormapActor == null) { m_colormapActor = vtkImageActor.New(); m_colormapActor.GetMapper().SetInputConnection(colormapper.GetOutputPort()); m_renderer.AddActor(m_colormapActor); } m_renderer.ResetCamera(); m_renderer.Modified(); m_imageViewer.SetRenderer(m_renderer); m_imageViewer.Render(); } Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From minaninina1 at gmail.com Fri Apr 1 13:42:42 2016 From: minaninina1 at gmail.com (aria dob) Date: Fri, 1 Apr 2016 10:42:42 -0700 (MST) Subject: [vtkusers] contol model by kyboard Message-ID: <1459532562682-5737486.post@n5.nabble.com> hello, please i need help i'am looking for a way to controle my modele or my actor generate by vtk by the keyboard not by the mouse ? thank's aria -- View this message in context: http://vtk.1045678.n5.nabble.com/contol-model-by-kyboard-tp5737486.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Fri Apr 1 15:41:45 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 1 Apr 2016 13:41:45 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: <5dbf1bff.19.153c7c5347a.Coremail.tjlp@netease.com> References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <4dcc7abb.5.153abbc4a00.Coremail.tjlp@netease.com> <5dbf1bff.19.153c7c5347a.Coremail.tjlp@netease.com> Message-ID: Hi Liu, For a volume of that size, I'd guess an STL file size of around 150MB for a smooth surface, so 520MB for a "rough" surface seems reasonable. As I mentioned in my previous email, if vtkDecimatePro is running out of memory, you can try reducing the resolution of the image before running marching cubes. - David On Wed, Mar 30, 2016 at 7:45 AM, Liu_tj wrote: > Hi, David, > > I follow your advice and use the original vtkImageData for > vtkMarchingCubes, and the isovalue is 1000. Then I try to save the > generated 3D volume to stl file. For a 512*512*190 chest CT DICOM series, > the STL file is about 520M. Do you think the file size is rather bigger? > > Thanks. > Liu Peng > > ?2016-03-25?"Liu_tj" ??? > > -----????----- > *???:*"Liu_tj" > *????:*2016?03?25? ??? > *???:*"David Gobbi" > > *??:*"vtkusers" > *??:*Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model > generation from DICOM series > > Hi, David, > > Continue this thread. For the 3D model generation, we have a preview > function. That means we need quick 3D model generation speed and don't need > high model precision. Only when really generating, we need a good 3D model > quality. So, for the preview, how to accelerate the generation speed? > > Thanks > Liu Peng > > > > ?2016-03-17?"David Gobbi" ??? > > -----????----- > *???:*"David Gobbi" > *????:*2016?03?17? ??? > *???:*"Liu_tj" > *??:*"vtkusers" > *??:*Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model > generation from DICOM series > > Hi Liu Peng, > > The vtkMarchingCubes algorithm is for greyscale images. Using > vtkImageThreshold before vtkMarchingCubes will give a poor result, because > the algorithm won't be able to properly interpolate the voxels to find the > best surface if it is given a binary image. > > When you call SetValue(0, isovalue), make sure that "isovalue" is set to > the value that corresponds to the desired isosurface. If you don't know > what value to use, you can start at 1000, then try 250, then 125, etc. > until you get a reasonable result. But the best way to choose a value is > to use Otsu's method or something similar. > > - David > > > On Wed, Mar 16, 2016 at 7:42 PM, Liu_tj wrote: > >> Hi, VTK guys, >> >> I use VTK 7.0 to generate 3D model from DICOM series. I just follow the >> code example from >> >> http://www.vtk.org/pipermail/vtkusers/2013-November/082109.html . When I try to reduce the number of triangles by vtkDecimatePro, the Visual Studio 2015 monitor shows that the memory jump to over 10G and my computer has no response, I have to restart my computer rudely. See my code below, with my DICOM series, the marched->GetNumberOfPoints() return more than 20 millions: >> >> vtkSmartPointer surface = vtkSmartPointer::New(); >> surface->SetInputData(volume); >> surface->ComputeNormalsOn(); >> surface->ComputeScalarsOn(); >> surface->SetValue(0, 1); >> >> // Create polydata from iso-surface >> vtkSmartPointer marched = vtkSmartPointer::New(); >> surface->Update(); >> marched->DeepCopy(surface->GetOutput()); >> std::cout<<"Number of points: " << marched->GetNumberOfPoints() << std::endl; >> >> // Decimation to reduce the number of triangles >> vtkSmartPointer decimator = vtkDecimatePro::New(); >> decimator->SetInputData(marched); >> decimator->SetTargetReduction(0.5); >> decimator->SetPreserveTopology(1); >> decimator->Update(); <------------------memory cost jumps to more than 10G. >> >> Any suggestions to decrease the memory cost? I only know that using vtkImageThreshold. >> Thanks, >> >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Apr 1 16:32:03 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 1 Apr 2016 14:32:03 -0600 Subject: [vtkusers] vtkDICOMReader and vtkGDCMImageReader orientation In-Reply-To: <1459515146888-5737481.post@n5.nabble.com> References: <1459515146888-5737481.post@n5.nabble.com> Message-ID: Hi Richard, I'm only going to touch on one part of your email now... hopefully I'll be able to address some of the other points later. You cannot generate the correct 3D surface from the image data alone. The DICOM images are oriented images, which means that, if you want to know where things are, you need not only the image data, but also "orientation" and "position" information for the images. And of course you are already familiar with this... so let's jump ahead to what you actually need to _do_ in order to generate the correct surface. For the vtkDICOMReader, it should be easy: 1) read the image (obviously!) 2) call the GetPatientMatrix() method to get position/orientation info 3) run marching cubes on the image to get a surface 4) correct the surface by using vtkTransformPolyDataFilter to apply the aforementioned PatientMatrix to the surface These same basic steps can be used with any of the DICOM readers, but of course each reader is slightly different and the devil is in the details. For example, here are some tricky details for vtkDICOMReader (and it is the least "tricky" of the three readers, IMHO): 1) If you look at the orientation returned by vtkDICOMReader::GetPatientMatrix() and compare it to the DICOM file metadata, you will notice that it is different! This is because the vtkDICOMReader (like other VTK readers) rasterizes its output from bottom to top, to historically match the glDrawPixels function. Since native DICOM is rasterized top-to-bottom, this requires a vertical flip of the orientation matrix. For this reason, I strongly recommend that anyone using vtkDICOMReader in a "serious" application call the SetMemoryRowOrderToFileNative() method, which will cause the reader to rasterize the data from top-to-bottom and will cause the matrix returned by GetPatientMatrix() to exactly match the original DICOM meta data. 2) The vtkDICOMReader always uses IPP sorting for a volumetric series, unless you specifically call SortingOff(), in which case it uses the order of the files. I do not recommend calling SortingOff(). Relying on IPP is best. 3) For isosurfaces, note that RescaleIntercept/RescaleSlope can vary from slice-to-slice in CT and PET. For such images, I wrote a filter called vtkDICOMApplyRescale that can be applied to the data immediately after the reader (but please read the doxygen docs for this filter before using it). 4) An even more pernicious problem for CTs is that, if the scan is done with a tilted gantry, the resulting series does not form a rectangular "volume". For such images, the vtkDICOMCTRectifier can resample the data so that it can be properly used within VTK. Hopefully this info will be of some help. Let me know if you want clarification on any of the above points. Cheers, - David On Fri, Apr 1, 2016 at 6:52 AM, mbcx9rb9 wrote: > Hi all, > > I'm having some troubles with orientation and location of my DICOMs when > loaded with vtkDICOMReader and vtkGDCMImageReader. > > To illustrate my problems, I opened the same files with both the readers > and > performed marching cubes on them to display 3D surfaces. I also displayed > an > annotated orientation cube to allow me to compare these surfaces with > Slicer3D (which I'm assuming correctly calculates orientation etc.). > > In the ideal world, the 3D surfaces should superpose perfectly, but this is > not the case. > > My pipeline for reading DICOMs with vtkGDCMImageReader is: > gdcm::IPPSorter <-- Calculates the proper > z-spacing > vtkGDCMImageReader > vtkImageChangeInfromation <-- Applies the corrected z-spacing > that > was calculated by IPPSorter > > My pipeline for reading DICOMs with vtkDICOMReader is simply: > vtkDICOMReader > and then actor->SetUserMatrix(reader->GetPatientMatrix()) > > My problem is that the 3D structures are not in the same position nor the > same orientation. Furthermore, one might agree with Slicer3D for one image > but not for the next... > > I guess my main question is - What is the correct way to systematically > open > DICOM files (using either vtkDICOMReader or vtkGDCMImageReader, I'm not > fussy)? > > Below are two images, one of a human skull and one of a pig skull (chosen > at > random). Each time, the red is rendered from vtkGDCMImageReader, the black > is rendered from vtkDICOMReader (turns black when I use SetUserMatrix, not > sure why...) and the last is from Slicer3D. > > With the human skull, we see that vtkGDCMImageReader agrees with slicer, > whereas vtkDICOMReader is upside-down (Superior-Inferior reflection). > However for the pig, vtkGDCMImageReader is upside-down (Superior-Inferior > reflection) (PLUS something funny has happened to the spacing), whereas > vtkDICOMReader is facing the anterior direction as opposed to the superior > direction. > > < > http://vtk.1045678.n5.nabble.com/file/n5737481/Screen_Shot_2016-04-01_at_12.png > > > < > http://vtk.1045678.n5.nabble.com/file/n5737481/Screen_Shot_2016-04-01_at_14.png > > > > Below is the code I have used for both. Any pointers on the correct way to > consistently read DICOM images correctly would be appreciated. > > Regards, > Richard > > P.S. A very important question - is my vtkAnnotatedCubeActor correctly > annotated? If not, the comparison between my 3D structures and Slicer3D is > useless until this is corrected... > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > #include > #include > > #include > #include > > int main() > { > > // > > -------------------------------------------------------------------------------------------- > // > // > // Get filenames > // > // > > -------------------------------------------------------------------------------------------- > // > > // Get all DCM files in directory > vtkSmartPointer filenames = > vtkSmartPointer::New(); > QDirIterator iterator("/Scan/Directory/", > QStringList("*.dcm"), QDir::Files, > QDirIterator::Subdirectories); > while (iterator.hasNext()) { > filenames->InsertNextValue(iterator.next().toUtf8().data()); > } > > // Sort > vtkSmartPointer sorter = vtkSmartPointer > ::New(); > sorter->SetInputFileNames(filenames); > sorter->Update(); > > // Get most numerous series > int numSeries = sorter->GetNumberOfSeries(); > int mostNumerousSeriesIndex = 0; > > for (int i=0; i if (sorter->GetFileNamesForSeries(i)->GetNumberOfValues() > > > sorter->GetFileNamesForSeries(mostNumerousSeriesIndex)->GetNumberOfValues()) > { > mostNumerousSeriesIndex = i; > } > } > > vtkStringArray *seriesFilenames = > sorter->GetFileNamesForSeries(mostNumerousSeriesIndex); > > // > > -------------------------------------------------------------------------------------------- > // > // > // Setup renderer etc. > // > // > > -------------------------------------------------------------------------------------------- > // > > vtkSmartPointer renderer = > vtkSmartPointer::New(); > renderer->SetGradientBackground(1); > renderer->SetBackground(.5,.5,.5); > renderer->SetBackground2(0,0,0); > > vtkSmartPointer renWin = > vtkSmartPointer::New(); > renWin->AddRenderer(renderer); > renWin->SetSize(1000,1000); > > vtkSmartPointer interactorStyle = > vtkSmartPointer::New(); > > vtkSmartPointer renWinInt = > vtkSmartPointer::New(); > renWinInt->SetRenderWindow(renWin); > renWinInt->SetInteractorStyle(interactorStyle); > > > // > > -------------------------------------------------------------------------------------------- > // > // > // vtkGDCMImageReader > // > // > > -------------------------------------------------------------------------------------------- > // > > // need to convert from vtkStringArray to std::vector to > be > able to sort... > std::vector seriesFilenames_stdVector; > for (int i=0; iGetNumberOfValues(); i++) { > > seriesFilenames_stdVector.push_back(seriesFilenames->GetValue(i).c_str()); > } > > // sort and get z-spacing > gdcm::IPPSorter IPPs; > IPPs.SetComputeZSpacing(true); > IPPs.SetZSpacingTolerance(1e-3); > IPPs.Sort(seriesFilenames_stdVector); > > // Convert the sorted std::vector back to vtkStringArray to be able to > use with vtkGDCMImageReader... > vtkSmartPointer seriesFilenames_vtkStringArray_sorted = > vtkSmartPointer::New(); > for (size_t i=0; i > > seriesFilenames_vtkStringArray_sorted->InsertNextValue(IPPs.GetFilenames().at(i)); > } > > // GDCM reader > vtkSmartPointer gdcmReader = > vtkSmartPointer::New(); > gdcmReader->SetFileNames(seriesFilenames_vtkStringArray_sorted); > gdcmReader->FileLowerLeftOn(); > > // correct z-spacing > vtkSmartPointer changeInfo = > vtkSmartPointer::New(); > changeInfo->SetInputConnection(gdcmReader->GetOutputPort()); > changeInfo->SetOutputSpacing(gdcmReader->GetOutput()->GetSpacing()[0], > gdcmReader->GetOutput()->GetSpacing()[1], IPPs.GetZSpacing()); > changeInfo->Update(); > > // Marching cubes > vtkSmartPointer gdcmMC = > vtkSmartPointer::New(); > gdcmMC->SetInputConnection(changeInfo->GetOutputPort()); > gdcmMC->SetNumberOfContours(1); > gdcmMC->GenerateValues(1,700.,3000.); > > vtkSmartPointer gdcmNormals = > vtkSmartPointer::New(); > gdcmNormals->SetInputConnection(gdcmMC->GetOutputPort()); > gdcmNormals->SetFeatureAngle(60.0); > > vtkSmartPointer gdcmStripper = > vtkSmartPointer::New(); > gdcmStripper->SetInputConnection(gdcmNormals->GetOutputPort()); > > vtkSmartPointer gdcmMapper = > vtkSmartPointer::New(); > gdcmMapper->SetInputConnection(gdcmStripper->GetOutputPort()); > gdcmMapper->ScalarVisibilityOff(); > gdcmMapper->Update(); > > vtkSmartPointer gdcmActor = vtkSmartPointer::New(); > gdcmActor->SetMapper(gdcmMapper); > gdcmActor->GetProperty()->SetColor(1.0,0.0,0.0); > gdcmActor->GetProperty()->SetOpacity(1.); > > renderer->AddActor(gdcmActor); > > > // > > -------------------------------------------------------------------------------------------- > // > // > // vtkDICOMReader > // > // > > -------------------------------------------------------------------------------------------- > // > > // DCM reader > vtkSmartPointer dcmReader = > vtkSmartPointer::New(); > dcmReader->SetFileNames(seriesFilenames); > dcmReader->Update(); > > // Marching cubes > vtkSmartPointer dcmMC = > vtkSmartPointer::New(); > dcmMC->SetInputConnection(dcmReader->GetOutputPort()); > dcmMC->SetNumberOfContours(1); > dcmMC->GenerateValues(1,700.,3000.); > > vtkSmartPointer dcmNormals = > vtkSmartPointer::New(); > dcmNormals->SetInputConnection(dcmMC->GetOutputPort()); > dcmNormals->SetFeatureAngle(60.0); > > vtkSmartPointer dcmStripper = > vtkSmartPointer::New(); > dcmStripper->SetInputConnection(dcmNormals->GetOutputPort()); > > vtkSmartPointer dcmMapper = > vtkSmartPointer::New(); > dcmMapper->SetInputConnection(dcmStripper->GetOutputPort()); > dcmMapper->ScalarVisibilityOff(); > dcmMapper->Update(); > > vtkSmartPointer dcmActor = vtkSmartPointer::New(); > dcmActor->SetUserMatrix(dcmReader->GetPatientMatrix()); > dcmActor->SetMapper(dcmMapper); > dcmActor->GetProperty()->SetColor(0.0,1.0,0.0); > dcmActor->GetProperty()->SetOpacity(1.); > > renderer->AddActor(dcmActor); > > // > > -------------------------------------------------------------------------------------------- > // > // > // Orientation cube > // > // > > -------------------------------------------------------------------------------------------- > // > > vtkSmartPointer annotatedCubeActor = > vtkSmartPointer::New(); > annotatedCubeActor->SetXPlusFaceText ("L (+X)"); > annotatedCubeActor->SetXMinusFaceText("R (-X)"); > annotatedCubeActor->SetYPlusFaceText ("P (+Y)"); > annotatedCubeActor->SetYMinusFaceText("A (-Y)"); > annotatedCubeActor->SetZPlusFaceText ("S (+Z)"); > annotatedCubeActor->SetZMinusFaceText("I (-Z)"); > annotatedCubeActor->SetZFaceTextRotation(90); > annotatedCubeActor->GetCubeProperty()->SetColor(0.5, 1.0, 1.0); > annotatedCubeActor->GetTextEdgesProperty()->SetLineWidth(1.0); > annotatedCubeActor->GetTextEdgesProperty()->SetDiffuse(0.0); > annotatedCubeActor->GetTextEdgesProperty()->SetAmbient(1.0); > annotatedCubeActor->GetTextEdgesProperty()->SetColor(0.18, 0.28, 0.23); > annotatedCubeActor->SetFaceTextScale(0.2); > > annotatedCubeActor->GetXPlusFaceProperty()->SetColor(0.0,0.0,1.0); > annotatedCubeActor->GetXPlusFaceProperty()->SetInterpolationToFlat(); > annotatedCubeActor->GetXMinusFaceProperty()->SetColor(0.0,0.0,1.0); > annotatedCubeActor->GetXMinusFaceProperty()->SetInterpolationToFlat(); > > annotatedCubeActor->GetYPlusFaceProperty()->SetColor(0.0,1.0,0.0); > annotatedCubeActor->GetYPlusFaceProperty()->SetInterpolationToFlat(); > annotatedCubeActor->GetYMinusFaceProperty()->SetColor(0.0,1.0,0.0); > annotatedCubeActor->GetYMinusFaceProperty()->SetInterpolationToFlat(); > > annotatedCubeActor->GetZPlusFaceProperty()->SetColor(1.0,0.0,0.0); > annotatedCubeActor->GetZPlusFaceProperty()->SetInterpolationToFlat(); > annotatedCubeActor->GetZMinusFaceProperty()->SetColor(1.0,0.0,0.0); > annotatedCubeActor->GetZMinusFaceProperty()->SetInterpolationToFlat(); > > vtkSmartPointer widget = > vtkSmartPointer::New(); > widget->SetOutlineColor( 0.9300, 0.5700, 0.1300 ); > widget->SetOrientationMarker( annotatedCubeActor ); > widget->SetInteractor( renWinInt ); > widget->SetViewport( 0.0, 0.0, 0.2, 0.2 ); > widget->SetEnabled( 1 ); > widget->InteractiveOn(); > > // > > -------------------------------------------------------------------------------------------- > // > // > // Render > // > // > > -------------------------------------------------------------------------------------------- > // > > renderer->ResetCamera(); > renWin->Render(); > renWinInt->Start(); > return 0; > } > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Sat Apr 2 00:00:04 2016 From: tjlp at netease.com (Liu_tj) Date: Sat, 2 Apr 2016 12:00:04 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <4dcc7abb.5.153abbc4a00.Coremail.tjlp@netease.com> <5dbf1bff.19.153c7c5347a.Coremail.tjlp@netease.com> Message-ID: <7123efb.3.153d520b75e.Coremail.tjlp@netease.com> Hi, David, According to my understanding, smooth surface should have greater size than "rough" size, is my understanding wong? For the DICOM series of 512*512*190, if I shrink to 128*128*190, the generated 3D volume has worse quality than the one I don't shrink. Thanks Liu Peng ?2016-04-02?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?04?2? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series Hi Liu, For a volume of that size, I'd guess an STL file size of around 150MB for a smooth surface, so 520MB for a "rough" surface seems reasonable. As I mentioned in my previous email, if vtkDecimatePro is running out of memory, you can try reducing the resolution of the image before running marching cubes. - David On Wed, Mar 30, 2016 at 7:45 AM, Liu_tj wrote: Hi, David, I follow your advice and use the original vtkImageData for vtkMarchingCubes, and the isovalue is 1000. Then I try to save the generated 3D volume to stl file. For a 512*512*190 chest CT DICOM series, the STL file is about 520M. Do you think the file size is rather bigger? Thanks. Liu Peng ?2016-03-25?"Liu_tj" ??? -----????----- ???:"Liu_tj" ????:2016?03?25? ??? ???:"David Gobbi" ??:"vtkusers" ??:Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series Hi, David, Continue this thread. For the 3D model generation, we have a preview function. That means we need quick 3D model generation speed and don't need high model precision. Only when really generating, we need a good 3D model quality. So, for the preview, how to accelerate the generation speed? Thanks Liu Peng ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series Hi Liu Peng, The vtkMarchingCubes algorithm is for greyscale images. Using vtkImageThreshold before vtkMarchingCubes will give a poor result, because the algorithm won't be able to properly interpolate the voxels to find the best surface if it is given a binary image. When you call SetValue(0, isovalue), make sure that "isovalue" is set to the value that corresponds to the desired isosurface. If you don't know what value to use, you can start at 1000, then try 250, then 125, etc. until you get a reasonable result. But the best way to choose a value is to use Otsu's method or something similar. - David On Wed, Mar 16, 2016 at 7:42 PM, Liu_tj wrote: Hi, VTK guys, I use VTK 7.0 to generate 3D model from DICOM series. I just follow the code example from http://www.vtk.org/pipermail/vtkusers/2013-November/082109.html. When I try to reduce the number of triangles by vtkDecimatePro, the Visual Studio 2015 monitor shows that the memory jump to over 10G and my computer has no response, I have to restart my computer rudely. See my code below, with my DICOM series, the marched->GetNumberOfPoints() return more than 20 millions: vtkSmartPointer surface = vtkSmartPointer::New(); surface->SetInputData(volume); surface->ComputeNormalsOn(); surface->ComputeScalarsOn(); surface->SetValue(0, 1); // Create polydata from iso-surface vtkSmartPointer marched = vtkSmartPointer::New(); surface->Update(); marched->DeepCopy(surface->GetOutput()); std::cout<<"Number of points: " << marched->GetNumberOfPoints() << std::endl; // Decimation to reduce the number of triangles vtkSmartPointer decimator = vtkDecimatePro::New(); decimator->SetInputData(marched); decimator->SetTargetReduction(0.5); decimator->SetPreserveTopology(1); decimator->Update(); <------------------memory cost jumps to more than 10G. Any suggestions to decrease the memory cost? I only know that using vtkImageThreshold. Thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sat Apr 2 00:20:36 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 1 Apr 2016 22:20:36 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: <7123efb.3.153d520b75e.Coremail.tjlp@netease.com> References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <4dcc7abb.5.153abbc4a00.Coremail.tjlp@netease.com> <5dbf1bff.19.153c7c5347a.Coremail.tjlp@netease.com> <7123efb.3.153d520b75e.Coremail.tjlp@netease.com> Message-ID: Hi Liu, You are thinking of a different definition of the word "rough". I mean "having an irregular or bumpy surface". I did not mean "unfinished or lacking in detail". - David On Fri, Apr 1, 2016 at 10:00 PM, Liu_tj wrote: > Hi, David, > > According to my understanding, smooth surface should have greater size > than "rough" size, is my understanding wong? > For the DICOM series of 512*512*190, if I shrink to 128*128*190, the > generated 3D volume has worse quality than the one I don't shrink. > > Thanks > Liu Peng > > > ?2016-04-02?"David Gobbi" ??? > > -----????----- > *???:*"David Gobbi" > *????:*2016?04?2? ??? > *???:*"Liu_tj" > *??:*"vtkusers" > *??:*Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model > generation from DICOM series > > > Hi Liu, > > For a volume of that size, I'd guess an STL file size of around 150MB for > a smooth surface, so 520MB for a "rough" surface seems reasonable. As I > mentioned in my previous email, if vtkDecimatePro is running out of memory, > you can try reducing the resolution of the image before running marching > cubes. > > - David > > > On Wed, Mar 30, 2016 at 7:45 AM, Liu_tj wrote: > >> Hi, David, >> >> I follow your advice and use the original vtkImageData for >> vtkMarchingCubes, and the isovalue is 1000. Then I try to save the >> generated 3D volume to stl file. For a 512*512*190 chest CT DICOM series, >> the STL file is about 520M. Do you think the file size is rather bigger? >> >> Thanks. >> Liu Peng >> >> ?2016-03-25?"Liu_tj" ??? >> >> -----????----- >> *???:*"Liu_tj" >> *????:*2016?03?25? ??? >> *???:*"David Gobbi" >> >> *??:*"vtkusers" >> *??:*Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model >> generation from DICOM series >> >> Hi, David, >> >> Continue this thread. For the 3D model generation, we have a preview >> function. That means we need quick 3D model generation speed and don't need >> high model precision. Only when really generating, we need a good 3D model >> quality. So, for the preview, how to accelerate the generation speed? >> >> Thanks >> Liu Peng >> >> >> >> ?2016-03-17?"David Gobbi" ??? >> >> -----????----- >> *???:*"David Gobbi" >> *????:*2016?03?17? ??? >> *???:*"Liu_tj" >> *??:*"vtkusers" >> *??:*Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model >> generation from DICOM series >> >> Hi Liu Peng, >> >> The vtkMarchingCubes algorithm is for greyscale images. Using >> vtkImageThreshold before vtkMarchingCubes will give a poor result, because >> the algorithm won't be able to properly interpolate the voxels to find the >> best surface if it is given a binary image. >> >> When you call SetValue(0, isovalue), make sure that "isovalue" is set to >> the value that corresponds to the desired isosurface. If you don't know >> what value to use, you can start at 1000, then try 250, then 125, etc. >> until you get a reasonable result. But the best way to choose a value is >> to use Otsu's method or something similar. >> >> - David >> >> >> On Wed, Mar 16, 2016 at 7:42 PM, Liu_tj wrote: >> >>> Hi, VTK guys, >>> >>> I use VTK 7.0 to generate 3D model from DICOM series. I just follow the >>> code example from >>> >>> http://www.vtk.org/pipermail/vtkusers/2013-November/082109.html . When I try to reduce the number of triangles by vtkDecimatePro, the Visual Studio 2015 monitor shows that the memory jump to over 10G and my computer has no response, I have to restart my computer rudely. See my code below, with my DICOM series, the marched->GetNumberOfPoints() return more than 20 millions: >>> >>> vtkSmartPointer surface = vtkSmartPointer::New(); >>> surface->SetInputData(volume); >>> surface->ComputeNormalsOn(); >>> surface->ComputeScalarsOn(); >>> surface->SetValue(0, 1); >>> >>> // Create polydata from iso-surface >>> vtkSmartPointer marched = vtkSmartPointer::New(); >>> surface->Update(); >>> marched->DeepCopy(surface->GetOutput()); >>> std::cout<<"Number of points: " << marched->GetNumberOfPoints() << std::endl; >>> >>> // Decimation to reduce the number of triangles >>> vtkSmartPointer decimator = vtkDecimatePro::New(); >>> decimator->SetInputData(marched); >>> decimator->SetTargetReduction(0.5); >>> decimator->SetPreserveTopology(1); >>> decimator->Update(); <------------------memory cost jumps to more than 10G. >>> >>> Any suggestions to decrease the memory cost? I only know that using vtkImageThreshold. >>> Thanks, >>> >>> >> >> >> > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Sat Apr 2 01:12:28 2016 From: tjlp at netease.com (Liu_tj) Date: Sat, 2 Apr 2016 13:12:28 +0800 (CST) Subject: [vtkusers] How to map negative grayscale to color? In-Reply-To: References: <59c5b9d3.2.15351eb7dc2.Coremail.tjlp@netease.com> <4aa21faa.14.15356a0967e.Coremail.tjlp@netease.com> <28c8b01.16.1535719e3be.Coremail.tjlp@netease.com> <42e78ce8.c.15359a3434c.Coremail.tjlp@netease.com> <38137f07.28.1535bf786d8.Coremail.tjlp@netease.com> Message-ID: <55fb8322.7.153d562fecf.Coremail.tjlp@netease.com> Hi,David, As you help me on this thread, I would like to continue on it. I don't clearly understand your words "I didn't think it would be necessary, because I thought that if you passed an RGB (or RGBA) image to vtkImageViewer2 ....". How to pass an RGB image to the vtkImageViewer2? My requirement is that the pixels in some greyscale threshold displayed at some specific color and other pixels are not changed. At that time I had some misunderstanding and I thought it worked.Actually I don't work it out. My code is below. I just change the lookup table of the vtkImageViewer2's vtkImageMapToWindowLevelColors. The result is not I need. It just directly change the image of vtkImageViewer2 and the whole image are changed. See the attachment image 1. If I use a new vtkImageMapToColors instead of the vtkImageViewer2's vtkImageMapToWindowLevelColors, then nothing happen. Seems the vtkImageMapToColors shows no effect. See the attachment image 2. My DICOM series is 512*512*190. The scalar range is [0, 3140]. In my test, the threshold value is [0,400]. private void GrayToColors( Segament_Threshold threshold) { vtkLookupTable lookupTable = vtkLookupTable.New(); double validmin = System.Math.Max(m_scalarrange[0], threshold.Min_Threshold); double validmax = System.Math.Min(m_scalarrange[1], threshold.Max_Threshold); int number = (int)(m_scalarrange[1] - m_scalarrange[0] + 1); lookupTable.SetRange(m_scalarrange[0], m_scalarrange[1]); lookupTable.SetNumberOfTableValues(number); lookupTable.Build(); for (int i = (int)(m_scalarrange[0]); i < (int)(validmin); i++) { lookupTable.SetTableValue(i - (int)m_scalarrange[0], 0.0, 0.0, 0.0, 0.0); } for (int i = (int)(validmin); i <= (int)(validmax); i++) { lookupTable.SetTableValue(i - (int)m_scalarrange[0], 0x66/0xff, 1.0, 1.0, 1.0); } for (int i = (int)(threshold.Max_Threshold) + 1; i < (int)(m_scalarrange[1]); i++) { lookupTable.SetTableValue(i - (int)m_scalarrange[0], 0.0, 0.0, 0.0, 0.0); } vtkImageMapToWindowLevelColors colormapper = m_imageViewer.GetWindowLevel(); colormapper.SetOutputFormatToRGBA(); colormapper.PassAlphaToOutputOn(); colormapper.SetLookupTable(lookupTable); colormapper.Update(); if (m_colormapActor == null) { m_colormapActor = vtkImageActor.New(); m_colormapActor.GetMapper().SetInputConnection(colormapper.GetOutputPort()); m_renderer.AddViewProp(m_colormapActor); } m_renderer.ResetCamera(); m_renderer.Modified(); m_imageViewer.SetRenderer(m_renderer); m_imageViewer.Render(); } Any thing wrong? Thanks Liu Peng ?2016-03-10?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?10? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: Re: Re: [vtkusers] How to map negative grayscale to color? Hi Liu Peng, I'm glad to hear it worked for you. I didn't think it would be necessary, because I thought that if you passed an RGB (or RGBA) image to vtkImageViewer2 it would simply display it as-is, without needing any tweaks to internal parts of the Viewer (note: I hardly ever use vtkImageViewer or vtkimageViewer2 myself, I prefer to use the image mappers directly instead). - David On Wed, Mar 9, 2016 at 8:21 AM, Liu_tj wrote: Hi, David, I try it again. The conversion from gray scale to RGB works after I set the LookupTable to vtkImageMapToWindowLevelColors returned by vtkImageViewer2::GetWindowLevels(). ?2016-03-09?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?9? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: Re: [vtkusers] How to map negative grayscale to color? No, that isn't necessary. On Tue, Mar 8, 2016 at 9:29 PM, Liu_tj wrote: Hi,David, Do I need to set the LookupTable to vtkImageMapToWindowLevelColors which is returned by vtkImageViewer2::GetWindowLevels() instead of create a new vtkImageMapToColors? BR, Thanks ?2016-03-09?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?9? ??? ???:"Liu_tj" ??:Re: Re: Re: [vtkusers] How to map negative grayscale to color? Hi Liu Peng, Do you want to show a gray image underneath, and the color image on top? I'm not sure if vtkImageViewer works property if you add more than one image. You should add a "print" statement of some kind to your code to print the values of scalarrange, to be sure they are correct. Don't call colormap.Build() after setting your own values for the table, or it might overwrite the values that you have set. If you call it at all, call it immediately after SetNumberOfTableValues(), before you set any of your own values. The range on the final for() loop should be the following: for (int i = (int)(threshhold[1]) + 1; i <= (int)(scalarrange[1]); i++) Also, if you want the beyond-threshold values to be transparent instead of black, then set the alpha component to zero: for (int i = (int)(scalarrange[0]); i < (int)(threshhold[0]); i++) { colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, 0.0, 0.0); } - David On Tue, Mar 8, 2016 at 9:40 AM, Liu_tj wrote: Hi, David, I follow your post and it doesn't work. The DICOM image shows no color, just gray image. Could you have a look at my code below? I use a vtkImageView2 to display the DICOM image. The code is c# by Activiz .NET. The scalar range of test image is [-1024,3071]. I want to show the gray scale at [1000,3000] to green. The function GrayToColors() maps gray scale to color, it is called by Display(). private void Display(vtkRenderWindow aRenderWindow, vtkAlgorithmOutput aData) { if (aData == null) return; m_imageViewer = vtkImageViewer2.New(); m_imageViewer.SetInputConnection(aData); switch (m_sliceDirection) { case Direction.AXIAL: m_imageViewer.SetSliceOrientationToXY(); break; case Direction.CORONAL: m_imageViewer.SetSliceOrientationToYZ(); break; case Direction.SAGITTAL: m_imageViewer.SetSliceOrientationToXZ(); break; default: break; } m_imageViewer.GetSliceRange(ref m_minSliceNumber, ref m_maxSliceNumber); m_interactorStyle = vtkInteractorStyleImage.New(); m_interactorStyle.MouseWheelForwardEvt += new vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt); m_interactorStyle.MouseWheelBackwardEvt += new vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); aRenderWindow.GetInteractor().SetInteractorStyle(m_interactorStyle); aRenderWindow.GetRenderers().InitTraversal(); m_renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); m_renderer.SetBackground(0.0, 0.0, 0.0); m_imageViewer.SetRenderWindow(aRenderWindow); m_currentSlice = m_minSliceNumber + (m_maxSliceNumber - m_minSliceNumber) / 2; m_imageViewer.SetSlice(m_currentSlice); double[] scalarrange = new double[2]; scalarrange = m_imageViewer.GetInput().GetScalarRange(); double[] threshhold = new double[2]; threshhold[0] = 1000; threshhold[1] = 3000; m_imageViewer.Render(); GrayToColors(m_renderer, aData, scalarrange, threshhold); m_imageViewer.Render(); } private void GrayToColors(vtkRenderer renderer, vtkAlgorithmOutput data, double[] scalarrange, double[] threshhold) { vtkLookupTable colormap = vtkLookupTable.New(); int number = (int)(scalarrange[1] - scalarrange[0] + 1); colormap.SetRange(scalarrange[0], scalarrange[1]); colormap.SetNumberOfTableValues(number); for (int i = (int)(scalarrange[0]); i < (int)(threshhold[0]); i++) { colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, 0.0, 1.0); } for (int i = (int)(threshhold[0]); i <= (int)(threshhold[1]); i++) { colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 1.0, 0.0, 1.0); } for (int i = (int)(threshhold[1]); i < (int)(scalarrange[1]); i++) { colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, 0.0, 1.0); } colormap.Build(); vtkImageMapToColors colormapper = vtkImageMapToColors.New(); colormapper.SetInputConnection(data); colormapper.SetLookupTable(colormap); colormapper.Update(); vtkImageActor colormapActor = vtkImageActor.New(); colormapActor.SetInput(colormapper.GetOutput()); renderer.AddActor(colormapActor); renderer.ResetCamera(); renderer.Modified(); } Thanks ?2016-03-08?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?8? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: [vtkusers] How to map negative grayscale to color? Hi Liu Pen, That's because I forgot to include the index argument in the call to SetTableValue: table->SetRange(-1024, 4095); table->SetNumberOfTableValues(4095 + 1024 + 1); for (int i = -1024; i < -10; i++) { table->SetTableValue(i + 1024, 0.0, 0.0, 0.0, 1.0); } The table index must start at zero. The call to SetRange(-1024, 4095) causes the scalar value -1024 to map to table index 0. In the "for" loop, i is the scalar value. - David On Tue, Mar 8, 2016 at 7:27 AM, Liu_tj wrote: Hi, David, When I try, a lot of errors are popup: "Can't set the table value for negative index". Seems the negative grayscale needs some transformation. Thanks Liu Peng ?2016-03-08?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?8? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] How to map negative grayscale to color? Hi Liu Peng, You can set individual values in the lookup table, in order to precisely map certain scalar values to specific colors: table->SetRange(-1024, 4095); table->SetNumberOfTableValues(4095 + 1024 + 1); for (int i = -1024; i < -10; i++) { table->SetTableValue(0.0, 0.0, 0.0, 1.0); } for (int i = -10; i <= 200; i++) { table->SetTableValue(0.0, 1.0, 0.0, 1.0); } etcetera. - David On Mon, Mar 7, 2016 at 9:31 AM, Liu_tj wrote: Hi, I try to use the vtkLookupTable to convert the grayscale to rgb color. The image scalar range is [-1024,3071] returned by vtkImageData::GetScalarRange(). Now I want to convert specific grayscale range, for example, [-10,200] to one color, such as green (RGB is 0,1,0). How to do that by vtkLookupTable? I have no idea what method should call: SetNumberOfTableValues(), SetRange(), SetHueRange(), SetValueRange(). What do "Hue" and "Value" stand for? BR, Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ImageMapToColors_1.jpg Type: image/jpeg Size: 40242 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ImageMapToColors_2.jpg Type: image/jpeg Size: 35185 bytes Desc: not available URL: From ultam93 at yahoo.com Sat Apr 2 08:33:02 2016 From: ultam93 at yahoo.com (Constantinescu Mihai) Date: Sat, 2 Apr 2016 12:33:02 +0000 (UTC) Subject: [vtkusers] Parallel alignment of an actor2 to the closest surface of an actor1 References: <1019761074.1248049.1459600382523.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1019761074.1248049.1459600382523.JavaMail.yahoo@mail.yahoo.com> Hello, After loading two actors, actor1 and actor2, I wish to be able to quickly align them, so that actor2 would be parallel to the closest surface of actor1. Is there any easy way to do that in vtk? -------------- next part -------------- An HTML attachment was scrubbed... URL: From zionman.hsu at gmail.com Sat Apr 2 11:09:30 2016 From: zionman.hsu at gmail.com (zionman) Date: Sat, 2 Apr 2016 23:09:30 +0800 Subject: [vtkusers] Error in compiling vtkGenericDataArray.txx Message-ID: <95DBFB2A66984682859F113E91D1E151@zionladynb> while compiling nightly build vtk_master trunk, with DEBUG options there are many instance of error c2668: error c2668: '_wassert' : ambiguous call to overloaded function this error message is not exists while using RELEASE options. this error message exists either by Visual studio 2008 or by Visual studio 2015, this error message valid through XP, win7 and win10 there are many occurency through building vtk library, and shows only with vtkGenericDataArray.txx is there any method or patch to bypass this error message -------------- next part -------------- An HTML attachment was scrubbed... URL: From ultam93 at yahoo.com Sun Apr 3 16:32:45 2016 From: ultam93 at yahoo.com (c_mihai) Date: Sun, 3 Apr 2016 13:32:45 -0700 (MST) Subject: [vtkusers] Parallel alignment of an actor2 to the closest surface of an actor1 In-Reply-To: <1019761074.1248049.1459600382523.JavaMail.yahoo@mail.yahoo.com> References: <1019761074.1248049.1459600382523.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1459715565623-5737498.post@n5.nabble.com> So far I've managed to use vtkCellPicker to obtain a point and it's normal from the surface of actor2. I still have no idea how to rotate actor1 to fit that surface. -- View this message in context: http://vtk.1045678.n5.nabble.com/Parallel-alignment-of-an-actor2-to-the-closest-surface-of-an-actor1-tp5737494p5737498.html Sent from the VTK - Users mailing list archive at Nabble.com. From dakota_63124 at yahoo.com Sun Apr 3 19:51:37 2016 From: dakota_63124 at yahoo.com (kent myers) Date: Sun, 3 Apr 2016 16:51:37 -0700 (MST) Subject: [vtkusers] Using vtkAreaPicker from Java In-Reply-To: <1458517735267-5737306.post@n5.nabble.com> References: <1458517735267-5737306.post@n5.nabble.com> Message-ID: <1459727497181-5737499.post@n5.nabble.com> I found the answer to this question. The observer for the vtkAreaPicker is "EndPickEvent" -- View this message in context: http://vtk.1045678.n5.nabble.com/Using-vtkAreaPicker-from-Java-tp5737306p5737499.html Sent from the VTK - Users mailing list archive at Nabble.com. From dakota_63124 at yahoo.com Sun Apr 3 19:53:26 2016 From: dakota_63124 at yahoo.com (kent myers) Date: Sun, 3 Apr 2016 16:53:26 -0700 (MST) Subject: [vtkusers] Changing color of point after selection In-Reply-To: References: <1456690097983-5736910.post@n5.nabble.com> Message-ID: <1459727606359-5737500.post@n5.nabble.com> That solved my problem. Thanks, Kent -- View this message in context: http://vtk.1045678.n5.nabble.com/Changing-color-of-point-after-selection-tp5736910p5737500.html Sent from the VTK - Users mailing list archive at Nabble.com. From dakota_63124 at yahoo.com Sun Apr 3 20:12:23 2016 From: dakota_63124 at yahoo.com (kent myers) Date: Sun, 3 Apr 2016 17:12:23 -0700 (MST) Subject: [vtkusers] vtkProp3D for area picking cells and points in Java Message-ID: <1459728743373-5737501.post@n5.nabble.com> I have implemented area picking in Java based on the example at the following link http://www.vtk.org/Wiki/VTK/Examples/Cxx/Picking/AreaPicking Execution is going to my observer when I complete the area selection and GetNumberOfItems() returns a value of 2. However, I don't understand how to obtain the point and/or cell ids from the vtkProp3D object or how to use the that object to obtain the points or cells that lie within the picking rectangle. Thanks in advance for any help someone can offer. Kent -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkProp3D-for-area-picking-cells-and-points-in-Java-tp5737501.html Sent from the VTK - Users mailing list archive at Nabble.com. From rickfrank at me.com Sun Apr 3 20:37:43 2016 From: rickfrank at me.com (Richard Frank) Date: Mon, 04 Apr 2016 00:37:43 +0000 (GMT) Subject: [vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx Message-ID: In moving my 6.3.0 code to 7.0.0 iv'e run into the following issue: When I try to render my volume, the App crashes in vtkOpenGLGPUVolumeRayCastMapper.cxx line 2514... -------------------------------------------------------------------- // Now compile the shader //-------------------------------------------------------------------------- this->Impl->ShaderProgram = this->Impl->ShaderCache->ReadyShaderProgram( vertexShader.c_str(), fragmentShader.c_str(), ""); if (!this->Impl->ShaderProgram->GetCompiled()) { vtkErrorMacro("Shader failed to compile"); } this->Impl->ShaderBuildTime.Modified(); -------------------------------------------------------------------------- The shader fails to compile and?so?this->Impl->ShaderProgram is null. However, the check following is incorrect because?this->Impl->ShaderProgram is null and so the program crashes trying to dereference the null pointer. The shader compile error is below: ERROR: \vtk700\Rendering\OpenGL2\vtkShaderProgram.cxx, line 370 vtkShaderProgram (00000000224A9D70): 0(169) : error C1008: undefined variable "g_aspect" 0(170) : error C1008: undefined variable "g_aspect" 0(171) : error C1008: undefined variable "g_aspect" Is there something I'm doing wrong here? Seems like it's really a bug in the shader program, and the error handling for failure to compile... Thanks Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From ogdenk at upstate.edu Sun Apr 3 21:13:12 2016 From: ogdenk at upstate.edu (Kent Ogden) Date: Sun, 03 Apr 2016 21:13:12 -0400 Subject: [vtkusers] Problem building VTK against Anaconda Qt Message-ID: <570187B202000082000EA678@gatedom1.upstate.edu> Hi, I have been trying to build VTK (and ITK) with Python bindings for use in Anaconda2. I am using VS 2015 on Win 7 with the most recent Anaconda and VTK 6.3 (I get the same problem with version 7). Most of VTK builds properly, but I get link errors for a few of the projects: 226>QVTKWidget.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QImage & __cdecl QImage::operator=(class QImage &&)" (__imp_??4QImage@@QEAAAEAV0@$$QEAV0@@Z) referenced in function "protected: virtual void __cdecl QVTKWidget::paintEvent(class QPaintEvent *)" (?paintEvent at QVTKWidget@@MEAAXPEAVQPaintEvent@@@Z) 226>QVTKPaintEngine.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QPixmap & __cdecl QPixmap::operator=(class QPixmap &&)" (__imp_??4QPixmap@@QEAAAEAV0@$$QEAV0@@Z) referenced in function "public: virtual void __cdecl QVTKPaintEngine::drawPixmap(class QRectF const &,class QPixmap const &,class QRectF const &)" (?drawPixmap at QVTKPaintEngine@@UEAAXAEBVQRectF@@AEBVQPixmap@@0 at Z) 226>vtkQtTableModelAdapter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString & __cdecl QString::operator=(class QString &&)" (__imp_??4QString@@QEAAAEAV0@$$QEAV0@@Z) referenced in function "private: void __cdecl vtkQtTableModelAdapter::updateModelColumnHashTables(void)" (?updateModelColumnHashTables at vtkQtTableModelAdapter@@AEAAXXZ) 226>C:\KW\VTKBuild\bin\Release\vtkGUISupportQt-6.3.dll : fatal error LNK1120: 3 unresolved externals 232>------ Build started: Project: vtkRenderingQt, Configuration: Release x64 ------ 233>------ Build started: Project: vtkGUISupportQtOpenGL, Configuration: Release x64 ------ 232> Building Custom Rule C:/KW/VTK-6.3.0/Rendering/Qt/CMakeLists.txt 233> Building Custom Rule C:/KW/VTK-6.3.0/GUISupport/QtOpenGL/CMakeLists.txt I am not very experienced with Qt, could there be something missing from the Anaconda distro that is causing this error? This is preventing me from importing vtk in Python, the process halts because of the missing dll. Thanks for any thoughts/comments/suggestions. Kent -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Sun Apr 3 21:25:55 2016 From: rickfrank at me.com (Richard Frank) Date: Mon, 04 Apr 2016 01:25:55 +0000 (GMT) Subject: [vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx, continued Message-ID: <228bde57-6a7b-4c3e-a53c-bc815e3eb5cc@me.com> Further investigation seems to point the GradientOpacity section of shader ?raycasterfs.glsl, code which seems to?be?inserted at runtime: I guess gl_aspect is not defined in this scenario? Any suggestions welcome! Rick vec4 computeGradient() 145: { 146: vec3 g1; 147: vec4 g2; 148: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; 149: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; 150: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; 151: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; 152: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; 153: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; 154: g1 = g1*in_volume_scale.r + in_volume_bias.r; 155: g2 = g2*in_volume_scale.r + in_volume_bias.r; 156: g1.x = in_scalarsRange[0] + ( 157: in_scalarsRange[1] - in_scalarsRange[0]) * g1.x; 158: g1.y = in_scalarsRange[0] + ( 159: in_scalarsRange[1] - in_scalarsRange[0]) * g1.y; 160: g1.z = in_scalarsRange[0] + ( 161: in_scalarsRange[1] - in_scalarsRange[0]) * g1.z; 162: g2.x = in_scalarsRange[0] + ( 163: in_scalarsRange[1] - in_scalarsRange[0]) * g2.x; 164: g2.y = in_scalarsRange[0] + ( 165: in_scalarsRange[1] - in_scalarsRange[0]) * g2.y; 166: g2.z = in_scalarsRange[0] + ( 167: in_scalarsRange[1] - in_scalarsRange[0]) * g2.z; 168: g2.xyz = g1 - g2.xyz; 169: g2.x /= g_aspect.x; 170: g2.y /= g_aspect.y; 171: g2.z /= g_aspect.z; 172: float grad_mag = sqrt(g2.x * g2.x + 173: g2.y * g2.y + 174: g2.z * g2.z); 175: if (grad_mag > 0.0) 176: { 177: g2.x /= grad_mag; 178: g2.y /= grad_mag; 179: g2.z /= grad_mag; 180: } 181: else 182: { 183: g2.xyz = vec3(0.0, 0.0, 0.0); 184: } 185: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[1] - 186: (in_scalarsRange[0]))); 187: grad_mag = clamp(grad_mag, 0.0, 1.0); 188: g2.w = grad_mag; 189: return g2; 190: } -------------- next part -------------- An HTML attachment was scrubbed... URL: From dakota_63124 at yahoo.com Sun Apr 3 21:48:12 2016 From: dakota_63124 at yahoo.com (kent myers) Date: Sun, 3 Apr 2016 18:48:12 -0700 (MST) Subject: [vtkusers] vtkPlaneWidget handle size not dynamic based on camera distance Message-ID: <1459734492033-5737505.post@n5.nabble.com> I am using the vtkPlaneWidget to dynamically position a cutting plane. When my model is relatively large and the camera distance to the model is large, the vtkPlaneWidget handles are so tiny that I cannot see them. I read in a forum post that the handle sizes are supposed to update automatically based on window size and distance from the camera to the plane widget. Since this does not seem to be working, I am attempting to update the handle size in a mouse drag event handler to respond to changes in the camera distance. This is working fine except that the size of the handles does not immediately change after the callback. They only update after the user adjusts the plane widget size, position, or orientation. I have tried calling the plane widget Modified() method and the UpdatePlacement() method after calling SetHandleSize(), but this does not help. Any suggests would be welcome. I am using VTK 1.7RC1 on Windows 7 and Java. Thanks, Kent -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkPlaneWidget-handle-size-not-dynamic-based-on-camera-distance-tp5737505.html Sent from the VTK - Users mailing list archive at Nabble.com. From aashish.chaudhary at kitware.com Sun Apr 3 22:26:13 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Sun, 3 Apr 2016 22:26:13 -0400 Subject: [vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx, continued In-Reply-To: <228bde57-6a7b-4c3e-a53c-bc815e3eb5cc@me.com> References: <228bde57-6a7b-4c3e-a53c-bc815e3eb5cc@me.com> Message-ID: Rick, Can you send me information on what you are turning on in volume property and in mapper that leads to this crash? Also, is your data is single or 2 or 4 component? Thanks, On Sun, Apr 3, 2016 at 9:25 PM, Richard Frank wrote: > Further investigation seems to point the GradientOpacity section of shader > raycasterfs.glsl, code which seems to be inserted at runtime: I guess > gl_aspect is not defined in this scenario? > > Any suggestions welcome! > > Rick > > vec4 computeGradient() > 145: { > 146: vec3 g1; > 147: vec4 g2; > 148: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; > 149: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; > 150: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; > 151: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; > 152: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; > 153: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; > 154: g1 = g1*in_volume_scale.r + in_volume_bias.r; > 155: g2 = g2*in_volume_scale.r + in_volume_bias.r; > 156: g1.x = in_scalarsRange[0] + ( > 157: in_scalarsRange[1] - in_scalarsRange[0]) * g1.x; > 158: g1.y = in_scalarsRange[0] + ( > 159: in_scalarsRange[1] - in_scalarsRange[0]) * g1.y; > 160: g1.z = in_scalarsRange[0] + ( > 161: in_scalarsRange[1] - in_scalarsRange[0]) * g1.z; > 162: g2.x = in_scalarsRange[0] + ( > 163: in_scalarsRange[1] - in_scalarsRange[0]) * g2.x; > 164: g2.y = in_scalarsRange[0] + ( > 165: in_scalarsRange[1] - in_scalarsRange[0]) * g2.y; > 166: g2.z = in_scalarsRange[0] + ( > 167: in_scalarsRange[1] - in_scalarsRange[0]) * g2.z; > 168: g2.xyz = g1 - g2.xyz; > 169: g2.x /= g_aspect.x; > 170: g2.y /= g_aspect.y; > 171: g2.z /= g_aspect.z; > 172: float grad_mag = sqrt(g2.x * g2.x + > 173: g2.y * g2.y + > 174: g2.z * g2.z); > 175: if (grad_mag > 0.0) > 176: { > 177: g2.x /= grad_mag; > 178: g2.y /= grad_mag; > 179: g2.z /= grad_mag; > 180: } > 181: else > 182: { > 183: g2.xyz = vec3(0.0, 0.0, 0.0); > 184: } > 185: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[1] - > 186: (in_scalarsRange[0]))); > 187: grad_mag = clamp(grad_mag, 0.0, 1.0); > 188: g2.w = grad_mag; > 189: return g2; > 190: } > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From dakota_63124 at yahoo.com Sun Apr 3 23:07:53 2016 From: dakota_63124 at yahoo.com (kent myers) Date: Sun, 3 Apr 2016 20:07:53 -0700 (MST) Subject: [vtkusers] Unstructured grid cell colors lost after applying clipping plane Message-ID: <1459739273407-5737507.post@n5.nabble.com> I am using the Java code shown below to apply a clipping plane to a an actor consisting of an unstructured grid. This works fine, except that if the unstructured grid has scalars assigned and a color lookup table is used to display contours, the coloring of the cells is lost (everything turns gray) while the clipping plane is enabled. As soon as I disable the clipping plane, the colors are restored. My guess is that this has something to do with the original unstructured grid being completely replaced in the visualization pipeline by the result of the clipping plane operation, therefore, there are no scalars to control the colors. If someone knows of an example for how a clipping plane should be used when scalar data is present, it could be helpful. Note, the scalar data is the result of a finite element computation, so it is expensive to evaluate the scalar values for arbitrary points in space. If this is a case where the points should be assigned global IDs, and these IDs used to look up the original scalar data for the associated points, an example of how this can be done would be very helpful. There may be some VTK examples somewhere that demonstrate global ID's, but I have not found one yet. Thanks, Kent public void updateCuttingPlane(vtkPlane plane) { vtkActor elementActor = documentVTK.getElementFaceActor(); vtkActor edgeActor = documentVTK.getElementEdgeActor(); vtkActor undeformedEdgeActor = documentVTK.getUndeformedElementEdgeActor(); vtkClipClosedSurface clipClosedSurface = new vtkClipClosedSurface(); vtkPlaneCollection planes = new vtkPlaneCollection(); planes.AddItem(plane); clipClosedSurface.SetClippingPlanes(planes); // extract vtkPolyData from unstructured grid vtkDataSetSurfaceFilter surfaceFilter = new vtkDataSetSurfaceFilter(); surfaceFilter.SetInputData(facePolyData); surfaceFilter.Update(); vtkPolyData polyData = surfaceFilter.GetOutput(); clipClosedSurface.AddInputData(polyData); clipClosedSurface.Update(); vtkDataSetMapper clipMapper = new vtkDataSetMapper(); clipMapper.SetInputConnection(clipClosedSurface.GetOutputPort()); elementActor.SetMapper(clipMapper); edgeActor.VisibilityOff(); undeformedEdgeActor.VisibilityOff(); } public void disableCuttingPlane() { vtkActor elementActor = documentVTK.getElementFaceActor(); vtkActor edgeActor = documentVTK.getElementEdgeActor(); vtkActor undeformedEdgeActor = documentVTK.getUndeformedElementEdgeActor(); elementActor.SetMapper(faceSurfMapper); edgeActor.VisibilityOn(); if(getPlotShape() == PlotShape.OVERLAY_DEFORMED) { undeformedEdgeActor.VisibilityOn(); } } -- View this message in context: http://vtk.1045678.n5.nabble.com/Unstructured-grid-cell-colors-lost-after-applying-clipping-plane-tp5737507.html Sent from the VTK - Users mailing list archive at Nabble.com. From zionman.hsu at gmail.com Sun Apr 3 23:57:44 2016 From: zionman.hsu at gmail.com (=?big5?B?rn2n07XY?=) Date: Mon, 4 Apr 2016 11:57:44 +0800 Subject: [vtkusers] Error in compiling vtkGenericDataArray.txx Message-ID: while compiling nightly build vtk_master trunk, with DEBUG options there are many instance of error c2668: error c2668: '_wassert' : ambiguous call to overloaded function this error message is not exists while using RELEASE options. this error message exists either by Visual studio 2008 or by Visual studio 2015, this error message valid through XP, win7 and win10 there are many occurency through building vtk library, and shows only with vtkGenericDataArray.txx is there any method or patch to bypass this error message -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.wormser at gmx.de Mon Apr 4 05:59:07 2016 From: max.wormser at gmx.de (mwormser) Date: Mon, 4 Apr 2016 02:59:07 -0700 (MST) Subject: [vtkusers] How to properly manage memory using Python and VTK Message-ID: <1459763947807-5737509.post@n5.nabble.com> Hi, I am facing a problem with my first VTK program that I wrote in Python 2.7. I only started using VTK a few weeks ago, so please bear with my beginner's mistakes. What my program does is it creates 12 lines that form a kind of cubic grid. These lines get faces using vtkTubeFilter, appended into one object with vtkAppendPolyData and cut to right size using vtkClipClosedSurface. Then I duplicate the resulting cell using vtkTransform (e.g. 5x5x5 cells), append them again (and cut and recenter them again in certain cases). The result is rendered and saved as .stl. My program manages up to 9x9x9 cells, but starting with 10x10x10 it gives an error like "Unable to allocate 30106875 elements of size 8 byte." The machine I am working on has 12 GB RAM. I realize that my structure is really big (resulting stl way over 200MB), but I want to get to at least 10x10x15 cells. Is there a way to save memory in my program? I have no clue about memory management. I read about SmartPointers, but can't seem to figure out how to use them in Python (I don't know C++). I tried using SetReleaseDataFlag(1) on the Filters after they were redundant, but that somehow deleted the filter recursively. Does anybody know a programming solution for this or do I have to use a system with more RAM? Sorry for not posting a minimal example, but my program is rather lengthy. I did post a small example to stackoverflow, though (http://stackoverflow.com/questions/36354985/memory-management-with-python-and-vtk) which hasn't received any answers yet. Thanks for any help in advance! -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-properly-manage-memory-using-Python-and-VTK-tp5737509.html Sent from the VTK - Users mailing list archive at Nabble.com. From richard.j.brown at live.co.uk Mon Apr 4 06:09:55 2016 From: richard.j.brown at live.co.uk (Richard Brown) Date: Mon, 4 Apr 2016 12:09:55 +0200 Subject: [vtkusers] vtkDICOMReader and vtkGDCMImageReader orientation In-Reply-To: References: <1459515146888-5737481.post@n5.nabble.com> Message-ID: Dear David, Thanks for the help. I applied the suggested changes to vtkDICOMReader and I seem to be able to consistently produce 3D surfaces that agree with Slicer, which is always reassuring. > 4) An even more pernicious problem for CTs is that, if the scan is done with > a tilted gantry, the resulting series does not form a rectangular "volume". > For such images, the vtkDICOMCTRectifier can resample the data so that > it can be properly used within VTK. I read that scaling, reflection/rotation, shear and translation are included in the 4x4 matrix. Given that shear is included in this matrix, shouldn?t gantry tilt be accounted for when I use GetPatientMatrix()? And then moving on from 3D surfaces? If I didn?t want to produce 3D surfaces; if I wanted to manipulate vtkImageData, is there any precautions I should take? For example, if I want to superpose DICOM RT-Structures or other surfaces (notably .STL in my case) onto my vtkImageData, do I need to apply any sort of matrix to either the DICOM vtkImageData or the superposed structures to make sure that they superpose in the correct position with the correct orientation? And lastly, to get the world coordinates (x,y,z) from my vtkImageData coordinates (i,j,k), do I simply apply the GetPatientMatrix()? Is there a method for this? And the same question applies for world coordinate ?> index coordinate conversions - I assume I calculate the inverse matrix and apply that in a similar fashion? Many thanks, Richard > On 01 Apr 2016, at 22:32, David Gobbi wrote: > > Hi Richard, > > I'm only going to touch on one part of your email now... hopefully I'll be > able to > address some of the other points later. > > You cannot generate the correct 3D surface from the image data alone. The > DICOM images are oriented images, which means that, if you want to know > where things are, you need not only the image data, but also "orientation" > and "position" information for the images. And of course you are already > familiar with this... so let's jump ahead to what you actually need to _do_ > in > order to generate the correct surface. > > For the vtkDICOMReader, it should be easy: > 1) read the image (obviously!) > 2) call the GetPatientMatrix() method to get position/orientation info > 3) run marching cubes on the image to get a surface > 4) correct the surface by using vtkTransformPolyDataFilter to apply the > aforementioned PatientMatrix to the surface > > These same basic steps can be used with any of the DICOM readers, > but of course each reader is slightly different and the devil is in the > details. > > For example, here are some tricky details for vtkDICOMReader (and it is > the least "tricky" of the three readers, IMHO): > > 1) If you look at the orientation returned by > vtkDICOMReader::GetPatientMatrix() > and compare it to the DICOM file metadata, you will notice that it is > different! > This is because the vtkDICOMReader (like other VTK readers) rasterizes its > output from bottom to top, to historically match the glDrawPixels function. > Since native DICOM is rasterized top-to-bottom, this requires a vertical > flip of > the orientation matrix. > > For this reason, I strongly recommend that anyone using vtkDICOMReader in > a "serious" application call the SetMemoryRowOrderToFileNative() method, > which will cause the reader to rasterize the data from top-to-bottom and > will > cause the matrix returned by GetPatientMatrix() to exactly match the > original > DICOM meta data. > > 2) The vtkDICOMReader always uses IPP sorting for a volumetric series, > unless you specifically call SortingOff(), in which case it uses the order > of > the files. I do not recommend calling SortingOff(). Relying on IPP is > best. > > 3) For isosurfaces, note that RescaleIntercept/RescaleSlope can vary from > slice-to-slice in CT and PET. For such images, I wrote a filter called > vtkDICOMApplyRescale that can be applied to the data immediately after > the reader (but please read the doxygen docs for this filter before using > it). > > 4) An even more pernicious problem for CTs is that, if the scan is done with > a tilted gantry, the resulting series does not form a rectangular "volume". > For such images, the vtkDICOMCTRectifier can resample the data so that > it can be properly used within VTK. > > Hopefully this info will be of some help. Let me know if you want > clarification on any of the above points. > > Cheers, > - David > > > > > On Fri, Apr 1, 2016 at 6:52 AM, mbcx9rb9 wrote: > >> Hi all, >> >> I'm having some troubles with orientation and location of my DICOMs when >> loaded with vtkDICOMReader and vtkGDCMImageReader. >> >> To illustrate my problems, I opened the same files with both the readers >> and >> performed marching cubes on them to display 3D surfaces. I also displayed >> an >> annotated orientation cube to allow me to compare these surfaces with >> Slicer3D (which I'm assuming correctly calculates orientation etc.). >> >> In the ideal world, the 3D surfaces should superpose perfectly, but this is >> not the case. >> >> My pipeline for reading DICOMs with vtkGDCMImageReader is: >> gdcm::IPPSorter <-- Calculates the proper >> z-spacing >> vtkGDCMImageReader >> vtkImageChangeInfromation <-- Applies the corrected z-spacing >> that >> was calculated by IPPSorter >> >> My pipeline for reading DICOMs with vtkDICOMReader is simply: >> vtkDICOMReader >> and then actor->SetUserMatrix(reader->GetPatientMatrix()) >> >> My problem is that the 3D structures are not in the same position nor the >> same orientation. Furthermore, one might agree with Slicer3D for one image >> but not for the next... >> >> I guess my main question is - What is the correct way to systematically >> open >> DICOM files (using either vtkDICOMReader or vtkGDCMImageReader, I'm not >> fussy)? >> >> Below are two images, one of a human skull and one of a pig skull (chosen >> at >> random). Each time, the red is rendered from vtkGDCMImageReader, the black >> is rendered from vtkDICOMReader (turns black when I use SetUserMatrix, not >> sure why...) and the last is from Slicer3D. >> >> With the human skull, we see that vtkGDCMImageReader agrees with slicer, >> whereas vtkDICOMReader is upside-down (Superior-Inferior reflection). >> However for the pig, vtkGDCMImageReader is upside-down (Superior-Inferior >> reflection) (PLUS something funny has happened to the spacing), whereas >> vtkDICOMReader is facing the anterior direction as opposed to the superior >> direction. >> >> < >> http://vtk.1045678.n5.nabble.com/file/n5737481/Screen_Shot_2016-04-01_at_12.png >>> >> < >> http://vtk.1045678.n5.nabble.com/file/n5737481/Screen_Shot_2016-04-01_at_14.png >>> >> >> Below is the code I have used for both. Any pointers on the correct way to >> consistently read DICOM images correctly would be appreciated. >> >> Regards, >> Richard >> >> P.S. A very important question - is my vtkAnnotatedCubeActor correctly >> annotated? If not, the comparison between my 3D structures and Slicer3D is >> useless until this is corrected... >> >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> >> #include >> #include >> >> #include >> #include >> >> int main() >> { >> >> // >> >> -------------------------------------------------------------------------------------------- >> // >> // >> // Get filenames >> // >> // >> >> -------------------------------------------------------------------------------------------- >> // >> >> // Get all DCM files in directory >> vtkSmartPointer filenames = >> vtkSmartPointer::New(); >> QDirIterator iterator("/Scan/Directory/", >> QStringList("*.dcm"), QDir::Files, >> QDirIterator::Subdirectories); >> while (iterator.hasNext()) { >> filenames->InsertNextValue(iterator.next().toUtf8().data()); >> } >> >> // Sort >> vtkSmartPointer sorter = vtkSmartPointer >> ::New(); >> sorter->SetInputFileNames(filenames); >> sorter->Update(); >> >> // Get most numerous series >> int numSeries = sorter->GetNumberOfSeries(); >> int mostNumerousSeriesIndex = 0; >> >> for (int i=0; i> if (sorter->GetFileNamesForSeries(i)->GetNumberOfValues() > >> >> sorter->GetFileNamesForSeries(mostNumerousSeriesIndex)->GetNumberOfValues()) >> { >> mostNumerousSeriesIndex = i; >> } >> } >> >> vtkStringArray *seriesFilenames = >> sorter->GetFileNamesForSeries(mostNumerousSeriesIndex); >> >> // >> >> -------------------------------------------------------------------------------------------- >> // >> // >> // Setup renderer etc. >> // >> // >> >> -------------------------------------------------------------------------------------------- >> // >> >> vtkSmartPointer renderer = >> vtkSmartPointer::New(); >> renderer->SetGradientBackground(1); >> renderer->SetBackground(.5,.5,.5); >> renderer->SetBackground2(0,0,0); >> >> vtkSmartPointer renWin = >> vtkSmartPointer::New(); >> renWin->AddRenderer(renderer); >> renWin->SetSize(1000,1000); >> >> vtkSmartPointer interactorStyle = >> vtkSmartPointer::New(); >> >> vtkSmartPointer renWinInt = >> vtkSmartPointer::New(); >> renWinInt->SetRenderWindow(renWin); >> renWinInt->SetInteractorStyle(interactorStyle); >> >> >> // >> >> -------------------------------------------------------------------------------------------- >> // >> // >> // vtkGDCMImageReader >> // >> // >> >> -------------------------------------------------------------------------------------------- >> // >> >> // need to convert from vtkStringArray to std::vector to >> be >> able to sort... >> std::vector seriesFilenames_stdVector; >> for (int i=0; iGetNumberOfValues(); i++) { >> >> seriesFilenames_stdVector.push_back(seriesFilenames->GetValue(i).c_str()); >> } >> >> // sort and get z-spacing >> gdcm::IPPSorter IPPs; >> IPPs.SetComputeZSpacing(true); >> IPPs.SetZSpacingTolerance(1e-3); >> IPPs.Sort(seriesFilenames_stdVector); >> >> // Convert the sorted std::vector back to vtkStringArray to be able to >> use with vtkGDCMImageReader... >> vtkSmartPointer seriesFilenames_vtkStringArray_sorted = >> vtkSmartPointer::New(); >> for (size_t i=0; i> >> >> seriesFilenames_vtkStringArray_sorted->InsertNextValue(IPPs.GetFilenames().at(i)); >> } >> >> // GDCM reader >> vtkSmartPointer gdcmReader = >> vtkSmartPointer::New(); >> gdcmReader->SetFileNames(seriesFilenames_vtkStringArray_sorted); >> gdcmReader->FileLowerLeftOn(); >> >> // correct z-spacing >> vtkSmartPointer changeInfo = >> vtkSmartPointer::New(); >> changeInfo->SetInputConnection(gdcmReader->GetOutputPort()); >> changeInfo->SetOutputSpacing(gdcmReader->GetOutput()->GetSpacing()[0], >> gdcmReader->GetOutput()->GetSpacing()[1], IPPs.GetZSpacing()); >> changeInfo->Update(); >> >> // Marching cubes >> vtkSmartPointer gdcmMC = >> vtkSmartPointer::New(); >> gdcmMC->SetInputConnection(changeInfo->GetOutputPort()); >> gdcmMC->SetNumberOfContours(1); >> gdcmMC->GenerateValues(1,700.,3000.); >> >> vtkSmartPointer gdcmNormals = >> vtkSmartPointer::New(); >> gdcmNormals->SetInputConnection(gdcmMC->GetOutputPort()); >> gdcmNormals->SetFeatureAngle(60.0); >> >> vtkSmartPointer gdcmStripper = >> vtkSmartPointer::New(); >> gdcmStripper->SetInputConnection(gdcmNormals->GetOutputPort()); >> >> vtkSmartPointer gdcmMapper = >> vtkSmartPointer::New(); >> gdcmMapper->SetInputConnection(gdcmStripper->GetOutputPort()); >> gdcmMapper->ScalarVisibilityOff(); >> gdcmMapper->Update(); >> >> vtkSmartPointer gdcmActor = vtkSmartPointer::New(); >> gdcmActor->SetMapper(gdcmMapper); >> gdcmActor->GetProperty()->SetColor(1.0,0.0,0.0); >> gdcmActor->GetProperty()->SetOpacity(1.); >> >> renderer->AddActor(gdcmActor); >> >> >> // >> >> -------------------------------------------------------------------------------------------- >> // >> // >> // vtkDICOMReader >> // >> // >> >> -------------------------------------------------------------------------------------------- >> // >> >> // DCM reader >> vtkSmartPointer dcmReader = >> vtkSmartPointer::New(); >> dcmReader->SetFileNames(seriesFilenames); >> dcmReader->Update(); >> >> // Marching cubes >> vtkSmartPointer dcmMC = >> vtkSmartPointer::New(); >> dcmMC->SetInputConnection(dcmReader->GetOutputPort()); >> dcmMC->SetNumberOfContours(1); >> dcmMC->GenerateValues(1,700.,3000.); >> >> vtkSmartPointer dcmNormals = >> vtkSmartPointer::New(); >> dcmNormals->SetInputConnection(dcmMC->GetOutputPort()); >> dcmNormals->SetFeatureAngle(60.0); >> >> vtkSmartPointer dcmStripper = >> vtkSmartPointer::New(); >> dcmStripper->SetInputConnection(dcmNormals->GetOutputPort()); >> >> vtkSmartPointer dcmMapper = >> vtkSmartPointer::New(); >> dcmMapper->SetInputConnection(dcmStripper->GetOutputPort()); >> dcmMapper->ScalarVisibilityOff(); >> dcmMapper->Update(); >> >> vtkSmartPointer dcmActor = vtkSmartPointer::New(); >> dcmActor->SetUserMatrix(dcmReader->GetPatientMatrix()); >> dcmActor->SetMapper(dcmMapper); >> dcmActor->GetProperty()->SetColor(0.0,1.0,0.0); >> dcmActor->GetProperty()->SetOpacity(1.); >> >> renderer->AddActor(dcmActor); >> >> // >> >> -------------------------------------------------------------------------------------------- >> // >> // >> // Orientation cube >> // >> // >> >> -------------------------------------------------------------------------------------------- >> // >> >> vtkSmartPointer annotatedCubeActor = >> vtkSmartPointer::New(); >> annotatedCubeActor->SetXPlusFaceText ("L (+X)"); >> annotatedCubeActor->SetXMinusFaceText("R (-X)"); >> annotatedCubeActor->SetYPlusFaceText ("P (+Y)"); >> annotatedCubeActor->SetYMinusFaceText("A (-Y)"); >> annotatedCubeActor->SetZPlusFaceText ("S (+Z)"); >> annotatedCubeActor->SetZMinusFaceText("I (-Z)"); >> annotatedCubeActor->SetZFaceTextRotation(90); >> annotatedCubeActor->GetCubeProperty()->SetColor(0.5, 1.0, 1.0); >> annotatedCubeActor->GetTextEdgesProperty()->SetLineWidth(1.0); >> annotatedCubeActor->GetTextEdgesProperty()->SetDiffuse(0.0); >> annotatedCubeActor->GetTextEdgesProperty()->SetAmbient(1.0); >> annotatedCubeActor->GetTextEdgesProperty()->SetColor(0.18, 0.28, 0.23); >> annotatedCubeActor->SetFaceTextScale(0.2); >> >> annotatedCubeActor->GetXPlusFaceProperty()->SetColor(0.0,0.0,1.0); >> annotatedCubeActor->GetXPlusFaceProperty()->SetInterpolationToFlat(); >> annotatedCubeActor->GetXMinusFaceProperty()->SetColor(0.0,0.0,1.0); >> annotatedCubeActor->GetXMinusFaceProperty()->SetInterpolationToFlat(); >> >> annotatedCubeActor->GetYPlusFaceProperty()->SetColor(0.0,1.0,0.0); >> annotatedCubeActor->GetYPlusFaceProperty()->SetInterpolationToFlat(); >> annotatedCubeActor->GetYMinusFaceProperty()->SetColor(0.0,1.0,0.0); >> annotatedCubeActor->GetYMinusFaceProperty()->SetInterpolationToFlat(); >> >> annotatedCubeActor->GetZPlusFaceProperty()->SetColor(1.0,0.0,0.0); >> annotatedCubeActor->GetZPlusFaceProperty()->SetInterpolationToFlat(); >> annotatedCubeActor->GetZMinusFaceProperty()->SetColor(1.0,0.0,0.0); >> annotatedCubeActor->GetZMinusFaceProperty()->SetInterpolationToFlat(); >> >> vtkSmartPointer widget = >> vtkSmartPointer::New(); >> widget->SetOutlineColor( 0.9300, 0.5700, 0.1300 ); >> widget->SetOrientationMarker( annotatedCubeActor ); >> widget->SetInteractor( renWinInt ); >> widget->SetViewport( 0.0, 0.0, 0.2, 0.2 ); >> widget->SetEnabled( 1 ); >> widget->InteractiveOn(); >> >> // >> >> -------------------------------------------------------------------------------------------- >> // >> // >> // Render >> // >> // >> >> -------------------------------------------------------------------------------------------- >> // >> >> renderer->ResetCamera(); >> renWin->Render(); >> renWinInt->Start(); >> return 0; >> } >> From sur.chiranjib at gmail.com Mon Apr 4 06:18:11 2016 From: sur.chiranjib at gmail.com (Chiranjib Sur) Date: Mon, 4 Apr 2016 15:48:11 +0530 Subject: [vtkusers] determine points on the surface of a polydata Message-ID: Hi All, I am wondering if there is any method to determine whether a given point is on the surface of a polydata? The following example : http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject shows how to determine whether a point is inside or outside of a polydata surface. What I am looking for is a method to determine if the point in just on the surface? Any help? Thanks much for your time and suggestions. Chiranjib -------------- next part -------------- An HTML attachment was scrubbed... URL: From ultam93 at yahoo.com Mon Apr 4 06:37:36 2016 From: ultam93 at yahoo.com (c_mihai) Date: Mon, 4 Apr 2016 03:37:36 -0700 (MST) Subject: [vtkusers] determine points on the surface of a polydata In-Reply-To: References: Message-ID: <1459766256047-5737512.post@n5.nabble.com> vtkPolyData has a function called FindPoint which it inherits from here: http://www.vtk.org/doc/nightly/html/classvtkDataSet.html#ad01fb4f295210a2c707801cb7c3da5ce I've never used it, but maybe it helps you. -- View this message in context: http://vtk.1045678.n5.nabble.com/determine-points-on-the-surface-of-a-polydata-tp5737511p5737512.html Sent from the VTK - Users mailing list archive at Nabble.com. From jeff.baumes at kitware.com Mon Apr 4 07:39:14 2016 From: jeff.baumes at kitware.com (Jeff Baumes) Date: Mon, 04 Apr 2016 11:39:14 +0000 Subject: [vtkusers] vtkPlotting and vtkTable In-Reply-To: <1459509408521-5737478.post@n5.nabble.com> References: <1459509408521-5737478.post@n5.nabble.com> Message-ID: I am guessing the Java wrappers do not handle functions that take vtkVariant as arguments, which allows you to pass strings, numbers, etc. to the same function. What you would do without that function is to insert into the various columns separately by calling e.g. xarr->SetTuple1(i, i * inc); HTH, Jeff On Fri, Apr 1, 2016 at 7:17 AM AlexUtrobin wrote: > I use Java VTK. > I am trying to repeat the example of > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/ScatterPlot > But vtkTable class does not contain a method setValue (table-> SetValue (i, > 0, i + 1);). > > Please, help me. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/vtkPlotting-and-vtkTable-tp5737478.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sur.chiranjib at gmail.com Mon Apr 4 07:50:40 2016 From: sur.chiranjib at gmail.com (Chiranjib Sur) Date: Mon, 4 Apr 2016 17:20:40 +0530 Subject: [vtkusers] determine points on the surface of a polydata In-Reply-To: <1459766256047-5737512.post@n5.nabble.com> References: <1459766256047-5737512.post@n5.nabble.com> Message-ID: Hi Mihai and others, Thank you for your input. The function "FindPoint" locate the closest point for a given point. But in my case, I want to know from a collection of points, which resides on the surface of a polydata. To start with I have just the coordinates of all the points which I need to examine. I am not sure, how I can use this "FindPoint" utility for my purpose. Any more help? Thanks and regards, Chiranjib On Mon, Apr 4, 2016 at 4:07 PM, c_mihai via vtkusers wrote: > vtkPolyData has a function called FindPoint which it inherits from here: > > http://www.vtk.org/doc/nightly/html/classvtkDataSet.html#ad01fb4f295210a2c707801cb7c3da5ce > > I've never used it, but maybe it helps you. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/determine-points-on-the-surface-of-a-polydata-tp5737511p5737512.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Michael.Bussler at visus.uni-stuttgart.de Mon Apr 4 08:45:50 2016 From: Michael.Bussler at visus.uni-stuttgart.de (=?iso-8859-1?Q?Michael_Bu=DFler?=) Date: Mon, 4 Apr 2016 12:45:50 +0000 Subject: [vtkusers] Prevent Pipeline Execution Message-ID: <50accdadf32748fb9b7f34e41168b2f5@impromptu.visus.uni-stuttgart.de> Hi, I have a question regarding the pipeline execution. My pipeline consists of some computational heavy modules, which are at the end triggered by a writer module. Now I want to prevent this pipeline to be executed, if the file, that is produced at the end, already exists. So far, I've tried to use RequestUpdateExtent() as it is called before RequestData() and I can get the time from outInfo: int vtkWritePolyData::RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) { vtkInformation *outInfo = outputVector->GetInformationObject(0); std::string timeStr; if( outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP())) { if(checkFileExists(outInfo) ) { request->Remove(vtkStreamingDemandDrivenPipeline::REQUEST_DATA()); outInfo->Set(vtkDemandDrivenPipeline::REQUEST_DATA_NOT_GENERATED()); } } return 1; } But the RequestData() method of my writer module is still being executed. How can I prevent the pipeline from being executed? Best, Michael -- Michael Bu?ler, Dipl.-Inf. Visualization Research Center, Universit?t Stuttgart (VISUS) Allmandring 19 70569 Stuttgart Germany mail: michael.bussler at visus.uni-stuttgart.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Mon Apr 4 09:06:05 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 4 Apr 2016 09:06:05 -0400 Subject: [vtkusers] Prevent Pipeline Execution In-Reply-To: <50accdadf32748fb9b7f34e41168b2f5@impromptu.visus.uni-stuttgart.de> References: <50accdadf32748fb9b7f34e41168b2f5@impromptu.visus.uni-stuttgart.de> Message-ID: Try this, In VTK >= 6.0, connect the writer to the output data produced by the pipeline instead of the algorithm's output port. writer->SetInputData(filter->GetOutput()) instead of writer->SetInputConnection(filter->GetOutputPort()) Than have your code call filter->Update(); writer->SetInputData(filter->GetOutput()); only when it needs to. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, Apr 4, 2016 at 8:45 AM, Michael Bu?ler < Michael.Bussler at visus.uni-stuttgart.de> wrote: > Hi, > > > > I have a question regarding the pipeline execution. > > My pipeline consists of some computational heavy modules, which are at the > end triggered by a writer module. > > Now I want to prevent this pipeline to be executed, if the file, that is > produced at the end, already exists. > > > > So far, I?ve tried to use RequestUpdateExtent() as it is called before > RequestData() and I can get the time from outInfo: > > > > int vtkWritePolyData::RequestUpdateExtent(vtkInformation* request, > vtkInformationVector** inputVector, vtkInformationVector* outputVector) > > { > > vtkInformation *outInfo = outputVector->GetInformationObject(0); > > > > std::string timeStr; > > if( > outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP())) { > > > > if(checkFileExists(outInfo) ) > > { > > > request->Remove(vtkStreamingDemandDrivenPipeline::REQUEST_DATA()); > > > outInfo->Set(vtkDemandDrivenPipeline::REQUEST_DATA_NOT_GENERATED()); > > } > > } > > return 1; > > } > > > > But the RequestData() method of my writer module is still being executed. > > > > How can I prevent the pipeline from being executed? > > > > Best, Michael > > > > -- > Michael Bu?ler, Dipl.-Inf. > Visualization Research Center, Universit?t Stuttgart (VISUS) Allmandring 19 > 70569 Stuttgart > Germany > > mail: michael.bussler at visus.uni-stuttgart.de > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Apr 4 09:23:45 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 4 Apr 2016 07:23:45 -0600 Subject: [vtkusers] vtkDICOMReader and vtkGDCMImageReader orientation In-Reply-To: References: <1459515146888-5737481.post@n5.nabble.com> Message-ID: On Mon, Apr 4, 2016 at 4:09 AM, Richard Brown wrote: > > I read that scaling, reflection/rotation, shear and translation are > included in the 4x4 matrix. Given that shear is included in this matrix, > shouldn?t gantry tilt be accounted for when I use GetPatientMatrix()? > Yes, the shear will be will be included in the matrix. However, the marching cubes algorithm expects a rectangular volume and will produce incorrect results if given a sheared volume (unless the shear is very small). Actually, pretty much any image processing algorithm that looks at voxel neighbors will give incorrect results if the degree of shear is such that the neighbors found by connectivity (i.e. connected by faces) are not the nearest voxels in the spatial sense (i.e. by center-to-center distance). Imagine a CT voxel that is 1mm x 1mm x 5mm. Now imagine that the slice-to-slice shear is greater than 1mm, and draw the resulting parallelogram and its neighbors, and hopefully you'll see the problem. Even basic operations like linear interpolation give poor results in such a situation, because the neighbors by connectivity are not the nearest neighbors spatially. Hence, a gantry-titled CT should be rectified before any 3D processing is applied to it. It can be un-rectified (re-sheared) before saving it back to disk. The in-plane resolution of CT is generally very good (1mm or better) so rectification and de-rectification has very little impact on image quality. And then moving on from 3D surfaces? > > If I didn?t want to produce 3D surfaces; if I wanted to manipulate > vtkImageData, is there any precautions I should take? > > For example, if I want to superpose DICOM RT-Structures or other surfaces > (notably .STL in my case) onto my vtkImageData, do I need to apply any sort > of matrix to either the DICOM vtkImageData or the superposed structures to > make sure that they superpose in the correct position with the correct > orientation? > My approach is to apply the matrix when I render the image data. The vtkImageActor, vtkImageSlice, vtkVolume etc. have a SetUserMatrix() method that you can use to correctly orient the image within the world coordinate system. Generally, this means that I also have to correctly set the camera position and focal point in order to get the desired view of the image. And lastly, to get the world coordinates (x,y,z) from my vtkImageData > coordinates (i,j,k), do I simply apply the GetPatientMatrix()? Is there a > method for this? And the same question applies for world coordinate ?> > index coordinate conversions - I assume I calculate the inverse matrix and > apply that in a similar fashion? The vtkImageData (i,j,k) coords are called "structured coordinates" in VTK-speak. Applying the Origin and Spacing to these coords gives the "data coordinates". VTK's data processing filters work in data coordinates, and if the spacing & origin are in millimeters, then the data coordinates are also in millimeters. The patient matrix must be applied to the data coordinates, not to the structured coordinates. Yes, there is probably a method to convert structured coords to data coords, but I always just explicitly multiply by the spacing and add the origin. Cheers, - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lonie at kitware.com Mon Apr 4 09:30:23 2016 From: david.lonie at kitware.com (David Lonie) Date: Mon, 4 Apr 2016 09:30:23 -0400 Subject: [vtkusers] Error in compiling vtkGenericDataArray.txx In-Reply-To: References: Message-ID: Hmm, seems like our testing builds missed this error. Ben, is there another windows build we should have? We do seem a bit light on windows release builds. As for the error, try adding: #include to the top of vtkGenericDataArray.txx fix the error? It should, and if so, I'll push a patch to fix it today. Thanks for the report, Dave On Sun, Apr 3, 2016 at 11:57 PM, ??? wrote: > while compiling nightly build vtk_master trunk, with DEBUG options > > there are many instance of error c2668: > > error c2668: '_wassert' : ambiguous call to overloaded function > > this error message is not exists while using RELEASE options. > > this error message exists either by Visual studio 2008 or by Visual studio > 2015, this error message valid through XP, win7 and win10 > > there are many occurency through building vtk library, and shows only with > vtkGenericDataArray.txx > > is there any method or patch to bypass this error message > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shawn.waldon at kitware.com Mon Apr 4 09:41:05 2016 From: shawn.waldon at kitware.com (Shawn Waldon) Date: Mon, 4 Apr 2016 09:41:05 -0400 Subject: [vtkusers] Error in compiling vtkGenericDataArray.txx In-Reply-To: References: Message-ID: Dave, We are missing two windows build machines that have died recently. Unfortunately, we don't have any replacements ready to go and I'm not sure we've ordered the replacements yet. We don't appear to have a windows debug mode build even on the dead machines though. When we get a new Windows machine I'll make sure to add a debug mode build to it. Ben, How is that new Windows machine coming? Shawn On Mon, Apr 4, 2016 at 9:30 AM, David Lonie wrote: > Hmm, seems like our testing builds missed this error. Ben, is there > another windows build we should have? We do seem a bit light on windows > release builds. > > As for the error, try adding: > > #include > > to the top of vtkGenericDataArray.txx fix the error? > > It should, and if so, I'll push a patch to fix it today. > > Thanks for the report, > Dave > > On Sun, Apr 3, 2016 at 11:57 PM, ??? wrote: > >> while compiling nightly build vtk_master trunk, with DEBUG options >> >> there are many instance of error c2668: >> >> error c2668: '_wassert' : ambiguous call to overloaded function >> >> this error message is not exists while using RELEASE options. >> >> this error message exists either by Visual studio 2008 or by Visual >> studio 2015, this error message valid through XP, win7 and win10 >> >> there are many occurency through building vtk library, and shows only >> with vtkGenericDataArray.txx >> >> is there any method or patch to bypass this error message >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Mon Apr 4 09:44:35 2016 From: tjlp at netease.com (Liu_tj) Date: Mon, 4 Apr 2016 21:44:35 +0800 (CST) Subject: [vtkusers] how to get the vtkImageData of current slice for vtkImageViewer2 Message-ID: <68f9bd53.8.153e1849212.Coremail.tjlp@netease.com> Hi, VTk guys, If I uses vtkImageViewer2 to display DICOM series, how to get the vtkImageData of current slice for vtkImageViewer2? Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lonie at kitware.com Mon Apr 4 09:50:40 2016 From: david.lonie at kitware.com (David Lonie) Date: Mon, 4 Apr 2016 09:50:40 -0400 Subject: [vtkusers] Error in compiling vtkGenericDataArray.txx In-Reply-To: References: Message-ID: On Mon, Apr 4, 2016 at 9:41 AM, Shawn Waldon wrote: > When we get a new Windows machine I'll make sure to add a debug mode build to it. Awesome, sounds great! :D -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lonie at kitware.com Mon Apr 4 09:52:08 2016 From: david.lonie at kitware.com (David Lonie) Date: Mon, 4 Apr 2016 09:52:08 -0400 Subject: [vtkusers] Error in compiling vtkGenericDataArray.txx In-Reply-To: References: Message-ID: On Mon, Apr 4, 2016 at 9:50 AM, David Lonie wrote: > On Mon, Apr 4, 2016 at 9:41 AM, Shawn Waldon wrote: > > When we get a new Windows machine I'll make sure to add a debug mode build to it. > > Awesome, sounds great! :D Rereading my first email, I did mean debug builds, not release. Glad you knew what I meant. Time for more coffee... -------------- next part -------------- An HTML attachment was scrubbed... URL: From onlyjus at gmail.com Mon Apr 4 10:11:44 2016 From: onlyjus at gmail.com (Justin Weber) Date: Mon, 4 Apr 2016 10:11:44 -0400 Subject: [vtkusers] Problem building VTK against Anaconda Qt In-Reply-To: <570187B202000082000EA678@gatedom1.upstate.edu> References: <570187B202000082000EA678@gatedom1.upstate.edu> Message-ID: Why not use conda's version? >>> conda install vtk On Sun, Apr 3, 2016 at 9:13 PM, Kent Ogden wrote: > Hi, > > I have been trying to build VTK (and ITK) with Python bindings for use in > Anaconda2. I am using VS 2015 on Win 7 with the most recent Anaconda and > VTK 6.3 (I get the same problem with version 7). Most of VTK builds > properly, but I get link errors for a few of the projects: > > 226>QVTKWidget.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: class QImage & __cdecl > QImage::operator=(class QImage &&)" (__imp_??4QImage@@QEAAAEAV0@$$QEAV0@@Z) > referenced in function "protected: virtual void __cdecl > QVTKWidget::paintEvent(class QPaintEvent *)" ( > ?paintEvent at QVTKWidget@@MEAAXPEAVQPaintEvent@@@Z) > 226>QVTKPaintEngine.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: class QPixmap & __cdecl > QPixmap::operator=(class QPixmap &&)" ( > __imp_??4QPixmap@@QEAAAEAV0@$$QEAV0@@Z) referenced in function "public: > virtual void __cdecl QVTKPaintEngine::drawPixmap(class QRectF const &,class > QPixmap const &,class QRectF const &)" ( > ?drawPixmap at QVTKPaintEngine@@UEAAXAEBVQRectF@@AEBVQPixmap@@0 at Z) > 226>vtkQtTableModelAdapter.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: class QString & __cdecl > QString::operator=(class QString &&)" ( > __imp_??4QString@@QEAAAEAV0@$$QEAV0@@Z) referenced in function "private: > void __cdecl vtkQtTableModelAdapter::updateModelColumnHashTables(void)" ( > ?updateModelColumnHashTables at vtkQtTableModelAdapter@@AEAAXXZ) > 226>C:\KW\VTKBuild\bin\Release\vtkGUISupportQt-6.3.dll : fatal error > LNK1120: 3 unresolved externals > 232>------ Build started: Project: vtkRenderingQt, Configuration: Release > x64 ------ > 233>------ Build started: Project: vtkGUISupportQtOpenGL, Configuration: > Release x64 ------ > 232> Building Custom Rule C:/KW/VTK-6.3.0/Rendering/Qt/CMakeLists.txt > 233> Building Custom Rule > C:/KW/VTK-6.3.0/GUISupport/QtOpenGL/CMakeLists.txt > > I am not very experienced with Qt, could there be something missing from > the Anaconda distro that is causing this error? This is preventing me from > importing vtk in Python, the process halts because of the missing dll. > > Thanks for any thoughts/comments/suggestions. > > Kent > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Mon Apr 4 10:47:39 2016 From: rickfrank at me.com (Richard Frank) Date: Mon, 04 Apr 2016 14:47:39 +0000 (GMT) Subject: [vtkusers] =?utf-8?q?Error_in_vtkOpenGLGPUVolumeRayCastMapper=2Ec?= =?utf-8?q?xx=2C_continued?= Message-ID: <66b68387-8b1a-4af8-a6ba-5d28af347b2f@me.com> Hi, Here is a portion of code: volumeProperty->SetColor(0, colorTransferFunction); volumeProperty->SetColor(1, maskColorTransferFunction); volumeProperty->SetScalarOpacity(opacityTransferFunction); volumeProperty->SetGradientOpacity(volumeGradientOpacityFunction); volumeProperty->SetInterpolationTypeToLinear(); volumeProperty->ShadeOn(); volumeProperty->SetAmbient(0.4); volumeProperty->SetDiffuse(0.8); volumeProperty->SetSpecular(0.2); volumeProperty->SetSpecularPower(105.0); volumeProperty->SetScalarOpacityUnitDistance(0.7); volume->SetProperty(volumeProperty); The hard coded numbers are just picked empirically by viewing our most common inputs. On Apr 03, 2016, at 10:26 PM, Aashish Chaudhary wrote: Rick,? Can you send me information on what you are turning on in volume property and in mapper that leads to this crash? Also, is your data is single or 2 or 4 component?? Thanks, On Sun, Apr 3, 2016 at 9:25 PM, Richard Frank wrote: Further investigation seems to point the GradientOpacity section of shader ?raycasterfs.glsl, code which seems to?be?inserted at runtime: I guess gl_aspect is not defined in this scenario? Any suggestions welcome! Rick vec4 computeGradient() 145: { 146: vec3 g1; 147: vec4 g2; 148: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; 149: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; 150: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; 151: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; 152: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; 153: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; 154: g1 = g1*in_volume_scale.r + in_volume_bias.r; 155: g2 = g2*in_volume_scale.r + in_volume_bias.r; 156: g1.x = in_scalarsRange[0] + ( 157: in_scalarsRange[1] - in_scalarsRange[0]) * g1.x; 158: g1.y = in_scalarsRange[0] + ( 159: in_scalarsRange[1] - in_scalarsRange[0]) * g1.y; 160: g1.z = in_scalarsRange[0] + ( 161: in_scalarsRange[1] - in_scalarsRange[0]) * g1.z; 162: g2.x = in_scalarsRange[0] + ( 163: in_scalarsRange[1] - in_scalarsRange[0]) * g2.x; 164: g2.y = in_scalarsRange[0] + ( 165: in_scalarsRange[1] - in_scalarsRange[0]) * g2.y; 166: g2.z = in_scalarsRange[0] + ( 167: in_scalarsRange[1] - in_scalarsRange[0]) * g2.z; 168: g2.xyz = g1 - g2.xyz; 169: g2.x /= g_aspect.x; 170: g2.y /= g_aspect.y; 171: g2.z /= g_aspect.z; 172: float grad_mag = sqrt(g2.x * g2.x + 173: g2.y * g2.y + 174: g2.z * g2.z); 175: if (grad_mag > 0.0) 176: { 177: g2.x /= grad_mag; 178: g2.y /= grad_mag; 179: g2.z /= grad_mag; 180: } 181: else 182: { 183: g2.xyz = vec3(0.0, 0.0, 0.0); 184: } 185: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[1] - 186: (in_scalarsRange[0]))); 187: grad_mag = clamp(grad_mag, 0.0, 1.0); 188: g2.w = grad_mag; 189: return g2; 190: } _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- | Aashish Chaudhary | Technical Leader ? ? ? ?? | Kitware Inc.? ? ? ? ? ? |?http://www.kitware.com/company/team/chaudhary.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Mon Apr 4 10:53:46 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Mon, 4 Apr 2016 10:53:46 -0400 Subject: [vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx, continued In-Reply-To: <66b68387-8b1a-4af8-a6ba-5d28af347b2f@me.com> References: <66b68387-8b1a-4af8-a6ba-5d28af347b2f@me.com> Message-ID: Thanks, and are you using VTK master as of last week since we had this problem and got fixed recently. - Aashish On Mon, Apr 4, 2016 at 10:47 AM, Richard Frank wrote: > Hi, > > Here is a portion of code: > > > volumeProperty->SetColor(0, colorTransferFunction); > volumeProperty->SetColor(1, maskColorTransferFunction); > volumeProperty->SetScalarOpacity(opacityTransferFunction); > volumeProperty->SetGradientOpacity(volumeGradientOpacityFunction); > volumeProperty->SetInterpolationTypeToLinear(); > volumeProperty->ShadeOn(); > volumeProperty->SetAmbient(0.4); > volumeProperty->SetDiffuse(0.8); > volumeProperty->SetSpecular(0.2); > volumeProperty->SetSpecularPower(105.0); > volumeProperty->SetScalarOpacityUnitDistance(0.7); > volume->SetProperty(volumeProperty); > > The hard coded numbers are just picked empirically by viewing our most > common inputs. > > On Apr 03, 2016, at 10:26 PM, Aashish Chaudhary < > aashish.chaudhary at kitware.com> wrote: > > Rick, > > Can you send me information on what you are turning on in volume property > and in mapper that leads to this crash? Also, is your data is single or 2 > or 4 component? > > Thanks, > > > On Sun, Apr 3, 2016 at 9:25 PM, Richard Frank wrote: > >> Further investigation seems to point the GradientOpacity section of >> shader raycasterfs.glsl, code which seems to be inserted at runtime: I >> guess gl_aspect is not defined in this scenario? >> >> Any suggestions welcome! >> >> Rick >> >> vec4 computeGradient() >> 145: { >> 146: vec3 g1; >> 147: vec4 g2; >> 148: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; >> 149: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; >> 150: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; >> 151: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; >> 152: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; >> 153: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; >> 154: g1 = g1*in_volume_scale.r + in_volume_bias.r; >> 155: g2 = g2*in_volume_scale.r + in_volume_bias.r; >> 156: g1.x = in_scalarsRange[0] + ( >> 157: in_scalarsRange[1] - in_scalarsRange[0]) * g1.x; >> 158: g1.y = in_scalarsRange[0] + ( >> 159: in_scalarsRange[1] - in_scalarsRange[0]) * g1.y; >> 160: g1.z = in_scalarsRange[0] + ( >> 161: in_scalarsRange[1] - in_scalarsRange[0]) * g1.z; >> 162: g2.x = in_scalarsRange[0] + ( >> 163: in_scalarsRange[1] - in_scalarsRange[0]) * g2.x; >> 164: g2.y = in_scalarsRange[0] + ( >> 165: in_scalarsRange[1] - in_scalarsRange[0]) * g2.y; >> 166: g2.z = in_scalarsRange[0] + ( >> 167: in_scalarsRange[1] - in_scalarsRange[0]) * g2.z; >> 168: g2.xyz = g1 - g2.xyz; >> 169: g2.x /= g_aspect.x; >> 170: g2.y /= g_aspect.y; >> 171: g2.z /= g_aspect.z; >> 172: float grad_mag = sqrt(g2.x * g2.x + >> 173: g2.y * g2.y + >> 174: g2.z * g2.z); >> 175: if (grad_mag > 0.0) >> 176: { >> 177: g2.x /= grad_mag; >> 178: g2.y /= grad_mag; >> 179: g2.z /= grad_mag; >> 180: } >> 181: else >> 182: { >> 183: g2.xyz = vec3(0.0, 0.0, 0.0); >> 184: } >> 185: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[1] - >> 186: (in_scalarsRange[0]))); >> 187: grad_mag = clamp(grad_mag, 0.0, 1.0); >> 188: g2.w = grad_mag; >> 189: return g2; >> 190: } >> >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Mon Apr 4 11:48:08 2016 From: rickfrank at me.com (Richard Frank) Date: Mon, 04 Apr 2016 15:48:08 +0000 (GMT) Subject: [vtkusers] =?utf-8?q?Error_in_vtkOpenGLGPUVolumeRayCastMapper=2Ec?= =?utf-8?q?xx=2C_continued?= Message-ID: No I'm using 7.0.0 release not a git clone. I guess I should get the latest?? Rick On Apr 04, 2016, at 10:53 AM, Aashish Chaudhary wrote: Thanks, and are you using VTK master as of last week since we had this problem and got fixed recently. ? - Aashish On Mon, Apr 4, 2016 at 10:47 AM, Richard Frank wrote: Hi, Here is a portion of code: volumeProperty->SetColor(0, colorTransferFunction); volumeProperty->SetColor(1, maskColorTransferFunction); volumeProperty->SetScalarOpacity(opacityTransferFunction); volumeProperty->SetGradientOpacity(volumeGradientOpacityFunction); volumeProperty->SetInterpolationTypeToLinear(); volumeProperty->ShadeOn(); volumeProperty->SetAmbient(0.4); volumeProperty->SetDiffuse(0.8); volumeProperty->SetSpecular(0.2); volumeProperty->SetSpecularPower(105.0); volumeProperty->SetScalarOpacityUnitDistance(0.7); volume->SetProperty(volumeProperty); The hard coded numbers are just picked empirically by viewing our most common inputs. On Apr 03, 2016, at 10:26 PM, Aashish Chaudhary wrote: Rick,? Can you send me information on what you are turning on in volume property and in mapper that leads to this crash? Also, is your data is single or 2 or 4 component?? Thanks, On Sun, Apr 3, 2016 at 9:25 PM, Richard Frank wrote: Further investigation seems to point the GradientOpacity section of shader ?raycasterfs.glsl, code which seems to?be?inserted at runtime: I guess gl_aspect is not defined in this scenario? Any suggestions welcome! Rick vec4 computeGradient() 145: { 146: vec3 g1; 147: vec4 g2; 148: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; 149: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; 150: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; 151: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; 152: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; 153: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; 154: g1 = g1*in_volume_scale.r + in_volume_bias.r; 155: g2 = g2*in_volume_scale.r + in_volume_bias.r; 156: g1.x = in_scalarsRange[0] + ( 157: in_scalarsRange[1] - in_scalarsRange[0]) * g1.x; 158: g1.y = in_scalarsRange[0] + ( 159: in_scalarsRange[1] - in_scalarsRange[0]) * g1.y; 160: g1.z = in_scalarsRange[0] + ( 161: in_scalarsRange[1] - in_scalarsRange[0]) * g1.z; 162: g2.x = in_scalarsRange[0] + ( 163: in_scalarsRange[1] - in_scalarsRange[0]) * g2.x; 164: g2.y = in_scalarsRange[0] + ( 165: in_scalarsRange[1] - in_scalarsRange[0]) * g2.y; 166: g2.z = in_scalarsRange[0] + ( 167: in_scalarsRange[1] - in_scalarsRange[0]) * g2.z; 168: g2.xyz = g1 - g2.xyz; 169: g2.x /= g_aspect.x; 170: g2.y /= g_aspect.y; 171: g2.z /= g_aspect.z; 172: float grad_mag = sqrt(g2.x * g2.x + 173: g2.y * g2.y + 174: g2.z * g2.z); 175: if (grad_mag > 0.0) 176: { 177: g2.x /= grad_mag; 178: g2.y /= grad_mag; 179: g2.z /= grad_mag; 180: } 181: else 182: { 183: g2.xyz = vec3(0.0, 0.0, 0.0); 184: } 185: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[1] - 186: (in_scalarsRange[0]))); 187: grad_mag = clamp(grad_mag, 0.0, 1.0); 188: g2.w = grad_mag; 189: return g2; 190: } _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- | Aashish Chaudhary | Technical Leader ? ? ? ?? | Kitware Inc.? ? ? ? ? ? |?http://www.kitware.com/company/team/chaudhary.html -- | Aashish Chaudhary | Technical Leader ? ? ? ?? | Kitware Inc.? ? ? ? ? ? |?http://www.kitware.com/company/team/chaudhary.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Mon Apr 4 11:49:35 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Mon, 4 Apr 2016 11:49:35 -0400 Subject: [vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx, continued In-Reply-To: References: Message-ID: Yes please. If you can checkout the latest master, this should not happen. Thanks, Aashish On Mon, Apr 4, 2016 at 11:48 AM, Richard Frank wrote: > No I'm using 7.0.0 release not a git clone. > > I guess I should get the latest? > > Rick > > > On Apr 04, 2016, at 10:53 AM, Aashish Chaudhary < > aashish.chaudhary at kitware.com> wrote: > > Thanks, and are you using VTK master as of last week since we had this > problem and got fixed recently. > > - Aashish > > On Mon, Apr 4, 2016 at 10:47 AM, Richard Frank wrote: > >> Hi, >> >> Here is a portion of code: >> >> >> volumeProperty->SetColor(0, colorTransferFunction); >> volumeProperty->SetColor(1, maskColorTransferFunction); >> volumeProperty->SetScalarOpacity(opacityTransferFunction); >> volumeProperty->SetGradientOpacity(volumeGradientOpacityFunction); >> volumeProperty->SetInterpolationTypeToLinear(); >> volumeProperty->ShadeOn(); >> volumeProperty->SetAmbient(0.4); >> volumeProperty->SetDiffuse(0.8); >> volumeProperty->SetSpecular(0.2); >> volumeProperty->SetSpecularPower(105.0); >> volumeProperty->SetScalarOpacityUnitDistance(0.7); >> volume->SetProperty(volumeProperty); >> >> The hard coded numbers are just picked empirically by viewing our most >> common inputs. >> >> On Apr 03, 2016, at 10:26 PM, Aashish Chaudhary < >> aashish.chaudhary at kitware.com> wrote: >> >> Rick, >> >> Can you send me information on what you are turning on in volume property >> and in mapper that leads to this crash? Also, is your data is single or 2 >> or 4 component? >> >> Thanks, >> >> >> On Sun, Apr 3, 2016 at 9:25 PM, Richard Frank wrote: >> >>> Further investigation seems to point the GradientOpacity section of >>> shader raycasterfs.glsl, code which seems to be inserted at runtime: I >>> guess gl_aspect is not defined in this scenario? >>> >>> Any suggestions welcome! >>> >>> Rick >>> >>> vec4 computeGradient() >>> 145: { >>> 146: vec3 g1; >>> 147: vec4 g2; >>> 148: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; >>> 149: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; >>> 150: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; >>> 151: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; >>> 152: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; >>> 153: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; >>> 154: g1 = g1*in_volume_scale.r + in_volume_bias.r; >>> 155: g2 = g2*in_volume_scale.r + in_volume_bias.r; >>> 156: g1.x = in_scalarsRange[0] + ( >>> 157: in_scalarsRange[1] - in_scalarsRange[0]) * g1.x; >>> 158: g1.y = in_scalarsRange[0] + ( >>> 159: in_scalarsRange[1] - in_scalarsRange[0]) * g1.y; >>> 160: g1.z = in_scalarsRange[0] + ( >>> 161: in_scalarsRange[1] - in_scalarsRange[0]) * g1.z; >>> 162: g2.x = in_scalarsRange[0] + ( >>> 163: in_scalarsRange[1] - in_scalarsRange[0]) * g2.x; >>> 164: g2.y = in_scalarsRange[0] + ( >>> 165: in_scalarsRange[1] - in_scalarsRange[0]) * g2.y; >>> 166: g2.z = in_scalarsRange[0] + ( >>> 167: in_scalarsRange[1] - in_scalarsRange[0]) * g2.z; >>> 168: g2.xyz = g1 - g2.xyz; >>> 169: g2.x /= g_aspect.x; >>> 170: g2.y /= g_aspect.y; >>> 171: g2.z /= g_aspect.z; >>> 172: float grad_mag = sqrt(g2.x * g2.x + >>> 173: g2.y * g2.y + >>> 174: g2.z * g2.z); >>> 175: if (grad_mag > 0.0) >>> 176: { >>> 177: g2.x /= grad_mag; >>> 178: g2.y /= grad_mag; >>> 179: g2.z /= grad_mag; >>> 180: } >>> 181: else >>> 182: { >>> 183: g2.xyz = vec3(0.0, 0.0, 0.0); >>> 184: } >>> 185: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[1] - >>> 186: (in_scalarsRange[0]))); >>> 187: grad_mag = clamp(grad_mag, 0.0, 1.0); >>> 188: g2.w = grad_mag; >>> 189: return g2; >>> 190: } >>> >>> >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> >> >> -- >> >> >> >> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >> * >> *| http://www.kitware.com/company/team/chaudhary.html >> * >> >> > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.hirsch at st.ovgu.de Mon Apr 4 13:03:38 2016 From: jan.hirsch at st.ovgu.de (jhirsch) Date: Mon, 4 Apr 2016 10:03:38 -0700 (MST) Subject: [vtkusers] Simplify/Remesh UnstructuredGrid Message-ID: <1459789418960-5737529.post@n5.nabble.com> Hello guys, I'm having an unstructured grid that consists of points (with some scalar arrays) and cells. I'm doing a volume rendering with it using the vtkProjectedTetrahedraMapper. Now, I'm exasperated over trying to reduce the data, e.g. the density of the unstructured grid. I've tried two things so far: 1. Masking the points: This gives me a point cloud that preserves the scalars but losing all the cell data. Doing a volume rendering on that failed because there is no volume rendering algorithm in VTK that works solely on points. What would be the next step to get a working unstructuredGrid again? Delaunay3D messed up the mesh (imagine the mesh is like a 3-dimensional 'T', delaunay makes it look like a huge tetrahedron), vtkOrderedTriangulator loses the scalars. 2. Decimate the mesh: Using a vtkGeometryFilter in order to convert the unstructuredGrid into polydata, filter only triangles that decimating with vtkDecimatePro will work, and finally convert it back (with vtkAppendFilter) to a unstructuredGrid: Volume rendering this fails as well. I discovered that vtkTriangleFilter nealy strips all my cells away and the decimation leaves only a fraction of my points... Is there another alternative for creating a simple unstructuredGrid? Thanks a bunch! -- View this message in context: http://vtk.1045678.n5.nabble.com/Simplify-Remesh-UnstructuredGrid-tp5737529.html Sent from the VTK - Users mailing list archive at Nabble.com. From ben.boeckel at kitware.com Mon Apr 4 13:23:08 2016 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Mon, 4 Apr 2016 13:23:08 -0400 Subject: [vtkusers] Error in compiling vtkGenericDataArray.txx In-Reply-To: References: Message-ID: <20160404172308.GB6135@megas.khq.kitware.com> On Mon, Apr 04, 2016 at 09:41:05 -0400, Shawn Waldon wrote: > How is that new Windows machine coming? Week and a half to go before it arrives? Maybe two. --Ben From habe36 at gmail.com Mon Apr 4 22:28:14 2016 From: habe36 at gmail.com (ABE Hiroshi) Date: Tue, 5 Apr 2016 11:28:14 +0900 Subject: [vtkusers] wxPlaneWidget on OSX Message-ID: <4FA127E3-C507-4DB8-B88F-475675294E11@gmail.com> Dear all, This might be a known issue but I could find any description about it on the net so I ask you about vtkPlaneWidget. That is a weired behavior that the handles of vtkPlaneWidget is gone when you drag one of the handles. The sample program I used is available at: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/PlaneWidget Building it straightforwardly and get an executable program. The application launches as usual to display a VTK window. You can find a vtkPlaneWidget?s plane in the window, which has four handles. If you drag one of the handles suddenly the handle disappears. This is always happens on OSX (10.9.5, 10.10.5). The env. are: OS X 10.9.5 (iMac late 2013 21.5?) VTK 5.10.1 (with Apple Wireless Trackpad) OS X 10.10.5 (MBP Letina 13?) VTK 5.10.1 VTK 6.3.0 As an additional info. Run the same program on OpenSUSE 13 (VTK 5.10) on the Linux box itself, it works fine as expected. But if you display on iMac with XQuartz (2.7.8), the same problem happens. Anybody out there point me the way workaround or any suggestions to solve this. Thank you very much in advance. ABE Hiroshi from Tokorozawa, JAPAN From jothybasu at gmail.com Tue Apr 5 00:54:31 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Tue, 5 Apr 2016 14:54:31 +1000 Subject: [vtkusers] Movable cursor Message-ID: Hi All How can I draw a movable cursor on a 2D image. May be a silly question, but I couldn't think of which classes I should combine. Something like the one attached. Thanks Jothy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Untitled.png Type: image/png Size: 115747 bytes Desc: not available URL: From bmoonlu at yeah.net Tue Apr 5 04:59:30 2016 From: bmoonlu at yeah.net (=?UTF-8?B?6Lev5piO5pyI?=) Date: Tue, 5 Apr 2016 16:59:30 +0800 (CST) Subject: [vtkusers] how to draw polygons using vtkPolyData Message-ID: <68e3912f.21b1.153e5a5edac.Coremail.bmoonlu@yeah.net> Hi All, I have a question about vtkPolyData.I want to draw a polygon like shp.jpg. But when I use the vtkPolyData to draw, it gave me the result like shp2.jpg.Maybe I make a misunderstanding somewhere.Please help me to draw polygons by vtkPolyData. Thank you for your help. Your sincerely, Joy Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: shp.jpg Type: image/jpeg Size: 52274 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: shp2.jpg Type: image/jpeg Size: 57354 bytes Desc: not available URL: From amit112amit at yahoo.co.in Tue Apr 5 05:41:39 2016 From: amit112amit at yahoo.co.in (amit112amit) Date: Tue, 5 Apr 2016 02:41:39 -0700 (MST) Subject: [vtkusers] Paraview does delaunay3D but code fails with floating point exception Message-ID: <1459849299748-5737535.post@n5.nabble.com> Hi. I have a polydata file. I apply delaunay3D filter to it in paraview. I get a bunch of warnings saying "Unable to factor linear system". But the filter still produces desired output for my need. I am trying to achieve the same using code Delaunay3D example code from VTK website But the code always gives me a "Floating Point Exception (core dumped)". I am unable to understand how Paraview is able to do it and code is not. Can someone help? I have attached my input VTP file. T9real.vtp -- View this message in context: http://vtk.1045678.n5.nabble.com/Paraview-does-delaunay3D-but-code-fails-with-floating-point-exception-tp5737535.html Sent from the VTK - Users mailing list archive at Nabble.com. From juan at tf.uni-kiel.de Tue Apr 5 07:00:49 2016 From: juan at tf.uni-kiel.de (Julian Andrej) Date: Tue, 5 Apr 2016 13:00:49 +0200 Subject: [vtkusers] Writing exodus metadata with python Message-ID: <57039AE1.8060408@tf.uni-kiel.de> Hello, i'm trying to write metadata for NodeSets/SideSets to an exodus file using vtk. I have all the information i need to describe the NodeSet (Cell ids that belong to the NodeSet and the name). Is there any example that describes that? I tried to figure it out myself but came up with some issues. I understand that i have to fill a vtkModelMetadata object and call vtkModelMetadata::SetNumberOfNodeSets with the appropriate number of nodesets. Then i guess i have to set vtkModelMetaData::SetNodeSetSize but here is my problem of understanding: Not every nodeset has the same size of nodes! Or is it assumed, like in vtkModelMetadata::SetNodeSetNodeIdList that the argument for vtkModelMetaData::SetNodeSetSize contains a list with the mapping: entry 0: lengt of nodeset 0 entry 1: lengt of nodeset 1 and so on? I'd appreciate any help regarding my issue. Regards Julian Andrej From dave.demarle at kitware.com Tue Apr 5 09:28:06 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 5 Apr 2016 09:28:06 -0400 Subject: [vtkusers] how to draw polygons using vtkPolyData In-Reply-To: <68e3912f.21b1.153e5a5edac.Coremail.bmoonlu@yeah.net> References: <68e3912f.21b1.153e5a5edac.Coremail.bmoonlu@yeah.net> Message-ID: The rendering code does not support concave polygons. You will have to break that up convex polygons for OpenGL and thus VTK to draw it correctly. Apply vtkTriangleFilter to do that as suggested here http://markmail.org/thread/33ptqhti5zud4rcv David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Apr 5, 2016 at 4:59 AM, ??? wrote: > Hi All, > I have a question about vtkPolyData.I want to draw a polygon like shp.jpg. > But when I use the vtkPolyData to draw, it gave me the result like > shp2.jpg.Maybe I make a misunderstanding somewhere.Please help me to draw > polygons by vtkPolyData. > Thank you for your help. > Your sincerely, > Joy Wang > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Tue Apr 5 09:32:04 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 5 Apr 2016 09:32:04 -0400 Subject: [vtkusers] VTK 7 next release In-Reply-To: <56FD3D19.7090505@cora.nwra.com> References: <56FC5009.2020104@cora.nwra.com> <56FD3D19.7090505@cora.nwra.com> Message-ID: OK Orion, we'll do a 7.0.1 patch release in a few weeks time. It will be the current release branch with the recent gcc 6 fix ported onto back to it. To conserve energy we won't do the whole release candidate thing though. If people find problems we'll just make a 7.0.2. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, Mar 31, 2016 at 11:07 AM, Orion Poplawski wrote: > I would appreciate a patch release. I really don't think I can update the > package until there is a mechanism for the vtk using packages to > automatically > determine the back-end. Thanks! > > On 03/31/2016 08:08 AM, David E DeMarle wrote: > > This is in master so it will be in 7.1, but that won't be for a few > months still. > > I can merge this onto the release branch now. The release branch is > already a > > handful of commits (GL2 volume rendering updates mostly) beyond 7.0.0. > > > > I suppose this particular change makes a good case for 7.0.1 since it > lets > > external applications determine what back end they've got and that > seems, you > > know, kind of important eh? > > > > Show of hands, shall we do a patch release? > > > > Thanks as always Orion (and the other packagers) for packaging. It is a > great > > thing. > > > > > > David E DeMarle > > Kitware, Inc. > > R&D Engineer > > 21 Corporate Drive > > Clifton Park, NY 12065-8662 > > Phone: 518-881-4909 > > > > On Wed, Mar 30, 2016 at 6:15 PM, Orion Poplawski > > wrote: > > > > I'm holding off building VTK 7 for Fedora until this: > > > > > https://gitlab.kitware.com/vtk/vtk/commit/0c4cbd3f0393dadfe3a3df149414fe6e8ba4870a > > > > makes it into a release. Any idea when this might happen? > > > > Thanks. > > > > -- > > Orion Poplawski > > Technical Manager 303-415-9701 x222 > > > > NWRA, Boulder/CoRA Office FAX: 303-415-9702 303-415-9702> > > 3380 Mitchell Lane orion at nwra.com > > > > Boulder, CO 80301 http://www.nwra.com > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > > -- > Orion Poplawski > Technical Manager 303-415-9701 x222 > NWRA, Boulder/CoRA Office FAX: 303-415-9702 > 3380 Mitchell Lane orion at nwra.com > Boulder, CO 80301 http://www.nwra.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From livc at outlook.com Tue Apr 5 10:19:06 2016 From: livc at outlook.com (Zhao Li) Date: Tue, 5 Apr 2016 22:19:06 +0800 Subject: [vtkusers] Two errors when compiling VTK. Message-ID: I'm new to VTK.When I compile VTK in VS2013, I got two errors. Error4error C2668: '_wassert' : ambiguous call to overloaded functionf:\vtk\vtk-7.1-src\common\core\vtkGenericDataArray.txx281vtkFiltersCoreError46error LNK1104: cannot open file '..\..\..\lib\Debug\vtkFiltersCore-7.1.lib'F:\VTK\VTK-7.1-bin\Examples\DataManipulation\Cxx\LINKCube Help me please, thanks. With:WIN10 VS2013Pro VTK7.1 Qt5.5.1 CMake3.5.1 THX!!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lonie at kitware.com Tue Apr 5 10:31:51 2016 From: david.lonie at kitware.com (David Lonie) Date: Tue, 5 Apr 2016 10:31:51 -0400 Subject: [vtkusers] Two errors when compiling VTK. In-Reply-To: References: Message-ID: This is a bug that slipped past our automated testing for debugging builds on certain MSVC compilers. Can you try adding: #include to the top of VTK/Common/Core/vtkGenericDataArray.txx and let me know if compilation works? I'm waiting to hear confirmation that this fixes the issue before pushing the patch to master. Dave On Tue, Apr 5, 2016 at 10:19 AM, Zhao Li wrote: > I'm new to VTK. > When I compile VTK in VS2013, I got two errors. > > Error4error C2668: '_wassert' : ambiguous call to overloaded > functionf:\vtk\vtk-7.1-src\common\core\vtkGenericDataArray.txx281vtkFiltersCore > > Error46error LNK1104: cannot open file > '..\..\..\lib\Debug\vtkFiltersCore-7.1.lib'F:\VTK\VTK-7.1-bin\Examples\DataManipulation\Cxx\LINKCube > > Help me please, thanks. > > With: > WIN10 VS2013Pro VTK7.1 Qt5.5.1 CMake3.5.1 > > THX!!! > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zionman.hsu at gmail.com Tue Apr 5 10:53:18 2016 From: zionman.hsu at gmail.com (=?big5?B?rn2n07XY?=) Date: Tue, 5 Apr 2016 22:53:18 +0800 Subject: [vtkusers] Error in compiling vtkGenericDataArray.txx In-Reply-To: References: Message-ID: It seems not the solution. I tried this solution with master trunk archive of 4th, april, but the Error still issues with the Visual Studio 2015 debug build and Win10 By the way, I tried building vtk lib from master archive frequently, this error is not issued before, archive of 22nd, march, is the last archive that I built debug lib successfuly. Sincerely, Hsu _____ From: David Lonie [mailto:david.lonie at kitware.com] Sent: Monday, April 4, 2016 9:30 PM To: ??? Cc: vtkusers at vtk.org; Ben Boeckel Subject: Re: [vtkusers] Error in compiling vtkGenericDataArray.txx Hmm, seems like our testing builds missed this error. Ben, is there another windows build we should have? We do seem a bit light on windows release builds. As for the error, try adding: #include to the top of vtkGenericDataArray.txx fix the error? It should, and if so, I'll push a patch to fix it today. Thanks for the report, Dave On Sun, Apr 3, 2016 at 11:57 PM, ??? wrote: while compiling nightly build vtk_master trunk, with DEBUG options there are many instance of error c2668: error c2668: '_wassert' : ambiguous call to overloaded function this error message is not exists while using RELEASE options. this error message exists either by Visual studio 2008 or by Visual studio 2015, this error message valid through XP, win7 and win10 there are many occurency through building vtk library, and shows only with vtkGenericDataArray.txx is there any method or patch to bypass this error message _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lonie at kitware.com Tue Apr 5 10:54:36 2016 From: david.lonie at kitware.com (David Lonie) Date: Tue, 5 Apr 2016 10:54:36 -0400 Subject: [vtkusers] Error in compiling vtkGenericDataArray.txx In-Reply-To: References: Message-ID: On Tue, Apr 5, 2016 at 10:53 AM, ??? wrote: > It seems not the solution. > > I tried this solution with master trunk archive of 4th, april, but the > Error still issues with the Visual Studio 2015 debug build and Win10 > > By the way, I tried building vtk lib from master archive frequently, this > error is not issued before, archive of 22nd, march, is the last archive > that I built debug lib successfuly. > Thanks for the feedback. I'll find a windows box and give this a closer look. Thanks, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lonie at kitware.com Tue Apr 5 12:41:32 2016 From: david.lonie at kitware.com (David Lonie) Date: Tue, 5 Apr 2016 12:41:32 -0400 Subject: [vtkusers] Two errors when compiling VTK. In-Reply-To: References: Message-ID: One more time without the screenshot to decrease message size... On Tue, Apr 5, 2016 at 12:38 PM, David Lonie wrote: > Thanks for the feedback. I'm looking into this now. > > Dave > > On Tue, Apr 5, 2016 at 12:17 PM, Zhao Li wrote: > >> Thanks for your reply. >> I'm sorry to say that it seems that it doesn't work. >> [screenshot snipped] >> >> ------------------------------ >> From: david.lonie at kitware.com >> Date: Tue, 5 Apr 2016 10:31:51 -0400 >> Subject: Re: [vtkusers] Two errors when compiling VTK. >> To: livc at outlook.com >> CC: vtkusers at vtk.org >> >> >> This is a bug that slipped past our automated testing for debugging >> builds on certain MSVC compilers. >> >> Can you try adding: >> >> #include >> >> to the top of VTK/Common/Core/vtkGenericDataArray.txx and let me know if >> compilation works? I'm waiting to hear confirmation that this fixes the >> issue before pushing the patch to master. >> >> Dave >> >> On Tue, Apr 5, 2016 at 10:19 AM, Zhao Li wrote: >> >> I'm new to VTK. >> When I compile VTK in VS2013, I got two errors. >> >> Error4error C2668: '_wassert' : ambiguous call to overloaded >> functionf:\vtk\vtk-7.1-src\common\core\vtkGenericDataArray.txx281vtkFiltersCore >> >> Error46error LNK1104: cannot open file >> '..\..\..\lib\Debug\vtkFiltersCore-7.1.lib'F:\VTK\VTK-7.1-bin\Examples\DataManipulation\Cxx\LINKCube >> >> Help me please, thanks. >> >> With: >> WIN10 VS2013Pro VTK7.1 Qt5.5.1 CMake3.5.1 >> >> THX!!! >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From livc at outlook.com Tue Apr 5 12:46:50 2016 From: livc at outlook.com (Zhao Li) Date: Wed, 6 Apr 2016 00:46:50 +0800 Subject: [vtkusers] Two errors when compiling VTK. Message-ID: Sorry, it's my first time to communicate like this. Thanks for your help again. ________________________________ ????David Lonie ???2016?04?06? AM 12:41 ????Zhao Li ,vtkusers at vtk.org ???Re: [vtkusers] Two errors when compiling VTK. One more time without the screenshot to decrease message size... On Tue, Apr 5, 2016 at 12:38 PM, David Lonie wrote: > Thanks for the feedback. I'm looking into this now. > > Dave > > On Tue, Apr 5, 2016 at 12:17 PM, Zhao Li wrote: > >> Thanks for your reply. >> I'm sorry to say that it seems that it doesn't work. >> [screenshot snipped] >> >> ------------------------------ >> From: david.lonie at kitware.com >> Date: Tue, 5 Apr 2016 10:31:51 -0400 >> Subject: Re: [vtkusers] Two errors when compiling VTK. >> To: livc at outlook.com >> CC: vtkusers at vtk.org >> >> >> This is a bug that slipped past our automated testing for debugging >> builds on certain MSVC compilers. >> >> Can you try adding: >> >> #include >> >> to the top of VTK/Common/Core/vtkGenericDataArray.txx and let me know if >> compilation works? I'm waiting to hear confirmation that this fixes the >> issue before pushing the patch to master. >> >> Dave >> >> On Tue, Apr 5, 2016 at 10:19 AM, Zhao Li wrote: >> >> I'm new to VTK. >> When I compile VTK in VS2013, I got two errors. >> >> Error4error C2668: '_wassert' : ambiguous call to overloaded >> functionf:\vtk\vtk-7.1-src\common\core\vtkGenericDataArray.txx281vtkFiltersCore >> >> Error46error LNK1104: cannot open file >> '..\..\..\lib\Debug\vtkFiltersCore-7.1.lib'F:\VTK\VTK-7.1-bin\Examples\DataManipulation\Cxx\LINKCube >> >> Help me please, thanks. >> >> With: >> WIN10 VS2013Pro VTK7.1 Qt5.5.1 CMake3.5.1 >> >> THX!!! >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lonie at kitware.com Tue Apr 5 13:23:11 2016 From: david.lonie at kitware.com (David Lonie) Date: Tue, 5 Apr 2016 13:23:11 -0400 Subject: [vtkusers] vtkGenericDataArray.txx Windows Compiler Error [merged] Message-ID: Hi folks, I'm combining your threads since they refer to the same problem. I just pulled the latest master and did a debugging Win32 build using MSVC 2015 on windows 7. I used the default CMake options, aside from enabling BUILD_EXAMPLES. I tried both with ninja, and then again in the VS IDE. Neither build showed this compilation error. Is there anything unusual about your builds, or are you setting any non-default CMake options? Thanks, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From livc at outlook.com Wed Apr 6 00:49:34 2016 From: livc at outlook.com (Zhao Li) Date: Wed, 6 Apr 2016 12:49:34 +0800 Subject: [vtkusers] vtkGenericDataArray.txx Windows Compiler Error [merged] In-Reply-To: References: Message-ID: Hello I re-download VTK on github.This is my steps of configuration CMake: 1.Configure 2. Select the VS2013 WIN64 3. Select BUILD_EXAMPLES Uncheck BUILD_SHARED_LIBS and BUILD_TESTING 4.Configure 5.Configure 6.Generate There are still two errors when I compile in VS2013. Thanks, Zhao LiFrom: david.lonie at kitware.com Date: Tue, 5 Apr 2016 13:23:11 -0400 Subject: vtkGenericDataArray.txx Windows Compiler Error [merged] To: zionman.hsu at gmail.com; livc at outlook.com; vtkusers at vtk.org Hi folks, I'm combining your threads since they refer to the same problem. I just pulled the latest master and did a debugging Win32 build using MSVC 2015 on windows 7. I used the default CMake options, aside from enabling BUILD_EXAMPLES. I tried both with ninja, and then again in the VS IDE. Neither build showed this compilation error. Is there anything unusual about your builds, or are you setting any non-default CMake options? Thanks,Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From zionman.hsu at gmail.com Wed Apr 6 01:47:37 2016 From: zionman.hsu at gmail.com (=?UTF-8?B?5b6Q5b+XIOiPrw==?=) Date: Wed, 6 Apr 2016 13:47:37 +0800 Subject: [vtkusers] vtkGenericDataArray.txx Windows Compiler Error [merged] In-Reply-To: References: Message-ID: I tried to build with all the default settings of 29th, march, first, that is build with BUILD_SHARED_LIBS checked in cmake, while build with DEBUG option, there is not any error. I reconfig if with shared libs unchecked then, while build with DEBUG option, the wassert error message generates. I tried with the old master archive of 10th, March, no error message generates, whether shared libs checked or not. So it's clear that the build shared libs option is affected between 10th march and 29th march. 2016?4?6? ??1:23? "David Lonie" ??? > Hi folks, > > I'm combining your threads since they refer to the same problem. > > I just pulled the latest master and did a debugging Win32 build using MSVC > 2015 on windows 7. I used the default CMake options, aside from enabling > BUILD_EXAMPLES. I tried both with ninja, and then again in the VS IDE. > > Neither build showed this compilation error. Is there anything unusual > about your builds, or are you setting any non-default CMake options? > > Thanks, > Dave > -------------- next part -------------- An HTML attachment was scrubbed... URL: From habe36 at gmail.com Wed Apr 6 03:57:04 2016 From: habe36 at gmail.com (ABE Hiroshi) Date: Wed, 6 Apr 2016 16:57:04 +0900 Subject: [vtkusers] wxPlaneWidget on OSX In-Reply-To: <4FA127E3-C507-4DB8-B88F-475675294E11@gmail.com> References: <4FA127E3-C507-4DB8-B88F-475675294E11@gmail.com> Message-ID: <0E344297-3AC7-4DD7-A021-BADA916A9416@gmail.com> Dear All, I modified the VTK wiki?s sample as is bottom of this mail to show the status of vtkPlaneWidget. The output of ?Print? method in the constructor is; vtkPlaneWidget (0x7fea78d1e1d0) Debug: Off Modified Time: 2705 Reference Count: 1 Registered Events: (none) Current Renderer: 0x0 Default Renderer: 0x0 Enabled: 0 Priority: 0.5 Interactor: 0x0 Key Press Activation: On Key Press Activation Value: i Prop3D: 0x0 Input: 0x0 Handle Size: 0.05 Place Factor: 0.5 Handle Property: 0x7fea78d4a2c0 Selected Handle Property: 0x7fea78d4a470 Plane Property: 0x7fea78d4a620 Selected Plane Property: 0x7fea78d4a7d0 Plane Representation: Wireframe Normal To X Axis: Off Normal To Y Axis: Off Normal To Z Axis: Off Resolution: 4 Origin: (-0.5, -0.5, 0) Point 1: (0.5, -0.5, 0) Point 2: (-0.5, 0.5, 0) and in the destructor; vtkPlaneWidget (0x7fea78d1e1d0) Debug: Off Modified Time: 2806 Reference Count: 0 Registered Events: (none) Current Renderer: 0x7fea78f00160 Default Renderer: 0x0 Enabled: 1 Priority: 0.5 Interactor: 0x7fea78f00b40 Key Press Activation: On Key Press Activation Value: i Prop3D: 0x0 Input: 0x0 Handle Size: 0.05 Place Factor: 0.5 Handle Property: 0x7fea78d4a2c0 Selected Handle Property: 0x7fea78d4a470 Plane Property: 0x7fea78d4a620 Selected Plane Property: 0x7fea78d4a7d0 Plane Representation: Wireframe Normal To X Axis: Off Normal To Y Axis: Off Normal To Z Axis: Off Resolution: 4 Origin: (-0.562965, -0.555969, 0) Point 1: (nan, nan, nan) Point 2: (nan, nan, nan) The Point 1 and 2 are changed to ?nan?. The value (X,Y) in OnMouseMove is not strange as; ( 182, 172 ) ( 180, 170 ) ( 180, 169 ) ( 177, 169 ) ( 177, 167 ) ( 175, 167 ) ( 174, 166 ) ( 174, 165 ) ( 173, 165 ) ( 218, 212 ) ( 219, 213 ) ( 221, 215 ) ( 222, 217 ) ( 224, 218 ) ( 225, 221 ) ( 226, 222 ) ( 227, 224 ) ( 229, 225 ) ( 230, 225 ) ( 232, 227 ) ( 235, 229 ) ( 237, 231 ) ( 241, 234 ) ( 244, 235 ) ( 246, 236 ) ( 247, 238 ) ( 249, 238 ) ( 250, 238 ) ( 250, 239 ) ( 252, 239 ) ( 253, 241 ) ( 253, 241 ) ( 255, 241 ) ( 255, 242 ) ( 255, 244 ) ( 256, 244 ) ( 256, 244 ) ( 258, 244 ) This is the result of my investigation on this. Still I am looking for any suggestions on this. Thank you. 2016/04/05 11:28?ABE Hiroshi ????? > Dear all, > > This might be a known issue but I could find any description about it on the net so I ask you about vtkPlaneWidget. > That is a weired behavior that the handles of vtkPlaneWidget is gone when you drag one of the handles. > > The sample program I used is available at: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/PlaneWidget > > Building it straightforwardly and get an executable program. The application launches as usual to display a VTK window. > You can find a vtkPlaneWidget?s plane in the window, which has four handles. If you drag one of the handles suddenly the handle disappears. This is always happens on OSX (10.9.5, 10.10.5). The env. are: > > OS X 10.9.5 (iMac late 2013 21.5?) VTK 5.10.1 (with Apple Wireless Trackpad) > OS X 10.10.5 (MBP Letina 13?) VTK 5.10.1 VTK 6.3.0 > > As an additional info. Run the same program on OpenSUSE 13 (VTK 5.10) on the Linux box itself, it works fine as expected. But if you display on iMac with XQuartz (2.7.8), the same problem happens. > > Anybody out there point me the way workaround or any suggestions to solve this. > > Thank you very much in advance. ABE Hiroshi from Tokorozawa, JAPAN #include #include #include #include #include #include #include class myPlaneWidget : public vtkPlaneWidget { public: static myPlaneWidget *New(); myPlaneWidget() : vtkPlaneWidget() { this->Print( std::cout ); } virtual ~myPlaneWidget() { this->Print( std::cout ); } virtual void UpdatePlacement() { this->Print( std::cout ); vtkPlaneWidget::UpdatePlacement(); } virtual void PositionHandles() { this->Print( std::cout ); vtkPlaneWidget::PositionHandles(); } }; vtkStandardNewMacro(myPlaneWidget); int main(int, char *[]) { vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); vtkSmartPointer planeWidget = vtkSmartPointer::New(); planeWidget->SetInteractor(renderWindowInteractor); planeWidget->On(); renderWindowInteractor->Initialize(); renderer->ResetCamera(); renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } From livc at outlook.com Wed Apr 6 06:24:52 2016 From: livc at outlook.com (Zhao Li) Date: Wed, 6 Apr 2016 18:24:52 +0800 Subject: [vtkusers] vtkGenericDataArray.txx Windows Compiler Error [merged] In-Reply-To: References: , Message-ID: Hi, Finally I decide to use VTK 7.0 on vtk.org and there is no error anymore. Thanks,Zhao Li Date: Wed, 6 Apr 2016 13:47:37 +0800 Subject: Re: vtkGenericDataArray.txx Windows Compiler Error [merged] From: zionman.hsu at gmail.com To: david.lonie at kitware.com CC: vtkusers at vtk.org; livc at outlook.com I tried to build with all the default settings of 29th, march, first, that is build with BUILD_SHARED_LIBS checked in cmake, while build with DEBUG option, there is not any error. I reconfig if with shared libs unchecked then, while build with DEBUG option, the wassert error message generates. I tried with the old master archive of 10th, March, no error message generates, whether shared libs checked or not. So it's clear that the build shared libs option is affected between 10th march and 29th march. 2016??4??6?? ????1:23?? "David Lonie" ?????? Hi folks, I'm combining your threads since they refer to the same problem. I just pulled the latest master and did a debugging Win32 build using MSVC 2015 on windows 7. I used the default CMake options, aside from enabling BUILD_EXAMPLES. I tried both with ninja, and then again in the VS IDE. Neither build showed this compilation error. Is there anything unusual about your builds, or are you setting any non-default CMake options? Thanks,Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From bmoonlu at yeah.net Wed Apr 6 07:06:27 2016 From: bmoonlu at yeah.net (=?UTF-8?B?6Lev5piO5pyI?=) Date: Wed, 6 Apr 2016 19:06:27 +0800 (CST) Subject: [vtkusers] How to draw complex polygons by using vtkPolyData? Message-ID: <3e732df6.268f.153eb40846b.Coremail.bmoonlu@yeah.net> Hi All, I have a question about drawing a complex polygon like 1.jpg by using vtkPolyData. Thank you for your help. Your sincerely, Joy Wang. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 1.jpg Type: image/jpeg Size: 9901 bytes Desc: not available URL: From david.lonie at kitware.com Wed Apr 6 09:32:39 2016 From: david.lonie at kitware.com (David Lonie) Date: Wed, 6 Apr 2016 09:32:39 -0400 Subject: [vtkusers] vtkGenericDataArray.txx Windows Compiler Error [merged] In-Reply-To: References: Message-ID: Aha, so it seems to happen when building static libraries. I'll see if I can reproduce this now. Yes, rolling back to an earlier version should work for now, as the generic array stuff was merged very recently. Dave On Wed, Apr 6, 2016 at 1:47 AM, ?? ? wrote: > I tried to build with all the default settings of 29th, march, first, that > is build with BUILD_SHARED_LIBS checked in cmake, while build with DEBUG > option, there is not any error. > I reconfig if with shared libs unchecked then, while build with DEBUG > option, the wassert error message generates. > I tried with the old master archive of 10th, March, no error message > generates, whether shared libs checked or not. > So it's clear that the build shared libs option is affected between 10th > march and 29th march. > 2016?4?6? ??1:23? "David Lonie" ??? > >> Hi folks, >> >> I'm combining your threads since they refer to the same problem. >> >> I just pulled the latest master and did a debugging Win32 build using >> MSVC 2015 on windows 7. I used the default CMake options, aside from >> enabling BUILD_EXAMPLES. I tried both with ninja, and then again in the VS >> IDE. >> >> Neither build showed this compilation error. Is there anything unusual >> about your builds, or are you setting any non-default CMake options? >> >> Thanks, >> Dave >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lonie at kitware.com Wed Apr 6 10:04:10 2016 From: david.lonie at kitware.com (David Lonie) Date: Wed, 6 Apr 2016 10:04:10 -0400 Subject: [vtkusers] vtkGenericDataArray.txx Windows Compiler Error [merged] In-Reply-To: References: Message-ID: On Wed, Apr 6, 2016 at 9:32 AM, David Lonie wrote: > Aha, so it seems to happen when building static libraries. I'll see if I > can reproduce this now. > I was able to reproduce with a static library debugging build. I'll post again when I have a patch. Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lonie at kitware.com Wed Apr 6 16:16:07 2016 From: david.lonie at kitware.com (David Lonie) Date: Wed, 6 Apr 2016 16:16:07 -0400 Subject: [vtkusers] vtkGenericDataArray.txx Windows Compiler Error [merged] In-Reply-To: References: Message-ID: The patch here fixes it (and some other windows static build issues) for me: https://gitlab.kitware.com/vtk/vtk/merge_requests/1403 Assuming the dashboards are happy with it we should get it merged tomorrow. Thanks for the bug reports! Dave On Wed, Apr 6, 2016 at 10:04 AM, David Lonie wrote: > On Wed, Apr 6, 2016 at 9:32 AM, David Lonie > wrote: > >> Aha, so it seems to happen when building static libraries. I'll see if I >> can reproduce this now. >> > > I was able to reproduce with a static library debugging build. I'll post > again when I have a patch. > > Dave > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lihouxing at yeah.net Wed Apr 6 20:09:21 2016 From: lihouxing at yeah.net (lee) Date: Wed, 6 Apr 2016 17:09:21 -0700 (MST) Subject: [vtkusers] Flying Edge Message-ID: <1459987761472-5737559.post@n5.nabble.com> Hi all, It is very exciting that the reconstruction using flying edge algorithm is much faster compared with Marching Cubes algorithm. However, I find the final iso surface is not smooth enough. I tried vtksmoothpolydatafilter and vtkWindowedSincPolyDataFilter, but still the quality of the surface isn?t improved. I am wondering if anyone using flying edge also encountered the same problem, and how you resolved it. Any suggestion would be appreciated! Thanks in advance. ps: auto flyingEdges=vtkSmartPointer::New(); flyingEdges->SetInputData(inputdata); flyingEdges->GenerateValues(1,ui.MinSpinBox->value(),ui.MaxSpinBox->value()); flyingEdges->ComputeNormalsOn(); flyingEdges->Update(); -- View this message in context: http://vtk.1045678.n5.nabble.com/Flying-Edge-tp5737559.html Sent from the VTK - Users mailing list archive at Nabble.com. From lihouxing at yeah.net Wed Apr 6 21:07:14 2016 From: lihouxing at yeah.net (lee) Date: Wed, 6 Apr 2016 18:07:14 -0700 (MST) Subject: [vtkusers] how to get coordinates after using RotateWXYZ In-Reply-To: <1459957404186-5737555.post@n5.nabble.com> References: <1459957404186-5737555.post@n5.nabble.com> Message-ID: <1459991234448-5737560.post@n5.nabble.com> using " sourceActor->RotateWXYZ(angle, axis[0], axis[1], axis[2])" dose't really change the actual position of the line. You might need vtktransformpolydata fiter to rotate the line. -- View this message in context: http://vtk.1045678.n5.nabble.com/how-to-get-coordinates-after-using-RotateWXYZ-tp5737555p5737560.html Sent from the VTK - Users mailing list archive at Nabble.com. From habe36 at gmail.com Wed Apr 6 21:21:15 2016 From: habe36 at gmail.com (ABE Hiroshi) Date: Thu, 7 Apr 2016 10:21:15 +0900 Subject: [vtkusers] wxPlaneWidget on OSX In-Reply-To: <0E344297-3AC7-4DD7-A021-BADA916A9416@gmail.com> References: <4FA127E3-C507-4DB8-B88F-475675294E11@gmail.com> <0E344297-3AC7-4DD7-A021-BADA916A9416@gmail.com> Message-ID: Dear All, I found the reason why the problem occurs. Dragging the handle and then stop to set the vector of motion of mouse pointer to zero vector in ?vtkPlaneWIdget::MovePoint?? methods. The vector is expected not to be zero but it is on OSX. I put statement to prevent zero divide as; // Project v onto these vector to determine the amount of motion // Scale it by the relative size of the motion to the vector length double d1, d2; if( vN == 0 ) { d1 = 0.0; d2 = 0.0; } else { d1 = (vN/n10) * vtkMath::Dot(v,p10) / (vN*n10); d2 = (vN/n20) * vtkMath::Dot(v,p20) / (vN*n20); } to work fine for me. Tchuss, 2016/04/06 16:57?ABE Hiroshi ????? > Dear All, > > I modified the VTK wiki?s sample as is bottom of this mail to show the status of vtkPlaneWidget. > The output of ?Print? method in the constructor is; > > vtkPlaneWidget (0x7fea78d1e1d0) > Debug: Off > Modified Time: 2705 > Reference Count: 1 > Registered Events: (none) > Current Renderer: 0x0 > Default Renderer: 0x0 > Enabled: 0 > Priority: 0.5 > Interactor: 0x0 > Key Press Activation: On > Key Press Activation Value: i > Prop3D: 0x0 > Input: 0x0 > Handle Size: 0.05 > Place Factor: 0.5 > Handle Property: 0x7fea78d4a2c0 > Selected Handle Property: 0x7fea78d4a470 > Plane Property: 0x7fea78d4a620 > Selected Plane Property: 0x7fea78d4a7d0 > Plane Representation: Wireframe > Normal To X Axis: Off > Normal To Y Axis: Off > Normal To Z Axis: Off > Resolution: 4 > Origin: (-0.5, -0.5, 0) > Point 1: (0.5, -0.5, 0) > Point 2: (-0.5, 0.5, 0) > > and in the destructor; > > vtkPlaneWidget (0x7fea78d1e1d0) > Debug: Off > Modified Time: 2806 > Reference Count: 0 > Registered Events: (none) > Current Renderer: 0x7fea78f00160 > Default Renderer: 0x0 > Enabled: 1 > Priority: 0.5 > Interactor: 0x7fea78f00b40 > Key Press Activation: On > Key Press Activation Value: i > Prop3D: 0x0 > Input: 0x0 > Handle Size: 0.05 > Place Factor: 0.5 > Handle Property: 0x7fea78d4a2c0 > Selected Handle Property: 0x7fea78d4a470 > Plane Property: 0x7fea78d4a620 > Selected Plane Property: 0x7fea78d4a7d0 > Plane Representation: Wireframe > Normal To X Axis: Off > Normal To Y Axis: Off > Normal To Z Axis: Off > Resolution: 4 > Origin: (-0.562965, -0.555969, 0) > Point 1: (nan, nan, nan) > Point 2: (nan, nan, nan) > > The Point 1 and 2 are changed to ?nan?. The value (X,Y) in OnMouseMove is not strange as; > ( 182, 172 ) > ( 180, 170 ) > ( 180, 169 ) > ( 177, 169 ) > ( 177, 167 ) > ( 175, 167 ) > ( 174, 166 ) > ( 174, 165 ) > ( 173, 165 ) > ( 218, 212 ) > ( 219, 213 ) > ( 221, 215 ) > ( 222, 217 ) > ( 224, 218 ) > ( 225, 221 ) > ( 226, 222 ) > ( 227, 224 ) > ( 229, 225 ) > ( 230, 225 ) > ( 232, 227 ) > ( 235, 229 ) > ( 237, 231 ) > ( 241, 234 ) > ( 244, 235 ) > ( 246, 236 ) > ( 247, 238 ) > ( 249, 238 ) > ( 250, 238 ) > ( 250, 239 ) > ( 252, 239 ) > ( 253, 241 ) > ( 253, 241 ) > ( 255, 241 ) > ( 255, 242 ) > ( 255, 244 ) > ( 256, 244 ) > ( 256, 244 ) > ( 258, 244 ) > > This is the result of my investigation on this. > > Still I am looking for any suggestions on this. > Thank you. > > 2016/04/05 11:28?ABE Hiroshi ????? > >> Dear all, >> >> This might be a known issue but I could find any description about it on the net so I ask you about vtkPlaneWidget. >> That is a weired behavior that the handles of vtkPlaneWidget is gone when you drag one of the handles. >> >> The sample program I used is available at: >> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/PlaneWidget >> >> Building it straightforwardly and get an executable program. The application launches as usual to display a VTK window. >> You can find a vtkPlaneWidget?s plane in the window, which has four handles. If you drag one of the handles suddenly the handle disappears. This is always happens on OSX (10.9.5, 10.10.5). The env. are: >> >> OS X 10.9.5 (iMac late 2013 21.5?) VTK 5.10.1 (with Apple Wireless Trackpad) >> OS X 10.10.5 (MBP Letina 13?) VTK 5.10.1 VTK 6.3.0 >> >> As an additional info. Run the same program on OpenSUSE 13 (VTK 5.10) on the Linux box itself, it works fine as expected. But if you display on iMac with XQuartz (2.7.8), the same problem happens. >> >> Anybody out there point me the way workaround or any suggestions to solve this. >> >> Thank you very much in advance. > > ABE Hiroshi > from Tokorozawa, JAPAN > > #include > > #include > #include > #include > #include > #include > #include > > class myPlaneWidget : public vtkPlaneWidget { > public: > static myPlaneWidget *New(); > myPlaneWidget() : vtkPlaneWidget() { > this->Print( std::cout ); > } > virtual ~myPlaneWidget() { > this->Print( std::cout ); > } > virtual void UpdatePlacement() { > this->Print( std::cout ); > vtkPlaneWidget::UpdatePlacement(); > } > virtual void PositionHandles() { > this->Print( std::cout ); > vtkPlaneWidget::PositionHandles(); > } > }; > vtkStandardNewMacro(myPlaneWidget); > > int main(int, char *[]) > { > vtkSmartPointer renderer = > vtkSmartPointer::New(); > > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->AddRenderer(renderer); > > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > renderWindowInteractor->SetRenderWindow(renderWindow); > > vtkSmartPointer planeWidget = > vtkSmartPointer::New(); > planeWidget->SetInteractor(renderWindowInteractor); > > planeWidget->On(); > > renderWindowInteractor->Initialize(); > > renderer->ResetCamera(); > renderWindow->Render(); > > renderWindowInteractor->Start(); > > return EXIT_SUCCESS; > } > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers ABE Hiroshi from Tokorozawa, JAPAN From bmoonlu at yeah.net Wed Apr 6 21:08:25 2016 From: bmoonlu at yeah.net (=?UTF-8?B?6Lev5piO5pyI?=) Date: Thu, 7 Apr 2016 09:08:25 +0800 (CST) Subject: [vtkusers] How to draw hollow polygon by using vtkPolyData Message-ID: <52724149.413.153ee435c52.Coremail.bmoonlu@yeah.net> Hi All, I have a question about drawing a hollow polygon like 2.jpg by using vtkPolyData. Thank you for your help. Your sincerely, Joy Wang. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2.jpg Type: image/jpeg Size: 55702 bytes Desc: not available URL: From minaninina1 at gmail.com Thu Apr 7 05:12:53 2016 From: minaninina1 at gmail.com (aria dob) Date: Thu, 7 Apr 2016 02:12:53 -0700 (MST) Subject: [vtkusers] vtk keyboard keys Message-ID: <1460020373039-5737565.post@n5.nabble.com> hello, please i need help i want to add keyboard event on my code vtk c++,to control my model by the keys of keyboard how can i do this ?? -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk-keyboard-keys-tp5737565.html Sent from the VTK - Users mailing list archive at Nabble.com. From heitz.matthieu at gmail.com Thu Apr 7 07:08:35 2016 From: heitz.matthieu at gmail.com (Matthieu Heitz) Date: Thu, 7 Apr 2016 13:08:35 +0200 Subject: [vtkusers] Non-virtual version of vtkDataArrayTemplate Message-ID: Hi all ! I have a template class myClass, where T can be a scalar (float, int, double, etc.) I would like to create a vtkFloatArray, vtkIntArray, or vtkDoubleArray, depending on the type T. I thought that vtkDataArrayTemplate would be a good solution. Unfortunately, it is a virtual class, so I can't write this : vtkSmartPointer< vtkDataArrayTemplate > array = vtkSmartPointer >::New(); because when I try to instantiate a myClass, I get the error : error: invalid conversion from ?vtkObject*? to ?vtkDataArrayTemplate*? [-fpermissive] So my question is: Is there an non-virtual version of vtkDataArrayTemplate that would allow me to create a vtkFloatArray when T is float, vtkDoubleArray when T is double, etc. P.S: I use VTK 6.0.0 Thank you ! Matthieu Heitz -------------- next part -------------- An HTML attachment was scrubbed... URL: From philip.fackler at gmail.com Thu Apr 7 08:14:34 2016 From: philip.fackler at gmail.com (Philip Fackler) Date: Thu, 07 Apr 2016 12:14:34 +0000 Subject: [vtkusers] How can I get parametric coordinates for 3D polydata points? Message-ID: I have several distinct surfaces defined by triangular facets (wound consistently) and the bounding segmented curves for each surface (the surfaces are generally not closed). One way I can imagine to triangulate a set of points on a surface is to use vtkDelaunay2D with each point's corresponding (u, v) coordinates on a parametric surface, followed by a transformation of the points back to 3D. So, is there a tool in vtk to generate such a parametric surface based on a polydata with the information indicated above? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Thu Apr 7 09:19:54 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 7 Apr 2016 09:19:54 -0400 Subject: [vtkusers] vtk keyboard keys In-Reply-To: <1460020373039-5737565.post@n5.nabble.com> References: <1460020373039-5737565.post@n5.nabble.com> Message-ID: Hi, Please see http://www.vtk.org/doc/nightly/html/classvtkInteractorStyle.html#details for how interaction such as keyboard interaction is done with just the basic VTK window. You may subclass this base class to customize interaction behavior however you want. See any of the subclasses for examples of how to do this. Best regards, Cory On Thu, Apr 7, 2016 at 5:12 AM, aria dob wrote: > hello, > please i need help i want to add keyboard event on my code vtk c++,to > control my model by the keys of keyboard how can i do this ?? > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/vtk-keyboard-keys-tp5737565.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen R&D Engineer Kitware, Inc. From cory.quammen at kitware.com Thu Apr 7 09:35:44 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 7 Apr 2016 09:35:44 -0400 Subject: [vtkusers] Non-virtual version of vtkDataArrayTemplate In-Reply-To: References: Message-ID: Hi Matthieu, I'm not sure if there is a templated array factory in VTK to do this. You could make specialized templated utility functions specialized for each of your types, e.g. (not tested): template int GetVTKType(T *) { return 0; } template <> int GetVTKType(int *) { return VTK_INT; } template <> int GetVTKType(float* ) { return VTK_FLOAT; } and so on, then use this to create the right type of array in a switch statement: int arrayType = GetVTKType(); switch (arrayType) { case VTK_INT: return vtkIntArray::New(); break; case VTK_FLOAT: return vtkFloatArray::New(); break; default: //... } HTH, Cory On Thu, Apr 7, 2016 at 7:08 AM, Matthieu Heitz wrote: > Hi all ! > > I have a template class myClass, where T can be a scalar (float, int, > double, etc.) > I would like to create a vtkFloatArray, vtkIntArray, or vtkDoubleArray, > depending on the type T. > I thought that vtkDataArrayTemplate would be a good solution. > Unfortunately, it is a virtual class, so I can't write this : > > vtkSmartPointer< vtkDataArrayTemplate > array = > vtkSmartPointer >::New(); > > because when I try to instantiate a myClass, I get the error : > > error: invalid conversion from ?vtkObject*? to > ?vtkDataArrayTemplate*? [-fpermissive] > > So my question is: Is there an non-virtual version of vtkDataArrayTemplate > that would allow me to create a vtkFloatArray when T is float, > vtkDoubleArray when T is double, etc. > > P.S: I use VTK 6.0.0 > > Thank you ! > Matthieu Heitz > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From minaninina1 at gmail.com Thu Apr 7 09:39:47 2016 From: minaninina1 at gmail.com (aria dob) Date: Thu, 7 Apr 2016 06:39:47 -0700 (MST) Subject: [vtkusers] vtk keyboard keys In-Reply-To: References: <1460020373039-5737565.post@n5.nabble.com> Message-ID: <1460036387291-5737571.post@n5.nabble.com> hi , i try this programme wich is true i guess but it doesn't work ,i don't khnow why please help me #include "stdafx.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vtkSmartPointer act =vtkSmartPointer::New(); vtkSmartPointer renderer =vtkSmartPointer::New(); vtkSmartPointer renderWindow =vtkSmartPointer::New(); vtkSmartPointer renderWindowInteractor =vtkSmartPointer::New(); class KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera { public: static KeyPressInteractorStyle* New(); vtkTypeMacro(KeyPressInteractorStyle, vtkInteractorStyleTrackballCamera); virtual void OnKeyPress() { double handpos[3] = {0.7,-1.2,2.6}; // Get the keypress vtkRenderWindowInteractor *rwi = this->Interactor; std::string key = rwi->GetKeySym(); // Output the key that was pressed std::cout << "Pressed " << key << std::endl; // Handle an arrow key if (key == "Up") { std::cout << "The up arrow was pressed." << std::endl; handpos[0]++; act->SetPosition(handpos[0], handpos[1], handpos[2]); renderer->Render(); renderWindow->Render(); } if (key == "a") { std::cout << "The up arrow was pressed." << std::endl; handpos[1]++; act->SetPosition(handpos[0], handpos[1], handpos[2]); renderer->Render(); renderWindow->Render(); } if (key == "h") { std::cout << "The up arrow was pressed." << std::endl; handpos[2]++; act->SetPosition(handpos[0], handpos[1], handpos[2]); renderer->Render(); renderWindow->Render(); } // Forward events vtkInteractorStyleTrackballCamera::OnKeyPress(); } }; vtkStandardNewMacro(KeyPressInteractorStyle); -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk-keyboard-keys-tp5737565p5737571.html Sent from the VTK - Users mailing list archive at Nabble.com. From shawn.waldon at kitware.com Thu Apr 7 09:50:04 2016 From: shawn.waldon at kitware.com (Shawn Waldon) Date: Thu, 7 Apr 2016 09:50:04 -0400 Subject: [vtkusers] Non-virtual version of vtkDataArrayTemplate In-Reply-To: References: Message-ID: Matthieu, If you have the VTK type code (VTK_INT, VTK_FLOAT, etc) there is a function vtkDataArray::CreateDataArray(int type) that takes this type code. You'll still have to do the first part of the code Cory gave, but the switch statement is already implemented in VTK. I don't know if there is anything that takes the template parameter and gives the type code though. HTH, Shawn On Thu, Apr 7, 2016 at 9:35 AM, Cory Quammen wrote: > Hi Matthieu, > > I'm not sure if there is a templated array factory in VTK to do this. > > You could make specialized templated utility functions specialized for > each of your types, e.g. (not tested): > > template > int GetVTKType(T *) > { > return 0; > } > > template <> > int GetVTKType(int *) > { > return VTK_INT; > } > > template <> > int GetVTKType(float* ) > { > return VTK_FLOAT; > } > > and so on, then use this to create the right type of array in a switch > statement: > > int arrayType = GetVTKType(); > switch (arrayType) > { > case VTK_INT: > return vtkIntArray::New(); > break; > > case VTK_FLOAT: > return vtkFloatArray::New(); > break; > > default: > //... > } > > HTH, > Cory > > On Thu, Apr 7, 2016 at 7:08 AM, Matthieu Heitz > wrote: > >> Hi all ! >> >> I have a template class myClass, where T can be a scalar (float, int, >> double, etc.) >> I would like to create a vtkFloatArray, vtkIntArray, or vtkDoubleArray, >> depending on the type T. >> I thought that vtkDataArrayTemplate would be a good solution. >> Unfortunately, it is a virtual class, so I can't write this : >> >> vtkSmartPointer< vtkDataArrayTemplate > array = >> vtkSmartPointer >::New(); >> >> because when I try to instantiate a myClass, I get the error : >> >> error: invalid conversion from ?vtkObject*? to >> ?vtkDataArrayTemplate*? [-fpermissive] >> >> So my question is: Is there an non-virtual version of >> vtkDataArrayTemplate that would allow me to create a vtkFloatArray when T >> is float, vtkDoubleArray when T is double, etc. >> >> P.S: I use VTK 6.0.0 >> >> Thank you ! >> Matthieu Heitz >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Thu Apr 7 09:51:16 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 7 Apr 2016 09:51:16 -0400 Subject: [vtkusers] vtk keyboard keys In-Reply-To: <1460036387291-5737571.post@n5.nabble.com> References: <1460020373039-5737565.post@n5.nabble.com> <1460036387291-5737571.post@n5.nabble.com> Message-ID: I don't see that you are setting the interactor style in the vtkRenderWindowInteractor. You should have code like this somewhere in your example: KeyPressInteractorStyle *style = KeyPressInteractorStyle::New(); vtkRenderWindowInteractor* renderWindowInteractor = renderWindow->GetInteractor(); renderWindowInteractor->SetInteractorStyle(style); On Thu, Apr 7, 2016 at 9:39 AM, aria dob wrote: > hi , > i try this programme wich is true i guess but it doesn't work ,i don't khnow > why please help me > > #include "stdafx.h" > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > vtkSmartPointer act =vtkSmartPointer::New(); > vtkSmartPointer renderer =vtkSmartPointer::New(); > vtkSmartPointer renderWindow > =vtkSmartPointer::New(); > > vtkSmartPointer renderWindowInteractor > =vtkSmartPointer::New(); > > class KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera > { > public: > static KeyPressInteractorStyle* New(); > vtkTypeMacro(KeyPressInteractorStyle, vtkInteractorStyleTrackballCamera); > > virtual void OnKeyPress() > { double handpos[3] = {0.7,-1.2,2.6}; > > // Get the keypress > vtkRenderWindowInteractor *rwi = this->Interactor; > std::string key = rwi->GetKeySym(); > > // Output the key that was pressed > std::cout << "Pressed " << key << std::endl; > > // Handle an arrow key > if (key == "Up") > { > std::cout << "The up arrow was pressed." << std::endl; > handpos[0]++; > act->SetPosition(handpos[0], handpos[1], handpos[2]); > renderer->Render(); > renderWindow->Render(); > } > > if (key == "a") > { > std::cout << "The up arrow was pressed." << std::endl; > handpos[1]++; > act->SetPosition(handpos[0], handpos[1], handpos[2]); > renderer->Render(); > renderWindow->Render(); > } > if (key == "h") > { > std::cout << "The up arrow was pressed." << std::endl; > handpos[2]++; > act->SetPosition(handpos[0], handpos[1], handpos[2]); > renderer->Render(); > renderWindow->Render(); > } > // Forward events > vtkInteractorStyleTrackballCamera::OnKeyPress(); > } > }; > vtkStandardNewMacro(KeyPressInteractorStyle); > > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/vtk-keyboard-keys-tp5737565p5737571.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen R&D Engineer Kitware, Inc. From minaninina1 at gmail.com Thu Apr 7 09:54:08 2016 From: minaninina1 at gmail.com (aria dob) Date: Thu, 7 Apr 2016 06:54:08 -0700 (MST) Subject: [vtkusers] vtk keyboard keys In-Reply-To: References: <1460020373039-5737565.post@n5.nabble.com> <1460036387291-5737571.post@n5.nabble.com> Message-ID: <1460037248803-5737574.post@n5.nabble.com> yes i do have this in the main -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk-keyboard-keys-tp5737565p5737574.html Sent from the VTK - Users mailing list archive at Nabble.com. From cory.quammen at kitware.com Thu Apr 7 10:38:39 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 7 Apr 2016 10:38:39 -0400 Subject: [vtkusers] vtk keyboard keys In-Reply-To: <1460037248803-5737574.post@n5.nabble.com> References: <1460020373039-5737565.post@n5.nabble.com> <1460036387291-5737571.post@n5.nabble.com> <1460037248803-5737574.post@n5.nabble.com> Message-ID: Please send a complete, compilable code example. We can't see what you have done or have not done without a complete example. On Thu, Apr 7, 2016 at 9:54 AM, aria dob wrote: > yes i do have this in the main > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/vtk-keyboard-keys-tp5737565p5737574.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen R&D Engineer Kitware, Inc. From minaninina1 at gmail.com Thu Apr 7 11:07:06 2016 From: minaninina1 at gmail.com (aria dob) Date: Thu, 7 Apr 2016 08:07:06 -0700 (MST) Subject: [vtkusers] vtk keyboard keys In-Reply-To: References: <1460020373039-5737565.post@n5.nabble.com> <1460036387291-5737571.post@n5.nabble.com> <1460037248803-5737574.post@n5.nabble.com> Message-ID: <1460041626695-5737577.post@n5.nabble.com> this is my program #include "stdafx.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vtkSmartPointer act =vtkSmartPointer::New(); vtkSmartPointer renderer =vtkSmartPointer::New(); vtkSmartPointer renderWindow =vtkSmartPointer::New(); vtkSmartPointer renderWindowInteractor =vtkSmartPointer::New(); class KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera { public: static KeyPressInteractorStyle* New(); vtkTypeMacro(KeyPressInteractorStyle, vtkInteractorStyleTrackballCamera); virtual void OnKeyPress() { double handpos[3] = {0.7,-1.2,2.6}; // Get the keypress vtkRenderWindowInteractor *rwi = this->Interactor; std::string key = rwi->GetKeySym(); // Output the key that was pressed std::cout << "Pressed " << key << std::endl; // Handle an arrow key if (key == "Up") { std::cout << "The up arrow was pressed." << std::endl; handpos[0]++; act->SetPosition(handpos[0], handpos[1], handpos[2]); renderer->Render(); renderWindow->Render(); } if (key == "a") { std::cout << "The up arrow was pressed." << std::endl; handpos[1]++; act->SetPosition(handpos[0], handpos[1], handpos[2]); renderer->Render(); renderWindow->Render(); } if (key == "h") { std::cout << "The up arrow was pressed." << std::endl; handpos[2]++; act->SetPosition(handpos[0], handpos[1], handpos[2]); renderer->Render(); renderWindow->Render(); } // Forward events vtkInteractorStyleTrackballCamera::OnKeyPress(); } }; vtkStandardNewMacro(KeyPressInteractorStyle); int _tmain(int argc, _TCHAR* argv[]) { // ajouter la main vtkPolyDataReader *read= vtkPolyDataReader::New (); read->SetFileName("C:/hand.vtk"); read->Update(); // Create a mapper and actor(la main) vtkSmartPointer map =vtkSmartPointer::New(); map->SetInputConnection(read->GetOutputPort()); //act->GetProperty()->SetColor(1.0,0.49,0.25); act->SetMapper(map); act->SetPosition(0.7,-1.2,2.6); act->SetScale(0.09); act->RotateX(0); act->GetProperty()->SetColor(1.0,0.49,0.25); // act->GetProperty()->SetEdgeColor(0,0,0); act->GetProperty()->EdgeVisibilityOn(); renderWindow->AddRenderer(renderer); renderWindowInteractor->SetRenderWindow(renderWindow); vtkSmartPointer style = vtkSmartPointer::New(); renderWindowInteractor->SetInteractorStyle(style); style->SetCurrentRenderer(renderer); renderer->AddActor(act); renderer->SetBackground(.1, .2, .3); // Background color dark blue renderWindow->SetSize(1300,700); renderWindow->Render(); renderWindowInteractor->Start(); return(0)} -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk-keyboard-keys-tp5737565p5737577.html Sent from the VTK - Users mailing list archive at Nabble.com. From rickfrank at me.com Thu Apr 7 11:45:48 2016 From: rickfrank at me.com (Richard Frank) Date: Thu, 07 Apr 2016 15:45:48 +0000 (GMT) Subject: [vtkusers] =?utf-8?q?Error_in_vtkOpenGLGPUVolumeRayCastMapper=2Ec?= =?utf-8?q?xx=2C_continued?= Message-ID: <9dc67826-d10c-4bea-a0ac-8b06268efc57@me.com> Hi, I pulled from git about 2 or 3 days ago, and got around to testing this AM. I still crash, albeit slightly different place it seems but the same undefined gl_aspect : ERROR: In Y:\ThirdParty\vtk700\Rendering\OpenGL2\vtkShaderProgram.cxx, line 378 vtkShaderProgram (00000000362FFA50): 1: #version 150 2: #ifdef GL_ES 3: #if __VERSION__ == 300 4: #define varying in 5: #ifdef GL_FRAGMENT_PRECISION_HIGH 6: precision highp float; 7: precision highp sampler2D; 8: precision highp sampler3D; 9: #else 10: precision mediump float; 11: precision mediump sampler2D; 12: precision mediump sampler3D; 13: #endif 14: #define texelFetchBuffer texelFetch 15: #define texture1D texture 16: #define texture2D texture 17: #define texture3D texture 18: #endif // 300 19: #if __VERSION__ == 100 20: #extension GL_OES_standard_derivatives : enable 21: #ifdef GL_FRAGMENT_PRECISION_HIGH 22: precision highp float; 23: #else 24: precision mediump float; 25: #endif 26: #endif // 100 27: #else // GL_ES 28: #define highp 29: #define mediump 30: #define lowp 31: #if __VERSION__ == 150 32: #define varying in 33: #define texelFetchBuffer texelFetch 34: #define texture1D texture 35: #define texture2D texture 36: #define texture3D texture 37: #endif 38: #if __VERSION__ == 120 39: #extension GL_EXT_gpu_shader4 : require 40: #endif 41: #endif // GL_ES 42: 43: 44: /*========================================================================= 45: 46: Program: Visualization Toolkit 47: Module: raycasterfs.glsl 48: 49: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 50: All rights reserved. 51: See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 52: 53: This software is distributed WITHOUT ANY WARRANTY; without even 54: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 55: PURPOSE. See the above copyright notice for more information. 56: 57: =========================================================================*/ 58: 59: ////////////////////////////////////////////////////////////////////////////// 60: /// 61: /// Inputs 62: /// 63: ////////////////////////////////////////////////////////////////////////////// 64: 65: /// 3D texture coordinates form vertex shader 66: varying vec3 ip_textureCoords; 67: varying vec3 ip_vertexPos; 68: 69: ////////////////////////////////////////////////////////////////////////////// 70: /// 71: /// Outputs 72: /// 73: ////////////////////////////////////////////////////////////////////////////// 74: 75: vec4 g_fragColor = vec4(0.0); 76: 77: ////////////////////////////////////////////////////////////////////////////// 78: /// 79: /// Uniforms, attributes, and globals 80: /// 81: ////////////////////////////////////////////////////////////////////////////// 82: vec3 g_dataPos; 83: vec3 g_dirStep; 84: vec4 g_srcColor; 85: vec4 g_eyePosObj; 86: bool g_exit; 87: 88: uniform vec4 in_volume_scale; 89: uniform vec4 in_volume_bias; 90: 91: out vec4 fragOutput0; 92: 93: 94: 95: // Volume dataset 96: uniform sampler3D in_volume; 97: uniform int in_noOfComponents; 98: uniform int in_independentComponents; 99: 100: uniform sampler2D in_noiseSampler; 101: #ifndef GL_ES 102: uniform sampler2D in_depthSampler; 103: #endif 104: 105: // Camera position 106: uniform vec3 in_cameraPos; 107: 108: // view and model matrices 109: uniform mat4 in_volumeMatrix; 110: uniform mat4 in_inverseVolumeMatrix; 111: uniform mat4 in_projectionMatrix; 112: uniform mat4 in_inverseProjectionMatrix; 113: uniform mat4 in_modelViewMatrix; 114: uniform mat4 in_inverseModelViewMatrix; 115: uniform mat4 in_textureDatasetMatrix; 116: uniform mat4 in_inverseTextureDatasetMatrix; 117: uniform mat4 in_texureToEyeIt; 118: 119: // Ray step size 120: uniform vec3 in_cellStep; 121: uniform vec2 in_scalarsRange[4]; 122: uniform vec3 in_cellSpacing; 123: 124: // Sample distance 125: uniform float in_sampleDistance; 126: 127: // Scales 128: uniform vec3 in_cellScale; 129: uniform vec2 in_windowLowerLeftCorner; 130: uniform vec2 in_inverseOriginalWindowSize; 131: uniform vec2 in_inverseWindowSize; 132: uniform vec3 in_textureExtentsMax; 133: uniform vec3 in_textureExtentsMin; 134: 135: // Material and lighting 136: uniform vec3 in_diffuse; 137: uniform vec3 in_ambient; 138: uniform vec3 in_specular; 139: uniform float in_shininess; 140: 141: // Others 142: uniform bool in_cellFlag; 143: uniform bool in_useJittering; 144: vec3 g_xvec; 145: vec3 g_yvec; 146: vec3 g_zvec; 147: uniform bool in_twoSidedLighting; 148: vec3 g_cellSpacing; 149: float g_avgSpacing; 150: vec4 g_fragWorldPos; 151: uniform int in_numberOfLights; 152: uniform vec3 in_lightAmbientColor[6]; 153: uniform vec3 in_lightDiffuseColor[6]; 154: uniform vec3 in_lightSpecularColor[6]; 155: uniform vec3 in_lightDirection[6]; 156: 157: //VTK::Termination::Dec 158: 159: //VTK::Cropping::Dec 160: 161: //VTK::Shading::Dec 162: 163: //VTK::BinaryMask::Dec 164: 165: //VTK::CompositeMask::Dec 166: 167: 168: uniform sampler2D in_opacityTransferFunc; 169: float computeOpacity(vec4 scalar) 170: { 171: return texture2D(in_opacityTransferFunc, vec2(scalar.w, 0)).r; 172: } 173: 174: 175: uniform sampler2D in_gradientTransferFunc; 176: float computeGradientOpacity(vec4 grad) 177: { 178: return texture2D(in_gradientTransferFunc, vec2(grad.w, 0.0)).r; 179: } 180: // c is short for component 181: vec4 computeGradient(int c) 182: { 183: vec3 g1; 184: vec4 g2; 185: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; 186: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; 187: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; 188: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; 189: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; 190: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; 191: g1 = g1 * in_volume_scale.r + in_volume_bias.r; 192: g2 = g2 * in_volume_scale.r + in_volume_bias.r; 193: g1.x = in_scalarsRange[c][0] + ( 194: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.x; 195: g1.y = in_scalarsRange[c][0] + ( 196: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.y; 197: g1.z = in_scalarsRange[c][0] + ( 198: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.z; 199: g2.x = in_scalarsRange[c][0] + ( 200: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.x; 201: g2.y = in_scalarsRange[c][0] + ( 202: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.y; 203: g2.z = in_scalarsRange[c][0] + ( 204: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.z; 205: g2.xyz = g1 - g2.xyz; 206: g2.x /= g_aspect.x; 207: g2.y /= g_aspect.y; 208: g2.z /= g_aspect.z; 209: g2.w = 0.0; 210: float grad_mag = length(g2); 211: if (grad_mag > 0.0) 212: { 213: g2.x /= grad_mag; 214: g2.y /= grad_mag; 215: g2.z /= grad_mag; 216: } 217: else 218: { 219: g2.xyz = vec3(0.0, 0.0, 0.0); 220: } 221: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[c][1] - 222: (in_scalarsRange[c][0]))); 223: grad_mag = clamp(grad_mag, 0.0, 1.0); 224: g2.w = grad_mag; 225: return g2; 226: } 227: 228: 229: vec4 computeLighting(vec4 color, int component) 230: { 231: vec4 finalColor = vec4(0.0); 232: // Compute gradient function only once 233: vec4 gradient = computeGradient(component); 234: g_fragWorldPos = in_modelViewMatrix * in_volumeMatrix * 235: in_textureDatasetMatrix * vec4(-g_dataPos, 1.0); 236: if (g_fragWorldPos.w != 0.0) 237: { 238: g_fragWorldPos /= g_fragWorldPos.w; 239: } 240: vec3 vdir = normalize(g_fragWorldPos.xyz); 241: vec3 normal = gradient.xyz; 242: vec3 ambient = vec3(0.0); 243: vec3 diffuse = vec3(0.0); 244: vec3 specular = vec3(0.0); 245: float normalLength = length(normal); 246: if (normalLength > 0.0) 247: { 248: normal = normalize((in_texureToEyeIt * vec4(normal, 0.0)).xyz); 249: } 250: else 251: { 252: normal = vec3(0.0, 0.0, 0.0); 253: } 254: for (int lightNum = 0; lightNum < in_numberOfLights; lightNum++) 255: { 256: vec3 ldir = in_lightDirection[lightNum].xyz; 257: vec3 h = normalize(ldir + vdir); 258: float nDotH = dot(normal, h); 259: if (nDotH < 0.0 && in_twoSidedLighting) 260: { 261: nDotH = -nDotH; 262: } 263: float nDotL = dot(normal, ldir); 264: if (nDotL < 0.0 && in_twoSidedLighting) 265: { 266: nDotL = -nDotL; 267: } 268: if (nDotL > 0.0) 269: { 270: diffuse += in_lightDiffuseColor[lightNum] * nDotL; 271: } 272: if (nDotH > 0.0) 273: { 274: specular = in_lightSpecularColor[lightNum] * pow(nDotH, in_shininess); 275: } 276: ambient += in_lightAmbientColor[lightNum]; 277: } 278: finalColor.xyz = in_ambient * ambient + 279: in_diffuse * diffuse * color.rgb + 280: in_specular * specular; 281: if (gradient.w >= 0.0) 282: { 283: color.a = color.a * 284: computeGradientOpacity(gradient); 285: } 286: finalColor.a = color.a; 287: return finalColor; 288: } 289: 290: 291: uniform sampler2D in_colorTransferFunc; 292: vec4 computeColor(vec4 scalar, float opacity) 293: { 294: return computeLighting(vec4(texture2D(in_colorTransferFunc, 295: vec2(scalar.w, 0.0)).xyz, opacity), 0); 296: } 297: 298: 299: vec3 computeRayDirection() 300: { 301: return normalize(ip_vertexPos.xyz - g_eyePosObj.xyz); 302: } 303: 304: /// We support only 8 clipping planes for now 305: /// The first value is the size of the data array for clipping 306: /// planes (origin, normal) 307: uniform float in_clippingPlanes[49]; 308: uniform float in_scale; 309: uniform float in_bias; 310: 311: ////////////////////////////////////////////////////////////////////////////// 312: /// 313: /// Main 314: /// 315: ////////////////////////////////////////////////////////////////////////////// 316: void main() 317: { 318: /// Initialize g_fragColor (output) to 0 319: g_fragColor = vec4(0.0); 320: g_dirStep = vec3(0.0); 321: g_srcColor = vec4(0.0); 322: g_exit = false; 323: 324: 325: bool l_adjustTextureExtents = !in_cellFlag; 326: // Get the 3D texture coordinates for lookup into the in_volume dataset 327: g_dataPos = ip_textureCoords.xyz; 328: 329: // Eye position in object space 330: g_eyePosObj = (in_inverseVolumeMatrix * vec4(in_cameraPos, 1.0)); 331: if (g_eyePosObj.w != 0.0) 332: { 333: g_eyePosObj.x /= g_eyePosObj.w; 334: g_eyePosObj.y /= g_eyePosObj.w; 335: g_eyePosObj.z /= g_eyePosObj.w; 336: g_eyePosObj.w = 1.0; 337: } 338: 339: // Getting the ray marching direction (in object space); 340: vec3 rayDir = computeRayDirection(); 341: 342: // Multiply the raymarching direction with the step size to get the 343: // sub-step size we need to take at each raymarching step 344: g_dirStep = (in_inverseTextureDatasetMatrix * 345: vec4(rayDir, 0.0)).xyz * in_sampleDistance; 346: 347: float jitterValue = (texture2D(in_noiseSampler, g_dataPos.xy).x); 348: if (in_useJittering) 349: { 350: g_dataPos += g_dirStep * jitterValue; 351: } 352: else 353: { 354: g_dataPos += g_dirStep; 355: } 356: 357: // Flag to deternmine if voxel should be considered for the rendering 358: bool l_skip = false; 359: g_cellSpacing = vec3(in_cellSpacing[0], 360: in_cellSpacing[1], 361: in_cellSpacing[2]); 362: g_avgSpacing = (g_cellSpacing[0] + 363: g_cellSpacing[1] + 364: g_cellSpacing[2])/3.0; 365: g_xvec = vec3(in_cellStep[0], 0.0, 0.0); 366: g_yvec = vec3(0.0, in_cellStep[1], 0.0); 367: g_zvec = vec3(0.0, 0.0, in_cellStep[2]); 368: // Adjust the aspect 369: g_aspect.x = g_cellSpacing[0] * 2.0 / g_avgSpacing; 370: g_aspect.y = g_cellSpacing[1] * 2.0 / g_avgSpacing; 371: g_aspect.z = g_cellSpacing[2] * 2.0 / g_avgSpacing; 372: 373: 374: // Minimum texture access coordinate 375: vec3 l_texMin = vec3(0.0); 376: vec3 l_texMax = vec3(1.0); 377: if (l_adjustTextureExtents) 378: { 379: vec3 delta = in_textureExtentsMax - in_textureExtentsMin; 380: l_texMin = vec3(0.5) / delta; 381: l_texMax = (delta - vec3(0.5)) / delta; 382: } 383: 384: // Flag to indicate if the raymarch loop should terminate 385: bool stop = false; 386: 387: // 2D Texture fragment coordinates [0,1] from fragment coordinates 388: // the frame buffer texture has the size of the plain buffer but 389: // we use a fraction of it. The texture coordinates is less than 1 if 390: // the reduction factor is less than 1. 391: // Device coordinates are between -1 and 1. We need texture 392: // coordinates between 0 and 1 the in_depthSampler buffer has the 393: // original size buffer. 394: vec2 fragTexCoord = (gl_FragCoord.xy - in_windowLowerLeftCorner) * 395: in_inverseWindowSize; 396: float l_terminatePointMax = 0.0; 397: 398: #ifdef GL_ES 399: vec4 l_depthValue = vec4(1.0,1.0,1.0,1.0); 400: #else 401: vec4 l_depthValue = texture2D(in_depthSampler, fragTexCoord); 402: #endif 403: // Depth test 404: if(gl_FragCoord.z >= l_depthValue.x) 405: { 406: discard; 407: } 408: 409: // color buffer or max scalar buffer have a reduced size. 410: fragTexCoord = (gl_FragCoord.xy - in_windowLowerLeftCorner) * 411: in_inverseOriginalWindowSize; 412: 413: // Compute max number of iterations it will take before we hit 414: // the termination point 415: 416: // Abscissa of the point on the depth buffer along the ray. 417: // point in texture coordinates 418: vec4 terminatePoint; 419: terminatePoint.x = (gl_FragCoord.x - in_windowLowerLeftCorner.x) * 2.0 * 420: in_inverseWindowSize.x - 1.0; 421: terminatePoint.y = (gl_FragCoord.y - in_windowLowerLeftCorner.y) * 2.0 * 422: in_inverseWindowSize.y - 1.0; 423: terminatePoint.z = (2.0 * l_depthValue.x - (gl_DepthRange.near + 424: gl_DepthRange.far)) / gl_DepthRange.diff; 425: terminatePoint.w = 1.0; 426: 427: // From normalized device coordinates to eye coordinates. 428: // in_projectionMatrix is inversed because of way VT 429: // From eye coordinates to texture coordinates 430: terminatePoint = in_inverseTextureDatasetMatrix * 431: in_inverseVolumeMatrix * 432: in_inverseModelViewMatrix * 433: in_inverseProjectionMatrix * 434: terminatePoint; 435: terminatePoint /= terminatePoint.w; 436: 437: l_terminatePointMax = length(terminatePoint.xyz - g_dataPos.xyz) / 438: length(g_dirStep); 439: float l_currentT = 0.0; 440: 441: //VTK::Shading::Init 442: 443: //VTK::Cropping::Init 444: 445: //VTK::Clipping::Init 446: 447: //VTK::RenderToImage::Init 448: 449: //VTK::DepthPass::Init 450: 451: /// For all samples along the ray 452: while (!g_exit) 453: { 454: 455: l_skip = false; 456: 457: //VTK::Cropping::Impl 458: 459: //VTK::Clipping::Impl 460: 461: //VTK::BinaryMask::Impl 462: 463: //VTK::CompositeMask::Impl 464: 465: 466: if (!l_skip) 467: { 468: vec4 scalar = texture3D(in_volume, g_dataPos); 469: scalar.r = scalar.r*in_volume_scale.r + in_volume_bias.r; 470: scalar = vec4(scalar.r,scalar.r,scalar.r,scalar.r); 471: g_srcColor = vec4(0.0); 472: g_srcColor.a = computeOpacity(scalar); 473: if (g_srcColor.a > 0.0) 474: { 475: g_srcColor = computeColor(scalar, g_srcColor.a); 476: // Opacity calculation using compositing: 477: // Here we use front to back compositing scheme whereby 478: // the current sample value is multiplied to the 479: // currently accumulated alpha and then this product 480: // is subtracted from the sample value to get the 481: // alpha from the previous steps. Next, this alpha is 482: // multiplied with the current sample colour 483: // and accumulated to the composited colour. The alpha 484: // value from the previous steps is then accumulated 485: // to the composited colour alpha. 486: g_srcColor.rgb *= g_srcColor.a; 487: g_fragColor = (1.0f - g_fragColor.a) * g_srcColor + g_fragColor; 488: } 489: } 490: 491: //VTK::RenderToImage::Impl 492: 493: //VTK::DepthPass::Impl 494: 495: /// Advance ray 496: g_dataPos += g_dirStep; 497: 498: 499: // sign function performs component wise operation and returns -1 500: // if the difference is less than 0, 0 if equal to 0, and 1 if 501: // above 0. So if the ray is inside the volume, dot product will 502: // always be 3. 503: stop = dot(sign(g_dataPos - l_texMin), sign(l_texMax - g_dataPos)) 504: < 3.0; 505: 506: // If the stopping condition is true we brek out of the ray marching 507: // loop 508: if (stop) 509: { 510: break; 511: } 512: // Early ray termination 513: // if the currently composited colour alpha is already fully saturated 514: // we terminated the loop or if we have hit an obstacle in the 515: // direction of they ray (using depth buffer) we terminate as well. 516: if((g_fragColor.a > (1.0 - 1.0/255.0)) || 517: l_currentT >= l_terminatePointMax) 518: { 519: break; 520: } 521: ++l_currentT; 522: } 523: 524: //VTK::Base::Exit 525: 526: //VTK::Terminate::Exit 527: 528: //VTK::Cropping::Exit 529: 530: //VTK::Clipping::Exit 531: 532: //VTK::Shading::Exit 533: 534: g_fragColor.r = g_fragColor.r * in_scale + in_bias * g_fragColor.a; 535: g_fragColor.g = g_fragColor.g * in_scale + in_bias * g_fragColor.a; 536: g_fragColor.b = g_fragColor.b * in_scale + in_bias * g_fragColor.a; 537: fragOutput0 = g_fragColor; 538: 539: //VTK::RenderToImage::Exit 540: 541: //VTK::DepthPass::Exit 542: } 543: ERROR: In Y:\ThirdParty\vtk700\Rendering\OpenGL2\vtkShaderProgram.cxx, line 379 vtkShaderProgram (00000000362FFA50): 0(206) : error C1008: undefined variable "g_aspect" 0(207) : error C1008: undefined variable "g_aspect" 0(208) : error C1008: undefined variable "g_aspect" 0(369) : error C1008: undefined variable "g_aspect" 0(370) : error C1008: undefined variable "g_aspect" 0(371) : error C1008: undefined variable "g_aspect" On Apr 04, 2016, at 11:49 AM, Aashish Chaudhary wrote: Yes please. If you can checkout the latest master, this should not happen.? Thanks, Aashish On Mon, Apr 4, 2016 at 11:48 AM, Richard Frank wrote: No I'm using 7.0.0 release not a git clone. I guess I should get the latest?? Rick On Apr 04, 2016, at 10:53 AM, Aashish Chaudhary wrote: Thanks, and are you using VTK master as of last week since we had this problem and got fixed recently. ? - Aashish On Mon, Apr 4, 2016 at 10:47 AM, Richard Frank wrote: Hi, Here is a portion of code: volumeProperty->SetColor(0, colorTransferFunction); volumeProperty->SetColor(1, maskColorTransferFunction); volumeProperty->SetScalarOpacity(opacityTransferFunction); volumeProperty->SetGradientOpacity(volumeGradientOpacityFunction); volumeProperty->SetInterpolationTypeToLinear(); volumeProperty->ShadeOn(); volumeProperty->SetAmbient(0.4); volumeProperty->SetDiffuse(0.8); volumeProperty->SetSpecular(0.2); volumeProperty->SetSpecularPower(105.0); volumeProperty->SetScalarOpacityUnitDistance(0.7); volume->SetProperty(volumeProperty); The hard coded numbers are just picked empirically by viewing our most common inputs. On Apr 03, 2016, at 10:26 PM, Aashish Chaudhary wrote: Rick,? Can you send me information on what you are turning on in volume property and in mapper that leads to this crash? Also, is your data is single or 2 or 4 component?? Thanks, On Sun, Apr 3, 2016 at 9:25 PM, Richard Frank wrote: Further investigation seems to point the GradientOpacity section of shader ?raycasterfs.glsl, code which seems to?be?inserted at runtime: I guess gl_aspect is not defined in this scenario? Any suggestions welcome! Rick vec4 computeGradient() 145: { 146: vec3 g1; 147: vec4 g2; 148: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; 149: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; 150: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; 151: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; 152: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; 153: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; 154: g1 = g1*in_volume_scale.r + in_volume_bias.r; 155: g2 = g2*in_volume_scale.r + in_volume_bias.r; 156: g1.x = in_scalarsRange[0] + ( 157: in_scalarsRange[1] - in_scalarsRange[0]) * g1.x; 158: g1.y = in_scalarsRange[0] + ( 159: in_scalarsRange[1] - in_scalarsRange[0]) * g1.y; 160: g1.z = in_scalarsRange[0] + ( 161: in_scalarsRange[1] - in_scalarsRange[0]) * g1.z; 162: g2.x = in_scalarsRange[0] + ( 163: in_scalarsRange[1] - in_scalarsRange[0]) * g2.x; 164: g2.y = in_scalarsRange[0] + ( 165: in_scalarsRange[1] - in_scalarsRange[0]) * g2.y; 166: g2.z = in_scalarsRange[0] + ( 167: in_scalarsRange[1] - in_scalarsRange[0]) * g2.z; 168: g2.xyz = g1 - g2.xyz; 169: g2.x /= g_aspect.x; 170: g2.y /= g_aspect.y; 171: g2.z /= g_aspect.z; 172: float grad_mag = sqrt(g2.x * g2.x + 173: g2.y * g2.y + 174: g2.z * g2.z); 175: if (grad_mag > 0.0) 176: { 177: g2.x /= grad_mag; 178: g2.y /= grad_mag; 179: g2.z /= grad_mag; 180: } 181: else 182: { 183: g2.xyz = vec3(0.0, 0.0, 0.0); 184: } 185: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[1] - 186: (in_scalarsRange[0]))); 187: grad_mag = clamp(grad_mag, 0.0, 1.0); 188: g2.w = grad_mag; 189: return g2; 190: } _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- | Aashish Chaudhary | Technical Leader ? ? ? ?? | Kitware Inc.? ? ? ? ? ? |?http://www.kitware.com/company/team/chaudhary.html -- | Aashish Chaudhary | Technical Leader ? ? ? ?? | Kitware Inc.? ? ? ? ? ? |?http://www.kitware.com/company/team/chaudhary.html -- | Aashish Chaudhary | Technical Leader ? ? ? ?? | Kitware Inc.? ? ? ? ? ? |?http://www.kitware.com/company/team/chaudhary.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Thu Apr 7 12:23:33 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Thu, 7 Apr 2016 12:23:33 -0400 Subject: [vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx, continued In-Reply-To: <9dc67826-d10c-4bea-a0ac-8b06268efc57@me.com> References: <9dc67826-d10c-4bea-a0ac-8b06268efc57@me.com> Message-ID: Thanks for trying it out. I will have a look at it today. - Aashish On Thu, Apr 7, 2016 at 11:45 AM, Richard Frank wrote: > Hi, > > I pulled from git about 2 or 3 days ago, and got around to testing this AM. > > I still crash, albeit slightly different place it seems but the same > undefined gl_aspect > > : > > ERROR: In Y:\ThirdParty\vtk700\Rendering\OpenGL2\vtkShaderProgram.cxx, > line 378 > vtkShaderProgram (00000000362FFA50): 1: #version 150 > 2: #ifdef GL_ES > 3: #if __VERSION__ == 300 > 4: #define varying in > 5: #ifdef GL_FRAGMENT_PRECISION_HIGH > 6: precision highp float; > 7: precision highp sampler2D; > 8: precision highp sampler3D; > 9: #else > 10: precision mediump float; > 11: precision mediump sampler2D; > 12: precision mediump sampler3D; > 13: #endif > 14: #define texelFetchBuffer texelFetch > 15: #define texture1D texture > 16: #define texture2D texture > 17: #define texture3D texture > 18: #endif // 300 > 19: #if __VERSION__ == 100 > 20: #extension GL_OES_standard_derivatives : enable > 21: #ifdef GL_FRAGMENT_PRECISION_HIGH > 22: precision highp float; > 23: #else > 24: precision mediump float; > 25: #endif > 26: #endif // 100 > 27: #else // GL_ES > 28: #define highp > 29: #define mediump > 30: #define lowp > 31: #if __VERSION__ == 150 > 32: #define varying in > 33: #define texelFetchBuffer texelFetch > 34: #define texture1D texture > 35: #define texture2D texture > 36: #define texture3D texture > 37: #endif > 38: #if __VERSION__ == 120 > 39: #extension GL_EXT_gpu_shader4 : require > 40: #endif > 41: #endif // GL_ES > 42: > 43: > 44: > /*========================================================================= > 45: > 46: Program: Visualization Toolkit > 47: Module: raycasterfs.glsl > 48: > 49: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen > 50: All rights reserved. > 51: See Copyright.txt or http://www.kitware.com/Copyright.htm for details. > 52: > 53: This software is distributed WITHOUT ANY WARRANTY; without even > 54: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR > 55: PURPOSE. See the above copyright notice for more information. > 56: > 57: > =========================================================================*/ > 58: > 59: > ////////////////////////////////////////////////////////////////////////////// > 60: /// > 61: /// Inputs > 62: /// > 63: > ////////////////////////////////////////////////////////////////////////////// > 64: > 65: /// 3D texture coordinates form vertex shader > 66: varying vec3 ip_textureCoords; > 67: varying vec3 ip_vertexPos; > 68: > 69: > ////////////////////////////////////////////////////////////////////////////// > 70: /// > 71: /// Outputs > 72: /// > 73: > ////////////////////////////////////////////////////////////////////////////// > 74: > 75: vec4 g_fragColor = vec4(0.0); > 76: > 77: > ////////////////////////////////////////////////////////////////////////////// > 78: /// > 79: /// Uniforms, attributes, and globals > 80: /// > 81: > ////////////////////////////////////////////////////////////////////////////// > 82: vec3 g_dataPos; > 83: vec3 g_dirStep; > 84: vec4 g_srcColor; > 85: vec4 g_eyePosObj; > 86: bool g_exit; > 87: > 88: uniform vec4 in_volume_scale; > 89: uniform vec4 in_volume_bias; > 90: > 91: out vec4 fragOutput0; > 92: > 93: > 94: > 95: // Volume dataset > 96: uniform sampler3D in_volume; > 97: uniform int in_noOfComponents; > 98: uniform int in_independentComponents; > 99: > 100: uniform sampler2D in_noiseSampler; > 101: #ifndef GL_ES > 102: uniform sampler2D in_depthSampler; > 103: #endif > 104: > 105: // Camera position > 106: uniform vec3 in_cameraPos; > 107: > 108: // view and model matrices > 109: uniform mat4 in_volumeMatrix; > 110: uniform mat4 in_inverseVolumeMatrix; > 111: uniform mat4 in_projectionMatrix; > 112: uniform mat4 in_inverseProjectionMatrix; > 113: uniform mat4 in_modelViewMatrix; > 114: uniform mat4 in_inverseModelViewMatrix; > 115: uniform mat4 in_textureDatasetMatrix; > 116: uniform mat4 in_inverseTextureDatasetMatrix; > 117: uniform mat4 in_texureToEyeIt; > 118: > 119: // Ray step size > 120: uniform vec3 in_cellStep; > 121: uniform vec2 in_scalarsRange[4]; > 122: uniform vec3 in_cellSpacing; > 123: > 124: // Sample distance > 125: uniform float in_sampleDistance; > 126: > 127: // Scales > 128: uniform vec3 in_cellScale; > 129: uniform vec2 in_windowLowerLeftCorner; > 130: uniform vec2 in_inverseOriginalWindowSize; > 131: uniform vec2 in_inverseWindowSize; > 132: uniform vec3 in_textureExtentsMax; > 133: uniform vec3 in_textureExtentsMin; > 134: > 135: // Material and lighting > 136: uniform vec3 in_diffuse; > 137: uniform vec3 in_ambient; > 138: uniform vec3 in_specular; > 139: uniform float in_shininess; > 140: > 141: // Others > 142: uniform bool in_cellFlag; > 143: uniform bool in_useJittering; > 144: vec3 g_xvec; > 145: vec3 g_yvec; > 146: vec3 g_zvec; > 147: uniform bool in_twoSidedLighting; > 148: vec3 g_cellSpacing; > 149: float g_avgSpacing; > 150: vec4 g_fragWorldPos; > 151: uniform int in_numberOfLights; > 152: uniform vec3 in_lightAmbientColor[6]; > 153: uniform vec3 in_lightDiffuseColor[6]; > 154: uniform vec3 in_lightSpecularColor[6]; > 155: uniform vec3 in_lightDirection[6]; > 156: > 157: //VTK::Termination::Dec > 158: > 159: //VTK::Cropping::Dec > 160: > 161: //VTK::Shading::Dec > 162: > 163: //VTK::BinaryMask::Dec > 164: > 165: //VTK::CompositeMask::Dec > 166: > 167: > 168: uniform sampler2D in_opacityTransferFunc; > 169: float computeOpacity(vec4 scalar) > 170: { > 171: return texture2D(in_opacityTransferFunc, vec2(scalar.w, 0)).r; > 172: } > 173: > 174: > 175: uniform sampler2D in_gradientTransferFunc; > 176: float computeGradientOpacity(vec4 grad) > 177: { > 178: return texture2D(in_gradientTransferFunc, vec2(grad.w, 0.0)).r; > 179: } > 180: // c is short for component > 181: vec4 computeGradient(int c) > 182: { > 183: vec3 g1; > 184: vec4 g2; > 185: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; > 186: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; > 187: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; > 188: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; > 189: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; > 190: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; > 191: g1 = g1 * in_volume_scale.r + in_volume_bias.r; > 192: g2 = g2 * in_volume_scale.r + in_volume_bias.r; > 193: g1.x = in_scalarsRange[c][0] + ( > 194: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.x; > 195: g1.y = in_scalarsRange[c][0] + ( > 196: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.y; > 197: g1.z = in_scalarsRange[c][0] + ( > 198: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.z; > 199: g2.x = in_scalarsRange[c][0] + ( > 200: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.x; > 201: g2.y = in_scalarsRange[c][0] + ( > 202: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.y; > 203: g2.z = in_scalarsRange[c][0] + ( > 204: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.z; > 205: g2.xyz = g1 - g2.xyz; > 206: g2.x /= g_aspect.x; > 207: g2.y /= g_aspect.y; > 208: g2.z /= g_aspect.z; > 209: g2.w = 0.0; > 210: float grad_mag = length(g2); > 211: if (grad_mag > 0.0) > 212: { > 213: g2.x /= grad_mag; > 214: g2.y /= grad_mag; > 215: g2.z /= grad_mag; > 216: } > 217: else > 218: { > 219: g2.xyz = vec3(0.0, 0.0, 0.0); > 220: } > 221: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[c][1] - > 222: (in_scalarsRange[c][0]))); > 223: grad_mag = clamp(grad_mag, 0.0, 1.0); > 224: g2.w = grad_mag; > 225: return g2; > 226: } > 227: > 228: > 229: vec4 computeLighting(vec4 color, int component) > 230: { > 231: vec4 finalColor = vec4(0.0); > 232: // Compute gradient function only once > 233: vec4 gradient = computeGradient(component); > 234: g_fragWorldPos = in_modelViewMatrix * in_volumeMatrix * > 235: in_textureDatasetMatrix * vec4(-g_dataPos, 1.0); > 236: if (g_fragWorldPos.w != 0.0) > 237: { > 238: g_fragWorldPos /= g_fragWorldPos.w; > 239: } > 240: vec3 vdir = normalize(g_fragWorldPos.xyz); > 241: vec3 normal = gradient.xyz; > 242: vec3 ambient = vec3(0.0); > 243: vec3 diffuse = vec3(0.0); > 244: vec3 specular = vec3(0.0); > 245: float normalLength = length(normal); > 246: if (normalLength > 0.0) > 247: { > 248: normal = normalize((in_texureToEyeIt * vec4(normal, 0.0)).xyz); > 249: } > 250: else > 251: { > 252: normal = vec3(0.0, 0.0, 0.0); > 253: } > 254: for (int lightNum = 0; lightNum < in_numberOfLights; lightNum++) > 255: { > 256: vec3 ldir = in_lightDirection[lightNum].xyz; > 257: vec3 h = normalize(ldir + vdir); > 258: float nDotH = dot(normal, h); > 259: if (nDotH < 0.0 && in_twoSidedLighting) > 260: { > 261: nDotH = -nDotH; > 262: } > 263: float nDotL = dot(normal, ldir); > 264: if (nDotL < 0.0 && in_twoSidedLighting) > 265: { > 266: nDotL = -nDotL; > 267: } > 268: if (nDotL > 0.0) > 269: { > 270: diffuse += in_lightDiffuseColor[lightNum] * nDotL; > 271: } > 272: if (nDotH > 0.0) > 273: { > 274: specular = in_lightSpecularColor[lightNum] * pow(nDotH, > in_shininess); > 275: } > 276: ambient += in_lightAmbientColor[lightNum]; > 277: } > 278: finalColor.xyz = in_ambient * ambient + > 279: in_diffuse * diffuse * color.rgb + > 280: in_specular * specular; > 281: if (gradient.w >= 0.0) > 282: { > 283: color.a = color.a * > 284: computeGradientOpacity(gradient); > 285: } > 286: finalColor.a = color.a; > 287: return finalColor; > 288: } > 289: > 290: > 291: uniform sampler2D in_colorTransferFunc; > 292: vec4 computeColor(vec4 scalar, float opacity) > 293: { > 294: return computeLighting(vec4(texture2D(in_colorTransferFunc, > 295: vec2(scalar.w, 0.0)).xyz, opacity), 0); > 296: } > 297: > 298: > 299: vec3 computeRayDirection() > 300: { > 301: return normalize(ip_vertexPos.xyz - g_eyePosObj.xyz); > 302: } > 303: > 304: /// We support only 8 clipping planes for now > 305: /// The first value is the size of the data array for clipping > 306: /// planes (origin, normal) > 307: uniform float in_clippingPlanes[49]; > 308: uniform float in_scale; > 309: uniform float in_bias; > 310: > 311: > ////////////////////////////////////////////////////////////////////////////// > 312: /// > 313: /// Main > 314: /// > 315: > ////////////////////////////////////////////////////////////////////////////// > 316: void main() > 317: { > 318: /// Initialize g_fragColor (output) to 0 > 319: g_fragColor = vec4(0.0); > 320: g_dirStep = vec3(0.0); > 321: g_srcColor = vec4(0.0); > 322: g_exit = false; > 323: > 324: > 325: bool l_adjustTextureExtents = !in_cellFlag; > 326: // Get the 3D texture coordinates for lookup into the in_volume > dataset > 327: g_dataPos = ip_textureCoords.xyz; > 328: > 329: // Eye position in object space > 330: g_eyePosObj = (in_inverseVolumeMatrix * vec4(in_cameraPos, 1.0)); > 331: if (g_eyePosObj.w != 0.0) > 332: { > 333: g_eyePosObj.x /= g_eyePosObj.w; > 334: g_eyePosObj.y /= g_eyePosObj.w; > 335: g_eyePosObj.z /= g_eyePosObj.w; > 336: g_eyePosObj.w = 1.0; > 337: } > 338: > 339: // Getting the ray marching direction (in object space); > 340: vec3 rayDir = computeRayDirection(); > 341: > 342: // Multiply the raymarching direction with the step size to get the > 343: // sub-step size we need to take at each raymarching step > 344: g_dirStep = (in_inverseTextureDatasetMatrix * > 345: vec4(rayDir, 0.0)).xyz * in_sampleDistance; > 346: > 347: float jitterValue = (texture2D(in_noiseSampler, g_dataPos.xy).x); > 348: if (in_useJittering) > 349: { > 350: g_dataPos += g_dirStep * jitterValue; > 351: } > 352: else > 353: { > 354: g_dataPos += g_dirStep; > 355: } > 356: > 357: // Flag to deternmine if voxel should be considered for the rendering > 358: bool l_skip = false; > 359: g_cellSpacing = vec3(in_cellSpacing[0], > 360: in_cellSpacing[1], > 361: in_cellSpacing[2]); > 362: g_avgSpacing = (g_cellSpacing[0] + > 363: g_cellSpacing[1] + > 364: g_cellSpacing[2])/3.0; > 365: g_xvec = vec3(in_cellStep[0], 0.0, 0.0); > 366: g_yvec = vec3(0.0, in_cellStep[1], 0.0); > 367: g_zvec = vec3(0.0, 0.0, in_cellStep[2]); > 368: // Adjust the aspect > 369: g_aspect.x = g_cellSpacing[0] * 2.0 / g_avgSpacing; > 370: g_aspect.y = g_cellSpacing[1] * 2.0 / g_avgSpacing; > 371: g_aspect.z = g_cellSpacing[2] * 2.0 / g_avgSpacing; > 372: > 373: > 374: // Minimum texture access coordinate > 375: vec3 l_texMin = vec3(0.0); > 376: vec3 l_texMax = vec3(1.0); > 377: if (l_adjustTextureExtents) > 378: { > 379: vec3 delta = in_textureExtentsMax - in_textureExtentsMin; > 380: l_texMin = vec3(0.5) / delta; > 381: l_texMax = (delta - vec3(0.5)) / delta; > 382: } > 383: > 384: // Flag to indicate if the raymarch loop should terminate > 385: bool stop = false; > 386: > 387: // 2D Texture fragment coordinates [0,1] from fragment coordinates > 388: // the frame buffer texture has the size of the plain buffer but > 389: // we use a fraction of it. The texture coordinates is less than 1 if > 390: // the reduction factor is less than 1. > 391: // Device coordinates are between -1 and 1. We need texture > 392: // coordinates between 0 and 1 the in_depthSampler buffer has the > 393: // original size buffer. > 394: vec2 fragTexCoord = (gl_FragCoord.xy - in_windowLowerLeftCorner) * > 395: in_inverseWindowSize; > 396: float l_terminatePointMax = 0.0; > 397: > 398: #ifdef GL_ES > 399: vec4 l_depthValue = vec4(1.0,1.0,1.0,1.0); > 400: #else > 401: vec4 l_depthValue = texture2D(in_depthSampler, fragTexCoord); > 402: #endif > 403: // Depth test > 404: if(gl_FragCoord.z >= l_depthValue.x) > 405: { > 406: discard; > 407: } > 408: > 409: // color buffer or max scalar buffer have a reduced size. > 410: fragTexCoord = (gl_FragCoord.xy - in_windowLowerLeftCorner) * > 411: in_inverseOriginalWindowSize; > 412: > 413: // Compute max number of iterations it will take before we hit > 414: // the termination point > 415: > 416: // Abscissa of the point on the depth buffer along the ray. > 417: // point in texture coordinates > 418: vec4 terminatePoint; > 419: terminatePoint.x = (gl_FragCoord.x - in_windowLowerLeftCorner.x) * > 2.0 * > 420: in_inverseWindowSize.x - 1.0; > 421: terminatePoint.y = (gl_FragCoord.y - in_windowLowerLeftCorner.y) * > 2.0 * > 422: in_inverseWindowSize.y - 1.0; > 423: terminatePoint.z = (2.0 * l_depthValue.x - (gl_DepthRange.near + > 424: gl_DepthRange.far)) / gl_DepthRange.diff; > 425: terminatePoint.w = 1.0; > 426: > 427: // From normalized device coordinates to eye coordinates. > 428: // in_projectionMatrix is inversed because of way VT > 429: // From eye coordinates to texture coordinates > 430: terminatePoint = in_inverseTextureDatasetMatrix * > 431: in_inverseVolumeMatrix * > 432: in_inverseModelViewMatrix * > 433: in_inverseProjectionMatrix * > 434: terminatePoint; > 435: terminatePoint /= terminatePoint.w; > 436: > 437: l_terminatePointMax = length(terminatePoint.xyz - g_dataPos.xyz) / > 438: length(g_dirStep); > 439: float l_currentT = 0.0; > 440: > 441: //VTK::Shading::Init > 442: > 443: //VTK::Cropping::Init > 444: > 445: //VTK::Clipping::Init > 446: > 447: //VTK::RenderToImage::Init > 448: > 449: //VTK::DepthPass::Init > 450: > 451: /// For all samples along the ray > 452: while (!g_exit) > 453: { > 454: > 455: l_skip = false; > 456: > 457: //VTK::Cropping::Impl > 458: > 459: //VTK::Clipping::Impl > 460: > 461: //VTK::BinaryMask::Impl > 462: > 463: //VTK::CompositeMask::Impl > 464: > 465: > 466: if (!l_skip) > 467: { > 468: vec4 scalar = texture3D(in_volume, g_dataPos); > 469: scalar.r = scalar.r*in_volume_scale.r + in_volume_bias.r; > 470: scalar = vec4(scalar.r,scalar.r,scalar.r,scalar.r); > 471: g_srcColor = vec4(0.0); > 472: g_srcColor.a = computeOpacity(scalar); > 473: if (g_srcColor.a > 0.0) > 474: { > 475: g_srcColor = computeColor(scalar, g_srcColor.a); > 476: // Opacity calculation using compositing: > 477: // Here we use front to back compositing scheme whereby > 478: // the current sample value is multiplied to the > 479: // currently accumulated alpha and then this product > 480: // is subtracted from the sample value to get the > 481: // alpha from the previous steps. Next, this alpha is > 482: // multiplied with the current sample colour > 483: // and accumulated to the composited colour. The alpha > 484: // value from the previous steps is then accumulated > 485: // to the composited colour alpha. > 486: g_srcColor.rgb *= g_srcColor.a; > 487: g_fragColor = (1.0f - g_fragColor.a) * g_srcColor + g_fragColor; > 488: } > 489: } > 490: > 491: //VTK::RenderToImage::Impl > 492: > 493: //VTK::DepthPass::Impl > 494: > 495: /// Advance ray > 496: g_dataPos += g_dirStep; > 497: > 498: > 499: // sign function performs component wise operation and returns -1 > 500: // if the difference is less than 0, 0 if equal to 0, and 1 if > 501: // above 0. So if the ray is inside the volume, dot product will > 502: // always be 3. > 503: stop = dot(sign(g_dataPos - l_texMin), sign(l_texMax - g_dataPos)) > 504: < 3.0; > 505: > 506: // If the stopping condition is true we brek out of the ray marching > 507: // loop > 508: if (stop) > 509: { > 510: break; > 511: } > 512: // Early ray termination > 513: // if the currently composited colour alpha is already fully > saturated > 514: // we terminated the loop or if we have hit an obstacle in the > 515: // direction of they ray (using depth buffer) we terminate as well. > 516: if((g_fragColor.a > (1.0 - 1.0/255.0)) || > 517: l_currentT >= l_terminatePointMax) > 518: { > 519: break; > 520: } > 521: ++l_currentT; > 522: } > 523: > 524: //VTK::Base::Exit > 525: > 526: //VTK::Terminate::Exit > 527: > 528: //VTK::Cropping::Exit > 529: > 530: //VTK::Clipping::Exit > 531: > 532: //VTK::Shading::Exit > 533: > 534: g_fragColor.r = g_fragColor.r * in_scale + in_bias * g_fragColor.a; > 535: g_fragColor.g = g_fragColor.g * in_scale + in_bias * g_fragColor.a; > 536: g_fragColor.b = g_fragColor.b * in_scale + in_bias * g_fragColor.a; > 537: fragOutput0 = g_fragColor; > 538: > 539: //VTK::RenderToImage::Exit > 540: > 541: //VTK::DepthPass::Exit > 542: } > 543: > > > > ERROR: In Y:\ThirdParty\vtk700\Rendering\OpenGL2\vtkShaderProgram.cxx, > line 379 > vtkShaderProgram (00000000362FFA50): 0(206) : error C1008: undefined > variable "g_aspect" > 0(207) : error C1008: undefined variable "g_aspect" > 0(208) : error C1008: undefined variable "g_aspect" > 0(369) : error C1008: undefined variable "g_aspect" > 0(370) : error C1008: undefined variable "g_aspect" > 0(371) : error C1008: undefined variable "g_aspect" > > > > On Apr 04, 2016, at 11:49 AM, Aashish Chaudhary < > aashish.chaudhary at kitware.com> wrote: > > Yes please. If you can checkout the latest master, this should not happen. > > Thanks, > Aashish > > On Mon, Apr 4, 2016 at 11:48 AM, Richard Frank wrote: > >> No I'm using 7.0.0 release not a git clone. >> >> I guess I should get the latest? >> >> Rick >> >> >> On Apr 04, 2016, at 10:53 AM, Aashish Chaudhary < >> aashish.chaudhary at kitware.com> wrote: >> >> Thanks, and are you using VTK master as of last week since we had this >> problem and got fixed recently. >> >> - Aashish >> >> On Mon, Apr 4, 2016 at 10:47 AM, Richard Frank wrote: >> >>> Hi, >>> >>> Here is a portion of code: >>> >>> >>> volumeProperty->SetColor(0, colorTransferFunction); >>> volumeProperty->SetColor(1, maskColorTransferFunction); >>> volumeProperty->SetScalarOpacity(opacityTransferFunction); >>> volumeProperty->SetGradientOpacity(volumeGradientOpacityFunction); >>> volumeProperty->SetInterpolationTypeToLinear(); >>> volumeProperty->ShadeOn(); >>> volumeProperty->SetAmbient(0.4); >>> volumeProperty->SetDiffuse(0.8); >>> volumeProperty->SetSpecular(0.2); >>> volumeProperty->SetSpecularPower(105.0); >>> volumeProperty->SetScalarOpacityUnitDistance(0.7); >>> volume->SetProperty(volumeProperty); >>> >>> The hard coded numbers are just picked empirically by viewing our most >>> common inputs. >>> >>> On Apr 03, 2016, at 10:26 PM, Aashish Chaudhary < >>> aashish.chaudhary at kitware.com> wrote: >>> >>> Rick, >>> >>> Can you send me information on what you are turning on in volume >>> property and in mapper that leads to this crash? Also, is your data is >>> single or 2 or 4 component? >>> >>> Thanks, >>> >>> >>> On Sun, Apr 3, 2016 at 9:25 PM, Richard Frank wrote: >>> >>>> Further investigation seems to point the GradientOpacity section of >>>> shader raycasterfs.glsl, code which seems to be inserted at runtime: I >>>> guess gl_aspect is not defined in this scenario? >>>> >>>> Any suggestions welcome! >>>> >>>> Rick >>>> >>>> vec4 computeGradient() >>>> 145: { >>>> 146: vec3 g1; >>>> 147: vec4 g2; >>>> 148: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; >>>> 149: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; >>>> 150: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; >>>> 151: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; >>>> 152: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; >>>> 153: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; >>>> 154: g1 = g1*in_volume_scale.r + in_volume_bias.r; >>>> 155: g2 = g2*in_volume_scale.r + in_volume_bias.r; >>>> 156: g1.x = in_scalarsRange[0] + ( >>>> 157: in_scalarsRange[1] - in_scalarsRange[0]) * g1.x; >>>> 158: g1.y = in_scalarsRange[0] + ( >>>> 159: in_scalarsRange[1] - in_scalarsRange[0]) * g1.y; >>>> 160: g1.z = in_scalarsRange[0] + ( >>>> 161: in_scalarsRange[1] - in_scalarsRange[0]) * g1.z; >>>> 162: g2.x = in_scalarsRange[0] + ( >>>> 163: in_scalarsRange[1] - in_scalarsRange[0]) * g2.x; >>>> 164: g2.y = in_scalarsRange[0] + ( >>>> 165: in_scalarsRange[1] - in_scalarsRange[0]) * g2.y; >>>> 166: g2.z = in_scalarsRange[0] + ( >>>> 167: in_scalarsRange[1] - in_scalarsRange[0]) * g2.z; >>>> 168: g2.xyz = g1 - g2.xyz; >>>> 169: g2.x /= g_aspect.x; >>>> 170: g2.y /= g_aspect.y; >>>> 171: g2.z /= g_aspect.z; >>>> 172: float grad_mag = sqrt(g2.x * g2.x + >>>> 173: g2.y * g2.y + >>>> 174: g2.z * g2.z); >>>> 175: if (grad_mag > 0.0) >>>> 176: { >>>> 177: g2.x /= grad_mag; >>>> 178: g2.y /= grad_mag; >>>> 179: g2.z /= grad_mag; >>>> 180: } >>>> 181: else >>>> 182: { >>>> 183: g2.xyz = vec3(0.0, 0.0, 0.0); >>>> 184: } >>>> 185: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[1] - >>>> 186: (in_scalarsRange[0]))); >>>> 187: grad_mag = clamp(grad_mag, 0.0, 1.0); >>>> 188: g2.w = grad_mag; >>>> 189: return g2; >>>> 190: } >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>> >>> >>> -- >>> >>> >>> >>> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >>> * >>> *| http://www.kitware.com/company/team/chaudhary.html >>> * >>> >>> >> >> >> -- >> >> >> >> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >> * >> *| http://www.kitware.com/company/team/chaudhary.html >> * >> >> > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From livc at outlook.com Thu Apr 7 12:27:58 2016 From: livc at outlook.com (Zhao Li) Date: Fri, 8 Apr 2016 00:27:58 +0800 Subject: [vtkusers] error LNK1104: cannot open file 'vtkRendering.lib' Message-ID: Hello,I try to creat my first VTK(7.0) project but it can't be complied: Error 1 error LNK1104: cannot open file 'vtkRendering.lib' F:\VTK\Examples\Chap01\bin\LINK 1.3_TestVTKInstall What should I do? Thanks for help,Zhao Li CMakeLists.txt: CMAKE_MINIMUM_REQUIRED(VERSION 2.8)PROJECT(Chap01)FIND_PACKAGE(VTK REQUIRED)INCLUDE(${VTK_USE_FILE})ADD_EXECUTABLE(1.3_TestVTKInstall 1.3_TestVTKInstall.cpp)TARGET_LINK_LIBRARIES(1.3_TestVTKInstall vtkRendering vtkCommon) 1.3_TestVTKInstall.cpp #include #include int main(){ vtkSmartPointer renWin = vtkSmartPointer::New(); renWin -> Render(); std::cin.get(); return 0;} -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Thu Apr 7 12:46:38 2016 From: drescherjm at gmail.com (John Drescher) Date: Thu, 7 Apr 2016 12:46:38 -0400 Subject: [vtkusers] error LNK1104: cannot open file 'vtkRendering.lib' In-Reply-To: References: Message-ID: Replace vtkRendering vtkCommon with ${VTK_LIBRARIES} John On Thu, Apr 7, 2016 at 12:27 PM, Zhao Li wrote: > Hello, > I try to creat my first VTK(7.0) project but it can't be complied: > > > Error 1 error LNK1104: cannot open file 'vtkRendering.lib' > F:\VTK\Examples\Chap01\bin\LINK 1.3_TestVTKInstall > > What should I do? > > > Thanks for help, > Zhao Li > > > > > > > > CMakeLists.txt: > > CMAKE_MINIMUM_REQUIRED(VERSION 2.8) > PROJECT(Chap01) > FIND_PACKAGE(VTK REQUIRED) > INCLUDE(${VTK_USE_FILE}) > ADD_EXECUTABLE(1.3_TestVTKInstall 1.3_TestVTKInstall.cpp) > TARGET_LINK_LIBRARIES(1.3_TestVTKInstall vtkRendering vtkCommon) > > > > 1.3_TestVTKInstall.cpp > > #include > #include > > int main(){ > vtkSmartPointer renWin = > vtkSmartPointer::New(); > renWin -> Render(); > std::cin.get(); > return 0; > } > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- John M. Drescher From david.lonie at kitware.com Thu Apr 7 14:15:36 2016 From: david.lonie at kitware.com (David Lonie) Date: Thu, 7 Apr 2016 14:15:36 -0400 Subject: [vtkusers] Non-virtual version of vtkDataArrayTemplate In-Reply-To: References: Message-ID: To finish this off, all of the tools are in VTK, and I checked that they're all there in VTK 6 :) Try: typedef float MyType; vtkDataArray *myArray = vtkDataArray::CreateDataArray( vtkTypeTraits::VTKTypeID()); Best, Dave On Thu, Apr 7, 2016 at 9:50 AM, Shawn Waldon wrote: > Matthieu, > > If you have the VTK type code (VTK_INT, VTK_FLOAT, etc) there is a > function vtkDataArray::CreateDataArray(int type) that takes this type > code. You'll still have to do the first part of the code Cory gave, but > the switch statement is already implemented in VTK. I don't know if there > is anything that takes the template parameter and gives the type code > though. > > HTH, > Shawn > > On Thu, Apr 7, 2016 at 9:35 AM, Cory Quammen > wrote: > >> Hi Matthieu, >> >> I'm not sure if there is a templated array factory in VTK to do this. >> >> You could make specialized templated utility functions specialized for >> each of your types, e.g. (not tested): >> >> template >> int GetVTKType(T *) >> { >> return 0; >> } >> >> template <> >> int GetVTKType(int *) >> { >> return VTK_INT; >> } >> >> template <> >> int GetVTKType(float* ) >> { >> return VTK_FLOAT; >> } >> >> and so on, then use this to create the right type of array in a switch >> statement: >> >> int arrayType = GetVTKType(); >> switch (arrayType) >> { >> case VTK_INT: >> return vtkIntArray::New(); >> break; >> >> case VTK_FLOAT: >> return vtkFloatArray::New(); >> break; >> >> default: >> //... >> } >> >> HTH, >> Cory >> >> On Thu, Apr 7, 2016 at 7:08 AM, Matthieu Heitz >> wrote: >> >>> Hi all ! >>> >>> I have a template class myClass, where T can be a scalar (float, int, >>> double, etc.) >>> I would like to create a vtkFloatArray, vtkIntArray, or vtkDoubleArray, >>> depending on the type T. >>> I thought that vtkDataArrayTemplate would be a good solution. >>> Unfortunately, it is a virtual class, so I can't write this : >>> >>> vtkSmartPointer< vtkDataArrayTemplate > array = >>> vtkSmartPointer >::New(); >>> >>> because when I try to instantiate a myClass, I get the error : >>> >>> error: invalid conversion from ?vtkObject*? to >>> ?vtkDataArrayTemplate*? [-fpermissive] >>> >>> So my question is: Is there an non-virtual version of >>> vtkDataArrayTemplate that would allow me to create a vtkFloatArray when T >>> is float, vtkDoubleArray when T is double, etc. >>> >>> P.S: I use VTK 6.0.0 >>> >>> Thank you ! >>> Matthieu Heitz >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> >> >> -- >> Cory Quammen >> R&D Engineer >> Kitware, Inc. >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rbirkus at gmail.com Thu Apr 7 18:40:26 2016 From: rbirkus at gmail.com (Birky22) Date: Thu, 7 Apr 2016 15:40:26 -0700 (MST) Subject: [vtkusers] CMake Error -- version doesn't match In-Reply-To: <1450205919029-5735536.post@n5.nabble.com> References: <1450122890950-5735522.post@n5.nabble.com> <1450197908820-5735526.post@n5.nabble.com> <1450201374740-5735528.post@n5.nabble.com> <1450203310325-5735530.post@n5.nabble.com> <1450204590553-5735533.post@n5.nabble.com> <1450205919029-5735536.post@n5.nabble.com> Message-ID: <1460068826386-5737583.post@n5.nabble.com> Hey guys, I had the exactly same problem, but I was using the CMake GUI and also providing the Visual Studio generator. The solution for me was to File->Reset Cache in the CMake GUI and then it works fine. Regards, Birky22 -- View this message in context: http://vtk.1045678.n5.nabble.com/CMake-Error-version-doesn-t-match-tp5735518p5737583.html Sent from the VTK - Users mailing list archive at Nabble.com. From seun at rogue-research.com Fri Apr 8 12:59:50 2016 From: seun at rogue-research.com (Seun Odutola) Date: Fri, 8 Apr 2016 12:59:50 -0400 Subject: [vtkusers] Missing Normals in vtkPolyData after filtering through ProbeFilter Message-ID: Hi Everyone, I have a vtkPolyData created from a Mesh, the polydata has been assigned points, strips as well as normals. Then it?s passed through a vtkProbeFilter as the input data & the probe filter source connection is set as a vtkImageBlend output. The issue I have is when I try to access the resulting polydata?s Normals via polydata->GetPointData()->GetNormals() it always returns NULL. Somewhere down the line I believe the normals are being removed or ignored. Can someone point me in the right direction? Regards, Seun -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Fri Apr 8 13:26:38 2016 From: sean at rogue-research.com (Sean McBride) Date: Fri, 8 Apr 2016 13:26:38 -0400 Subject: [vtkusers] Error using vtkOpenGLGPUVolumeRayCastMapper on OS X In-Reply-To: References: <20160324210352.8568525@mail.rogue-research.com> Message-ID: <20160408172638.1156143559@mail.rogue-research.com> On Thu, 24 Mar 2016 16:11:40 -0500, David Warren said: > Wow, nice find! My colleague who is having trouble has AMD graphics >and is running OS X. We haven't observed the same problems on Linux and >Windows machines with Intel and NVIDIA graphics. Many thanks, Dave, This should now be fixed in VTK git master, if you want to try. Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From DLRdave at aol.com Fri Apr 8 13:27:17 2016 From: DLRdave at aol.com (David Cole) Date: Fri, 8 Apr 2016 13:27:17 -0400 Subject: [vtkusers] Missing Normals in vtkPolyData after filtering through ProbeFilter In-Reply-To: References: Message-ID: The docs say PassPointArrays is Off by default. Have you tried turning it on? http://www.vtk.org/doc/nightly/html/classvtkProbeFilter.html#ad5e5c5434053fe2678166795142c1a1a Is the polydata you are asking for the normals the input to your filter, or some other polydata? (It was unclear from your original question.) HTH, David C. On Fri, Apr 8, 2016 at 12:59 PM, Seun Odutola wrote: > Hi Everyone, > > I have a vtkPolyData created from a Mesh, the polydata has been > assigned points, strips as well as normals. Then it?s passed through a > vtkProbeFilter as the input data & the probe filter source connection is set > as a vtkImageBlend output. The issue I have is when I try to access the > resulting polydata?s Normals via polydata->GetPointData()->GetNormals() it > always returns NULL. Somewhere down the line I believe the normals are being > removed or ignored. Can someone point me in the right direction? > > Regards, > Seun > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From kenji.tsumura at neosoftmedical.com Fri Apr 8 14:08:10 2016 From: kenji.tsumura at neosoftmedical.com (Kenji Tsumura) Date: Fri, 8 Apr 2016 18:08:10 +0000 Subject: [vtkusers] vtkImageResliceMapper, vtkImageReslice and pixel intensity Message-ID: <10285631702C4D4CB5C4921DC14337954EEE13ED@neocoilexch01> Hi, I have 3D MRI dataset and I resliced the data using vtkImageResliceMapper. I find it difficult to figure out why the pixel intensity of resliced images is so different from the original. In the attached file, the resliced image (image on the left) shows the mean value of 21935.5, and the original image (image on the right) shows the mean value of 1447.5. The following is the excerpt of my java source code. vtkExtendedImageResliceMapper extends vtkImageResliceMapper just to return ImageReslice, as there is no such public method. ---- initialization vtkExtendedImageResliceMapper planeMapper = new vtkExtendedImageResliceMapper(); planeMapper.SetInputData(imageData); planeMapper.SliceFacesCameraOn(); planeMapper.SliceAtFocalPointOn(); planeMapper.BorderOff(); planeMapper.SetSlabTypeToMean(); ---- after reslice // Get the image re-slice vtkImageReslice imageReslice = planeMapper.GetImageReslice(); // Get the image data vtkImageData reslicedImageData = imageReslice.GetOutput(); // Get the data array vtkDataArray dataArray = reslicedImageData.GetPointData().GetScalars(); // Get the data float[] image = null; if (dataArray instanceof vtkFloatArray) { vtkFloatArray floatArray = (vtkFloatArray) dataArray; image = floatArray.GetJavaArray(); } My environtment: VTK 7.0.0 CMake 3.1.1 Visual Studio Professional 2013 Eclipse Luna 4.4.1 (for my java application) I would appreciate any advice. Thank you, Kenji "The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Reslice.jpg Type: image/jpeg Size: 127831 bytes Desc: Reslice.jpg URL: From david.gobbi at gmail.com Fri Apr 8 14:30:07 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 8 Apr 2016 12:30:07 -0600 Subject: [vtkusers] vtkImageResliceMapper, vtkImageReslice and pixel intensity In-Reply-To: <10285631702C4D4CB5C4921DC14337954EEE13ED@neocoilexch01> References: <10285631702C4D4CB5C4921DC14337954EEE13ED@neocoilexch01> Message-ID: Hi Kenji, I advise against getting the vtkImageReslice object from the vtkImageResliceMapper. This object is meant to be for the mapper's own private use, and it most certainly will not always behave in the manner that you expect. Depending on the code path taken by vtkImageResliceMapper, the reslice object's spacing and the range of its output will change in tricky ways that are not documented and that might change from one version of VTK to the next. I'm sure that this isn't the answer you wanted, but if you want to reslice the image, then create a separate vtkImageReslice object outside of vtkImageResliceMapper. - David On Fri, Apr 8, 2016 at 12:08 PM, Kenji Tsumura < kenji.tsumura at neosoftmedical.com> wrote: > Hi, > > > > I have 3D MRI dataset and I resliced the data using vtkImageResliceMapper. > > I find it difficult to figure out why the pixel intensity of resliced > images is so different from the original. > > In the attached file, the resliced image (image on the left) shows the > mean value of 21935.5, and the original image (image on the right) shows > the mean value of 1447.5. > > > > The following is the excerpt of my java source code. > > vtkExtendedImageResliceMapper extends vtkImageResliceMapper just to > return ImageReslice, as there is no such public method. > > > > ---- initialization > > vtkExtendedImageResliceMapper planeMapper = new > vtkExtendedImageResliceMapper(); > > planeMapper.SetInputData(imageData); > > planeMapper.SliceFacesCameraOn(); > > planeMapper.SliceAtFocalPointOn(); > > planeMapper.BorderOff(); > > planeMapper.SetSlabTypeToMean(); > > > > ---- after reslice > > // Get the image re-slice > > vtkImageReslice imageReslice = planeMapper.GetImageReslice(); > > > > // Get the image data > > vtkImageData reslicedImageData = imageReslice.GetOutput(); > > > > // Get the data array > > vtkDataArray dataArray = > reslicedImageData.GetPointData().GetScalars(); > > > > // Get the data > > float[] image = null; > > if (dataArray instanceof vtkFloatArray) { > > vtkFloatArray floatArray = (vtkFloatArray) dataArray; > > image = floatArray.GetJavaArray(); > > } > > > > My environtment: > > VTK 7.0.0 > > CMake 3.1.1 > > Visual Studio Professional 2013 > > Eclipse Luna 4.4.1 (for my java application) > > > > I would appreciate any advice. > > Thank you, > > > > Kenji > > > > ?The information contained in this communication may be confidential, is > intended only for the use of the recipient(s) named above, and may be > legally privileged. If the reader of this message is not the intended > recipient, you are hereby notified that any dissemination, distribution, or > copying of this communication, or any of its contents, is strictly > prohibited. If you have received this communication in error, please return > it to the sender immediately and delete the original message and any copy > of it from your computer system. If you have any questions concerning this > message, please contact the sender. > > > Disclaimer: The information contained in this communication may be > confidential, is intended only for the use of the recipient(s) named above, > and may be legally privileged. If the reader of this message is not the > intended recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication, or any of its contents, is > strictly prohibited. If you have received this communication in error, > please return it to the sender immediately and delete the original message > and any copy of it from your computer system. If you have any questions > concerning this message, please contact the sender. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seun at rogue-research.com Fri Apr 8 16:58:04 2016 From: seun at rogue-research.com (Seun Odutola) Date: Fri, 8 Apr 2016 16:58:04 -0400 Subject: [vtkusers] Missing Normals in vtkPolyData after filtering through ProbeFilter In-Reply-To: References: Message-ID: <343F47BE-20A7-4698-BC71-23D762B24742@rogue-research.com> Hi David, Thanks a lot for the help, I activated the PassPointArrays & it worked. I can now access the normals, however I would like to know if the order in which the normals were arranged prior to being filtered by the probe changes after the filtering? If so, this may affect the way I access the normals individually. Regards, Seun > On Apr 8, 2016, at 1:27 PM, David Cole wrote: > > The docs say PassPointArrays is Off by default. Have you tried turning it on? > > http://www.vtk.org/doc/nightly/html/classvtkProbeFilter.html#ad5e5c5434053fe2678166795142c1a1a > > Is the polydata you are asking for the normals the input to your > filter, or some other polydata? (It was unclear from your original > question.) > > > HTH, > David C. > > > > On Fri, Apr 8, 2016 at 12:59 PM, Seun Odutola wrote: >> Hi Everyone, >> >> I have a vtkPolyData created from a Mesh, the polydata has been >> assigned points, strips as well as normals. Then it?s passed through a >> vtkProbeFilter as the input data & the probe filter source connection is set >> as a vtkImageBlend output. The issue I have is when I try to access the >> resulting polydata?s Normals via polydata->GetPointData()->GetNormals() it >> always returns NULL. Somewhere down the line I believe the normals are being >> removed or ignored. Can someone point me in the right direction? >> >> Regards, >> Seun >> >> >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> From sankhesh.jhaveri at kitware.com Fri Apr 8 17:25:56 2016 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Fri, 8 Apr 2016 17:25:56 -0400 Subject: [vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx, continued In-Reply-To: References: <9dc67826-d10c-4bea-a0ac-8b06268efc57@me.com> Message-ID: Hi Richard, There is a test in the VTK source tree (Rendering/Volume/Testing/Cxx/TestGPURayCastTwoComponentsDependentGradient.cxx) that sets parameters similar to your code. I tried that and it doesn't crash. Could you please try that and see if you can reproduce the issue with that test? You would have to enable BUILD_TESTING when configuring VTK with CMake and then compile. To run the test, you can do: ctest -V -R TwoComponentsDependentGradient Thanks! ?Warm regards,? Sankhesh On Thu, Apr 7, 2016 at 12:23 PM, Aashish Chaudhary < aashish.chaudhary at kitware.com> wrote: > Thanks for trying it out. I will have a look at it today. > > - Aashish > > On Thu, Apr 7, 2016 at 11:45 AM, Richard Frank wrote: > >> Hi, >> >> I pulled from git about 2 or 3 days ago, and got around to testing this >> AM. >> >> I still crash, albeit slightly different place it seems but the same >> undefined gl_aspect >> >> : >> >> ERROR: In Y:\ThirdParty\vtk700\Rendering\OpenGL2\vtkShaderProgram.cxx, >> line 378 >> vtkShaderProgram (00000000362FFA50): 1: #version 150 >> 2: #ifdef GL_ES >> 3: #if __VERSION__ == 300 >> 4: #define varying in >> 5: #ifdef GL_FRAGMENT_PRECISION_HIGH >> 6: precision highp float; >> 7: precision highp sampler2D; >> 8: precision highp sampler3D; >> 9: #else >> 10: precision mediump float; >> 11: precision mediump sampler2D; >> 12: precision mediump sampler3D; >> 13: #endif >> 14: #define texelFetchBuffer texelFetch >> 15: #define texture1D texture >> 16: #define texture2D texture >> 17: #define texture3D texture >> 18: #endif // 300 >> 19: #if __VERSION__ == 100 >> 20: #extension GL_OES_standard_derivatives : enable >> 21: #ifdef GL_FRAGMENT_PRECISION_HIGH >> 22: precision highp float; >> 23: #else >> 24: precision mediump float; >> 25: #endif >> 26: #endif // 100 >> 27: #else // GL_ES >> 28: #define highp >> 29: #define mediump >> 30: #define lowp >> 31: #if __VERSION__ == 150 >> 32: #define varying in >> 33: #define texelFetchBuffer texelFetch >> 34: #define texture1D texture >> 35: #define texture2D texture >> 36: #define texture3D texture >> 37: #endif >> 38: #if __VERSION__ == 120 >> 39: #extension GL_EXT_gpu_shader4 : require >> 40: #endif >> 41: #endif // GL_ES >> 42: >> 43: >> 44: >> /*========================================================================= >> 45: >> 46: Program: Visualization Toolkit >> 47: Module: raycasterfs.glsl >> 48: >> 49: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen >> 50: All rights reserved. >> 51: See Copyright.txt or http://www.kitware.com/Copyright.htm for >> details. >> 52: >> 53: This software is distributed WITHOUT ANY WARRANTY; without even >> 54: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR >> 55: PURPOSE. See the above copyright notice for more information. >> 56: >> 57: >> =========================================================================*/ >> 58: >> 59: >> ////////////////////////////////////////////////////////////////////////////// >> 60: /// >> 61: /// Inputs >> 62: /// >> 63: >> ////////////////////////////////////////////////////////////////////////////// >> 64: >> 65: /// 3D texture coordinates form vertex shader >> 66: varying vec3 ip_textureCoords; >> 67: varying vec3 ip_vertexPos; >> 68: >> 69: >> ////////////////////////////////////////////////////////////////////////////// >> 70: /// >> 71: /// Outputs >> 72: /// >> 73: >> ////////////////////////////////////////////////////////////////////////////// >> 74: >> 75: vec4 g_fragColor = vec4(0.0); >> 76: >> 77: >> ////////////////////////////////////////////////////////////////////////////// >> 78: /// >> 79: /// Uniforms, attributes, and globals >> 80: /// >> 81: >> ////////////////////////////////////////////////////////////////////////////// >> 82: vec3 g_dataPos; >> 83: vec3 g_dirStep; >> 84: vec4 g_srcColor; >> 85: vec4 g_eyePosObj; >> 86: bool g_exit; >> 87: >> 88: uniform vec4 in_volume_scale; >> 89: uniform vec4 in_volume_bias; >> 90: >> 91: out vec4 fragOutput0; >> 92: >> 93: >> 94: >> 95: // Volume dataset >> 96: uniform sampler3D in_volume; >> 97: uniform int in_noOfComponents; >> 98: uniform int in_independentComponents; >> 99: >> 100: uniform sampler2D in_noiseSampler; >> 101: #ifndef GL_ES >> 102: uniform sampler2D in_depthSampler; >> 103: #endif >> 104: >> 105: // Camera position >> 106: uniform vec3 in_cameraPos; >> 107: >> 108: // view and model matrices >> 109: uniform mat4 in_volumeMatrix; >> 110: uniform mat4 in_inverseVolumeMatrix; >> 111: uniform mat4 in_projectionMatrix; >> 112: uniform mat4 in_inverseProjectionMatrix; >> 113: uniform mat4 in_modelViewMatrix; >> 114: uniform mat4 in_inverseModelViewMatrix; >> 115: uniform mat4 in_textureDatasetMatrix; >> 116: uniform mat4 in_inverseTextureDatasetMatrix; >> 117: uniform mat4 in_texureToEyeIt; >> 118: >> 119: // Ray step size >> 120: uniform vec3 in_cellStep; >> 121: uniform vec2 in_scalarsRange[4]; >> 122: uniform vec3 in_cellSpacing; >> 123: >> 124: // Sample distance >> 125: uniform float in_sampleDistance; >> 126: >> 127: // Scales >> 128: uniform vec3 in_cellScale; >> 129: uniform vec2 in_windowLowerLeftCorner; >> 130: uniform vec2 in_inverseOriginalWindowSize; >> 131: uniform vec2 in_inverseWindowSize; >> 132: uniform vec3 in_textureExtentsMax; >> 133: uniform vec3 in_textureExtentsMin; >> 134: >> 135: // Material and lighting >> 136: uniform vec3 in_diffuse; >> 137: uniform vec3 in_ambient; >> 138: uniform vec3 in_specular; >> 139: uniform float in_shininess; >> 140: >> 141: // Others >> 142: uniform bool in_cellFlag; >> 143: uniform bool in_useJittering; >> 144: vec3 g_xvec; >> 145: vec3 g_yvec; >> 146: vec3 g_zvec; >> 147: uniform bool in_twoSidedLighting; >> 148: vec3 g_cellSpacing; >> 149: float g_avgSpacing; >> 150: vec4 g_fragWorldPos; >> 151: uniform int in_numberOfLights; >> 152: uniform vec3 in_lightAmbientColor[6]; >> 153: uniform vec3 in_lightDiffuseColor[6]; >> 154: uniform vec3 in_lightSpecularColor[6]; >> 155: uniform vec3 in_lightDirection[6]; >> 156: >> 157: //VTK::Termination::Dec >> 158: >> 159: //VTK::Cropping::Dec >> 160: >> 161: //VTK::Shading::Dec >> 162: >> 163: //VTK::BinaryMask::Dec >> 164: >> 165: //VTK::CompositeMask::Dec >> 166: >> 167: >> 168: uniform sampler2D in_opacityTransferFunc; >> 169: float computeOpacity(vec4 scalar) >> 170: { >> 171: return texture2D(in_opacityTransferFunc, vec2(scalar.w, 0)).r; >> 172: } >> 173: >> 174: >> 175: uniform sampler2D in_gradientTransferFunc; >> 176: float computeGradientOpacity(vec4 grad) >> 177: { >> 178: return texture2D(in_gradientTransferFunc, vec2(grad.w, 0.0)).r; >> 179: } >> 180: // c is short for component >> 181: vec4 computeGradient(int c) >> 182: { >> 183: vec3 g1; >> 184: vec4 g2; >> 185: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; >> 186: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; >> 187: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; >> 188: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; >> 189: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; >> 190: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; >> 191: g1 = g1 * in_volume_scale.r + in_volume_bias.r; >> 192: g2 = g2 * in_volume_scale.r + in_volume_bias.r; >> 193: g1.x = in_scalarsRange[c][0] + ( >> 194: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.x; >> 195: g1.y = in_scalarsRange[c][0] + ( >> 196: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.y; >> 197: g1.z = in_scalarsRange[c][0] + ( >> 198: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.z; >> 199: g2.x = in_scalarsRange[c][0] + ( >> 200: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.x; >> 201: g2.y = in_scalarsRange[c][0] + ( >> 202: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.y; >> 203: g2.z = in_scalarsRange[c][0] + ( >> 204: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.z; >> 205: g2.xyz = g1 - g2.xyz; >> 206: g2.x /= g_aspect.x; >> 207: g2.y /= g_aspect.y; >> 208: g2.z /= g_aspect.z; >> 209: g2.w = 0.0; >> 210: float grad_mag = length(g2); >> 211: if (grad_mag > 0.0) >> 212: { >> 213: g2.x /= grad_mag; >> 214: g2.y /= grad_mag; >> 215: g2.z /= grad_mag; >> 216: } >> 217: else >> 218: { >> 219: g2.xyz = vec3(0.0, 0.0, 0.0); >> 220: } >> 221: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[c][1] - >> 222: (in_scalarsRange[c][0]))); >> 223: grad_mag = clamp(grad_mag, 0.0, 1.0); >> 224: g2.w = grad_mag; >> 225: return g2; >> 226: } >> 227: >> 228: >> 229: vec4 computeLighting(vec4 color, int component) >> 230: { >> 231: vec4 finalColor = vec4(0.0); >> 232: // Compute gradient function only once >> 233: vec4 gradient = computeGradient(component); >> 234: g_fragWorldPos = in_modelViewMatrix * in_volumeMatrix * >> 235: in_textureDatasetMatrix * vec4(-g_dataPos, 1.0); >> 236: if (g_fragWorldPos.w != 0.0) >> 237: { >> 238: g_fragWorldPos /= g_fragWorldPos.w; >> 239: } >> 240: vec3 vdir = normalize(g_fragWorldPos.xyz); >> 241: vec3 normal = gradient.xyz; >> 242: vec3 ambient = vec3(0.0); >> 243: vec3 diffuse = vec3(0.0); >> 244: vec3 specular = vec3(0.0); >> 245: float normalLength = length(normal); >> 246: if (normalLength > 0.0) >> 247: { >> 248: normal = normalize((in_texureToEyeIt * vec4(normal, 0.0)).xyz); >> 249: } >> 250: else >> 251: { >> 252: normal = vec3(0.0, 0.0, 0.0); >> 253: } >> 254: for (int lightNum = 0; lightNum < in_numberOfLights; lightNum++) >> 255: { >> 256: vec3 ldir = in_lightDirection[lightNum].xyz; >> 257: vec3 h = normalize(ldir + vdir); >> 258: float nDotH = dot(normal, h); >> 259: if (nDotH < 0.0 && in_twoSidedLighting) >> 260: { >> 261: nDotH = -nDotH; >> 262: } >> 263: float nDotL = dot(normal, ldir); >> 264: if (nDotL < 0.0 && in_twoSidedLighting) >> 265: { >> 266: nDotL = -nDotL; >> 267: } >> 268: if (nDotL > 0.0) >> 269: { >> 270: diffuse += in_lightDiffuseColor[lightNum] * nDotL; >> 271: } >> 272: if (nDotH > 0.0) >> 273: { >> 274: specular = in_lightSpecularColor[lightNum] * pow(nDotH, >> in_shininess); >> 275: } >> 276: ambient += in_lightAmbientColor[lightNum]; >> 277: } >> 278: finalColor.xyz = in_ambient * ambient + >> 279: in_diffuse * diffuse * color.rgb + >> 280: in_specular * specular; >> 281: if (gradient.w >= 0.0) >> 282: { >> 283: color.a = color.a * >> 284: computeGradientOpacity(gradient); >> 285: } >> 286: finalColor.a = color.a; >> 287: return finalColor; >> 288: } >> 289: >> 290: >> 291: uniform sampler2D in_colorTransferFunc; >> 292: vec4 computeColor(vec4 scalar, float opacity) >> 293: { >> 294: return computeLighting(vec4(texture2D(in_colorTransferFunc, >> 295: vec2(scalar.w, 0.0)).xyz, opacity), 0); >> 296: } >> 297: >> 298: >> 299: vec3 computeRayDirection() >> 300: { >> 301: return normalize(ip_vertexPos.xyz - g_eyePosObj.xyz); >> 302: } >> 303: >> 304: /// We support only 8 clipping planes for now >> 305: /// The first value is the size of the data array for clipping >> 306: /// planes (origin, normal) >> 307: uniform float in_clippingPlanes[49]; >> 308: uniform float in_scale; >> 309: uniform float in_bias; >> 310: >> 311: >> ////////////////////////////////////////////////////////////////////////////// >> 312: /// >> 313: /// Main >> 314: /// >> 315: >> ////////////////////////////////////////////////////////////////////////////// >> 316: void main() >> 317: { >> 318: /// Initialize g_fragColor (output) to 0 >> 319: g_fragColor = vec4(0.0); >> 320: g_dirStep = vec3(0.0); >> 321: g_srcColor = vec4(0.0); >> 322: g_exit = false; >> 323: >> 324: >> 325: bool l_adjustTextureExtents = !in_cellFlag; >> 326: // Get the 3D texture coordinates for lookup into the in_volume >> dataset >> 327: g_dataPos = ip_textureCoords.xyz; >> 328: >> 329: // Eye position in object space >> 330: g_eyePosObj = (in_inverseVolumeMatrix * vec4(in_cameraPos, 1.0)); >> 331: if (g_eyePosObj.w != 0.0) >> 332: { >> 333: g_eyePosObj.x /= g_eyePosObj.w; >> 334: g_eyePosObj.y /= g_eyePosObj.w; >> 335: g_eyePosObj.z /= g_eyePosObj.w; >> 336: g_eyePosObj.w = 1.0; >> 337: } >> 338: >> 339: // Getting the ray marching direction (in object space); >> 340: vec3 rayDir = computeRayDirection(); >> 341: >> 342: // Multiply the raymarching direction with the step size to get the >> 343: // sub-step size we need to take at each raymarching step >> 344: g_dirStep = (in_inverseTextureDatasetMatrix * >> 345: vec4(rayDir, 0.0)).xyz * in_sampleDistance; >> 346: >> 347: float jitterValue = (texture2D(in_noiseSampler, g_dataPos.xy).x); >> 348: if (in_useJittering) >> 349: { >> 350: g_dataPos += g_dirStep * jitterValue; >> 351: } >> 352: else >> 353: { >> 354: g_dataPos += g_dirStep; >> 355: } >> 356: >> 357: // Flag to deternmine if voxel should be considered for the >> rendering >> 358: bool l_skip = false; >> 359: g_cellSpacing = vec3(in_cellSpacing[0], >> 360: in_cellSpacing[1], >> 361: in_cellSpacing[2]); >> 362: g_avgSpacing = (g_cellSpacing[0] + >> 363: g_cellSpacing[1] + >> 364: g_cellSpacing[2])/3.0; >> 365: g_xvec = vec3(in_cellStep[0], 0.0, 0.0); >> 366: g_yvec = vec3(0.0, in_cellStep[1], 0.0); >> 367: g_zvec = vec3(0.0, 0.0, in_cellStep[2]); >> 368: // Adjust the aspect >> 369: g_aspect.x = g_cellSpacing[0] * 2.0 / g_avgSpacing; >> 370: g_aspect.y = g_cellSpacing[1] * 2.0 / g_avgSpacing; >> 371: g_aspect.z = g_cellSpacing[2] * 2.0 / g_avgSpacing; >> 372: >> 373: >> 374: // Minimum texture access coordinate >> 375: vec3 l_texMin = vec3(0.0); >> 376: vec3 l_texMax = vec3(1.0); >> 377: if (l_adjustTextureExtents) >> 378: { >> 379: vec3 delta = in_textureExtentsMax - in_textureExtentsMin; >> 380: l_texMin = vec3(0.5) / delta; >> 381: l_texMax = (delta - vec3(0.5)) / delta; >> 382: } >> 383: >> 384: // Flag to indicate if the raymarch loop should terminate >> 385: bool stop = false; >> 386: >> 387: // 2D Texture fragment coordinates [0,1] from fragment coordinates >> 388: // the frame buffer texture has the size of the plain buffer but >> 389: // we use a fraction of it. The texture coordinates is less than 1 >> if >> 390: // the reduction factor is less than 1. >> 391: // Device coordinates are between -1 and 1. We need texture >> 392: // coordinates between 0 and 1 the in_depthSampler buffer has the >> 393: // original size buffer. >> 394: vec2 fragTexCoord = (gl_FragCoord.xy - in_windowLowerLeftCorner) * >> 395: in_inverseWindowSize; >> 396: float l_terminatePointMax = 0.0; >> 397: >> 398: #ifdef GL_ES >> 399: vec4 l_depthValue = vec4(1.0,1.0,1.0,1.0); >> 400: #else >> 401: vec4 l_depthValue = texture2D(in_depthSampler, fragTexCoord); >> 402: #endif >> 403: // Depth test >> 404: if(gl_FragCoord.z >= l_depthValue.x) >> 405: { >> 406: discard; >> 407: } >> 408: >> 409: // color buffer or max scalar buffer have a reduced size. >> 410: fragTexCoord = (gl_FragCoord.xy - in_windowLowerLeftCorner) * >> 411: in_inverseOriginalWindowSize; >> 412: >> 413: // Compute max number of iterations it will take before we hit >> 414: // the termination point >> 415: >> 416: // Abscissa of the point on the depth buffer along the ray. >> 417: // point in texture coordinates >> 418: vec4 terminatePoint; >> 419: terminatePoint.x = (gl_FragCoord.x - in_windowLowerLeftCorner.x) * >> 2.0 * >> 420: in_inverseWindowSize.x - 1.0; >> 421: terminatePoint.y = (gl_FragCoord.y - in_windowLowerLeftCorner.y) * >> 2.0 * >> 422: in_inverseWindowSize.y - 1.0; >> 423: terminatePoint.z = (2.0 * l_depthValue.x - (gl_DepthRange.near + >> 424: gl_DepthRange.far)) / gl_DepthRange.diff; >> 425: terminatePoint.w = 1.0; >> 426: >> 427: // From normalized device coordinates to eye coordinates. >> 428: // in_projectionMatrix is inversed because of way VT >> 429: // From eye coordinates to texture coordinates >> 430: terminatePoint = in_inverseTextureDatasetMatrix * >> 431: in_inverseVolumeMatrix * >> 432: in_inverseModelViewMatrix * >> 433: in_inverseProjectionMatrix * >> 434: terminatePoint; >> 435: terminatePoint /= terminatePoint.w; >> 436: >> 437: l_terminatePointMax = length(terminatePoint.xyz - g_dataPos.xyz) / >> 438: length(g_dirStep); >> 439: float l_currentT = 0.0; >> 440: >> 441: //VTK::Shading::Init >> 442: >> 443: //VTK::Cropping::Init >> 444: >> 445: //VTK::Clipping::Init >> 446: >> 447: //VTK::RenderToImage::Init >> 448: >> 449: //VTK::DepthPass::Init >> 450: >> 451: /// For all samples along the ray >> 452: while (!g_exit) >> 453: { >> 454: >> 455: l_skip = false; >> 456: >> 457: //VTK::Cropping::Impl >> 458: >> 459: //VTK::Clipping::Impl >> 460: >> 461: //VTK::BinaryMask::Impl >> 462: >> 463: //VTK::CompositeMask::Impl >> 464: >> 465: >> 466: if (!l_skip) >> 467: { >> 468: vec4 scalar = texture3D(in_volume, g_dataPos); >> 469: scalar.r = scalar.r*in_volume_scale.r + in_volume_bias.r; >> 470: scalar = vec4(scalar.r,scalar.r,scalar.r,scalar.r); >> 471: g_srcColor = vec4(0.0); >> 472: g_srcColor.a = computeOpacity(scalar); >> 473: if (g_srcColor.a > 0.0) >> 474: { >> 475: g_srcColor = computeColor(scalar, g_srcColor.a); >> 476: // Opacity calculation using compositing: >> 477: // Here we use front to back compositing scheme whereby >> 478: // the current sample value is multiplied to the >> 479: // currently accumulated alpha and then this product >> 480: // is subtracted from the sample value to get the >> 481: // alpha from the previous steps. Next, this alpha is >> 482: // multiplied with the current sample colour >> 483: // and accumulated to the composited colour. The alpha >> 484: // value from the previous steps is then accumulated >> 485: // to the composited colour alpha. >> 486: g_srcColor.rgb *= g_srcColor.a; >> 487: g_fragColor = (1.0f - g_fragColor.a) * g_srcColor + g_fragColor; >> 488: } >> 489: } >> 490: >> 491: //VTK::RenderToImage::Impl >> 492: >> 493: //VTK::DepthPass::Impl >> 494: >> 495: /// Advance ray >> 496: g_dataPos += g_dirStep; >> 497: >> 498: >> 499: // sign function performs component wise operation and returns -1 >> 500: // if the difference is less than 0, 0 if equal to 0, and 1 if >> 501: // above 0. So if the ray is inside the volume, dot product will >> 502: // always be 3. >> 503: stop = dot(sign(g_dataPos - l_texMin), sign(l_texMax - g_dataPos)) >> 504: < 3.0; >> 505: >> 506: // If the stopping condition is true we brek out of the ray marching >> 507: // loop >> 508: if (stop) >> 509: { >> 510: break; >> 511: } >> 512: // Early ray termination >> 513: // if the currently composited colour alpha is already fully >> saturated >> 514: // we terminated the loop or if we have hit an obstacle in the >> 515: // direction of they ray (using depth buffer) we terminate as well. >> 516: if((g_fragColor.a > (1.0 - 1.0/255.0)) || >> 517: l_currentT >= l_terminatePointMax) >> 518: { >> 519: break; >> 520: } >> 521: ++l_currentT; >> 522: } >> 523: >> 524: //VTK::Base::Exit >> 525: >> 526: //VTK::Terminate::Exit >> 527: >> 528: //VTK::Cropping::Exit >> 529: >> 530: //VTK::Clipping::Exit >> 531: >> 532: //VTK::Shading::Exit >> 533: >> 534: g_fragColor.r = g_fragColor.r * in_scale + in_bias * g_fragColor.a; >> 535: g_fragColor.g = g_fragColor.g * in_scale + in_bias * g_fragColor.a; >> 536: g_fragColor.b = g_fragColor.b * in_scale + in_bias * g_fragColor.a; >> 537: fragOutput0 = g_fragColor; >> 538: >> 539: //VTK::RenderToImage::Exit >> 540: >> 541: //VTK::DepthPass::Exit >> 542: } >> 543: >> >> >> >> ERROR: In Y:\ThirdParty\vtk700\Rendering\OpenGL2\vtkShaderProgram.cxx, >> line 379 >> vtkShaderProgram (00000000362FFA50): 0(206) : error C1008: undefined >> variable "g_aspect" >> 0(207) : error C1008: undefined variable "g_aspect" >> 0(208) : error C1008: undefined variable "g_aspect" >> 0(369) : error C1008: undefined variable "g_aspect" >> 0(370) : error C1008: undefined variable "g_aspect" >> 0(371) : error C1008: undefined variable "g_aspect" >> >> >> >> On Apr 04, 2016, at 11:49 AM, Aashish Chaudhary < >> aashish.chaudhary at kitware.com> wrote: >> >> Yes please. If you can checkout the latest master, this should not >> happen. >> >> Thanks, >> Aashish >> >> On Mon, Apr 4, 2016 at 11:48 AM, Richard Frank wrote: >> >>> No I'm using 7.0.0 release not a git clone. >>> >>> I guess I should get the latest? >>> >>> Rick >>> >>> >>> On Apr 04, 2016, at 10:53 AM, Aashish Chaudhary < >>> aashish.chaudhary at kitware.com> wrote: >>> >>> Thanks, and are you using VTK master as of last week since we had this >>> problem and got fixed recently. >>> >>> - Aashish >>> >>> On Mon, Apr 4, 2016 at 10:47 AM, Richard Frank wrote: >>> >>>> Hi, >>>> >>>> Here is a portion of code: >>>> >>>> >>>> volumeProperty->SetColor(0, colorTransferFunction); >>>> volumeProperty->SetColor(1, maskColorTransferFunction); >>>> volumeProperty->SetScalarOpacity(opacityTransferFunction); >>>> volumeProperty->SetGradientOpacity(volumeGradientOpacityFunction); >>>> volumeProperty->SetInterpolationTypeToLinear(); >>>> volumeProperty->ShadeOn(); >>>> volumeProperty->SetAmbient(0.4); >>>> volumeProperty->SetDiffuse(0.8); >>>> volumeProperty->SetSpecular(0.2); >>>> volumeProperty->SetSpecularPower(105.0); >>>> volumeProperty->SetScalarOpacityUnitDistance(0.7); >>>> volume->SetProperty(volumeProperty); >>>> >>>> The hard coded numbers are just picked empirically by viewing our most >>>> common inputs. >>>> >>>> On Apr 03, 2016, at 10:26 PM, Aashish Chaudhary < >>>> aashish.chaudhary at kitware.com> wrote: >>>> >>>> Rick, >>>> >>>> Can you send me information on what you are turning on in volume >>>> property and in mapper that leads to this crash? Also, is your data is >>>> single or 2 or 4 component? >>>> >>>> Thanks, >>>> >>>> >>>> On Sun, Apr 3, 2016 at 9:25 PM, Richard Frank wrote: >>>> >>>>> Further investigation seems to point the GradientOpacity section of >>>>> shader raycasterfs.glsl, code which seems to be inserted at runtime: I >>>>> guess gl_aspect is not defined in this scenario? >>>>> >>>>> Any suggestions welcome! >>>>> >>>>> Rick >>>>> >>>>> vec4 computeGradient() >>>>> 145: { >>>>> 146: vec3 g1; >>>>> 147: vec4 g2; >>>>> 148: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; >>>>> 149: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; >>>>> 150: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; >>>>> 151: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; >>>>> 152: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; >>>>> 153: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; >>>>> 154: g1 = g1*in_volume_scale.r + in_volume_bias.r; >>>>> 155: g2 = g2*in_volume_scale.r + in_volume_bias.r; >>>>> 156: g1.x = in_scalarsRange[0] + ( >>>>> 157: in_scalarsRange[1] - in_scalarsRange[0]) * g1.x; >>>>> 158: g1.y = in_scalarsRange[0] + ( >>>>> 159: in_scalarsRange[1] - in_scalarsRange[0]) * g1.y; >>>>> 160: g1.z = in_scalarsRange[0] + ( >>>>> 161: in_scalarsRange[1] - in_scalarsRange[0]) * g1.z; >>>>> 162: g2.x = in_scalarsRange[0] + ( >>>>> 163: in_scalarsRange[1] - in_scalarsRange[0]) * g2.x; >>>>> 164: g2.y = in_scalarsRange[0] + ( >>>>> 165: in_scalarsRange[1] - in_scalarsRange[0]) * g2.y; >>>>> 166: g2.z = in_scalarsRange[0] + ( >>>>> 167: in_scalarsRange[1] - in_scalarsRange[0]) * g2.z; >>>>> 168: g2.xyz = g1 - g2.xyz; >>>>> 169: g2.x /= g_aspect.x; >>>>> 170: g2.y /= g_aspect.y; >>>>> 171: g2.z /= g_aspect.z; >>>>> 172: float grad_mag = sqrt(g2.x * g2.x + >>>>> 173: g2.y * g2.y + >>>>> 174: g2.z * g2.z); >>>>> 175: if (grad_mag > 0.0) >>>>> 176: { >>>>> 177: g2.x /= grad_mag; >>>>> 178: g2.y /= grad_mag; >>>>> 179: g2.z /= grad_mag; >>>>> 180: } >>>>> 181: else >>>>> 182: { >>>>> 183: g2.xyz = vec3(0.0, 0.0, 0.0); >>>>> 184: } >>>>> 185: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[1] - >>>>> 186: (in_scalarsRange[0]))); >>>>> 187: grad_mag = clamp(grad_mag, 0.0, 1.0); >>>>> 188: g2.w = grad_mag; >>>>> 189: return g2; >>>>> 190: } >>>>> >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>>> >>>>> >>>> >>>> >>>> -- >>>> >>>> >>>> >>>> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >>>> * >>>> *| http://www.kitware.com/company/team/chaudhary.html >>>> * >>>> >>>> >>> >>> >>> -- >>> >>> >>> >>> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >>> * >>> *| http://www.kitware.com/company/team/chaudhary.html >>> * >>> >>> >> >> >> -- >> >> >> >> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >> * >> *| http://www.kitware.com/company/team/chaudhary.html >> * >> >> > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From direction at 4estudios.com Sat Apr 9 04:30:22 2016 From: direction at 4estudios.com (enrico) Date: Sat, 9 Apr 2016 01:30:22 -0700 (MST) Subject: [vtkusers] Qt5.6+VTK7 error: no override found for 'vtkPolyDataMapper' Message-ID: <1460190622968-5737596.post@n5.nabble.com> Hi, I know the problem is related to this: http://www.vtk.org/Wiki/VTK/Build_System_Migration I followed the instructions adding the two macro before any other VTK header but i get the same error: Generic Warning: In /home/direction/Downloads/VTK-7.0.0/Rendering/Core/vtkPolyDataMapper.cxx, line 28 Error: no override found for 'vtkPolyDataMapper'. So to be sure to have the preprocessor macro before any other header i have defined the two macro in the .pro file as: DEFINES += vtkRenderingCore_AUTOINIT="\"4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)\"" DEFINES += vtkRenderingVolume_AUTOINIT="\"1(vtkRenderingVolumeOpenGL)\"" And correctly in the generated makefile i see: ############################################################################# # Makefile for building: TestVTKwidget # Generated by qmake (3.0) (Qt 5.6.0) # Project: ../TestVTKwidget/TestVTKwidget.pro # Template: app # Command: /home/direction/Qt/5.6/gcc_64/bin/qmake -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug -o Makefile ../TestVTKwidget/TestVTKwidget.pro ############################################################################# MAKEFILE = Makefile ####### Compiler, tools and options CC = gcc CXX = g++ DEFINES = -DvtkRenderingCore_AUTOINIT="4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)" -DvtkRenderingVolume_AUTOINIT="1(vtkRenderingVolumeOpenGL)" -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB CFLAGS = -pipe -g -Wall -W -D_REENTRANT -fPIC $(DEFINES) What i am missing? Can anyone help me? Many thanks, Enrico Mautone. -- View this message in context: http://vtk.1045678.n5.nabble.com/Qt5-6-VTK7-error-no-override-found-for-vtkPolyDataMapper-tp5737596.html Sent from the VTK - Users mailing list archive at Nabble.com. From dzenanz at gmail.com Sat Apr 9 13:24:45 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Sat, 9 Apr 2016 13:24:45 -0400 Subject: [vtkusers] Qt5.6+VTK7 error: no override found for 'vtkPolyDataMapper' In-Reply-To: <1460190622968-5737596.post@n5.nabble.com> References: <1460190622968-5737596.post@n5.nabble.com> Message-ID: Hi Enrico, VTK7 uses OpenGL2 rendering backed by default. Can you reconfigure your VTK7 build to use OpenGL backend? Or replace OpenGL by OpenGL2 in your makefiles? Regards, D?enan On Sat, Apr 9, 2016 at 4:30 AM, enrico wrote: > Hi, > > I know the problem is related to this: > http://www.vtk.org/Wiki/VTK/Build_System_Migration > > > I followed the instructions adding the two macro before any other VTK > header > but i get the same error: > > Generic Warning: In > /home/direction/Downloads/VTK-7.0.0/Rendering/Core/vtkPolyDataMapper.cxx, > line 28 > Error: no override found for 'vtkPolyDataMapper'. > > > So to be sure to have the preprocessor macro before any other header i have > defined the two macro in the .pro file as: > > DEFINES += > > vtkRenderingCore_AUTOINIT="\"4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)\"" > DEFINES += vtkRenderingVolume_AUTOINIT="\"1(vtkRenderingVolumeOpenGL)\"" > > And correctly in the generated makefile i see: > > > ############################################################################# > # Makefile for building: TestVTKwidget > # Generated by qmake (3.0) (Qt 5.6.0) > # Project: ../TestVTKwidget/TestVTKwidget.pro > # Template: app > # Command: /home/direction/Qt/5.6/gcc_64/bin/qmake -spec linux-g++ > CONFIG+=debug CONFIG+=qml_debug -o Makefile > ../TestVTKwidget/TestVTKwidget.pro > > ############################################################################# > > MAKEFILE = Makefile > > ####### Compiler, tools and options > > CC = gcc > CXX = g++ > DEFINES = > > -DvtkRenderingCore_AUTOINIT="4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)" > -DvtkRenderingVolume_AUTOINIT="1(vtkRenderingVolumeOpenGL)" > -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB > CFLAGS = -pipe -g -Wall -W -D_REENTRANT -fPIC $(DEFINES) > > > > What i am missing? Can anyone help me? > > Many thanks, > > Enrico Mautone. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Qt5-6-VTK7-error-no-override-found-for-vtkPolyDataMapper-tp5737596.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ultam93 at yahoo.com Sat Apr 9 14:31:27 2016 From: ultam93 at yahoo.com (c_mihai) Date: Sat, 9 Apr 2016 11:31:27 -0700 (MST) Subject: [vtkusers] angle between planes[newbie question] Message-ID: <1460226687929-5737598.post@n5.nabble.com> Lets say I loaded two planes from vtkPlaneSource, they are defined by a center and a normal. How can I find the angle X,Y,Z between the two planes? -- View this message in context: http://vtk.1045678.n5.nabble.com/angle-between-planes-newbie-question-tp5737598.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Sat Apr 9 15:10:23 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Sat, 9 Apr 2016 13:10:23 -0600 Subject: [vtkusers] angle between planes[newbie question] In-Reply-To: <1460226687929-5737598.post@n5.nabble.com> References: <1460226687929-5737598.post@n5.nabble.com> Message-ID: The angle in radians can be computed with the following: double angle = vtkMath::AngleBetweenVectors(normal1, normal2); and the axis of rotation must be perpendicular to both normals, therefore (if the planes are not parallel) the axis can be computed as follows: double axis[3]; vtkMath::Cross(normal1, normal2, axis); vtkMath::Normalize(axis); Is this the representation of the angle that you need? I wasn't sure what you meant by "angle X,Y,Z". - David On Sat, Apr 9, 2016 at 12:31 PM, c_mihai via vtkusers wrote: > Lets say I loaded two planes from vtkPlaneSource, they are defined by a > center and a normal. How can I find the angle X,Y,Z between the two planes? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ultam93 at yahoo.com Sat Apr 9 18:58:19 2016 From: ultam93 at yahoo.com (c_mihai) Date: Sat, 9 Apr 2016 15:58:19 -0700 (MST) Subject: [vtkusers] angle between planes[newbie question] In-Reply-To: References: <1460226687929-5737598.post@n5.nabble.com> Message-ID: <1460242699367-5737600.post@n5.nabble.com> Hello and thank you for replying David. Indeed, I should of explained what I meant by X,Y,Z better. They are meant to be degree's I would need to rotate the X,Y and Z axis in order for the planes to be parallel. -- View this message in context: http://vtk.1045678.n5.nabble.com/angle-between-planes-newbie-question-tp5737598p5737600.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Sat Apr 9 19:39:33 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Sat, 9 Apr 2016 17:39:33 -0600 Subject: [vtkusers] angle between planes[newbie question] In-Reply-To: <1460242699367-5737600.post@n5.nabble.com> References: <1460226687929-5737598.post@n5.nabble.com> <1460242699367-5737600.post@n5.nabble.com> Message-ID: On Sat, Apr 9, 2016 at 4:58 PM, c_mihai via vtkusers wrote: > Hello and thank you for replying David. > > Indeed, I should of explained what I meant by X,Y,Z better. They are meant > to be degree's I would need to rotate the X,Y and Z axis in order for the > planes to be parallel. > You would have to rotate by the angle that I gave in my first reply, around the axis that I gave in my first reply. If you want to know the answer in terms of the needed rotations around the X, Y, and Z axes then the solution becomes a lot more complicated. You would need to specify the order in which you want these rotations to occur, because rotations are in general not commutative. In VTK you could do something like this, given the axis and angle that I previously mentioned: vtkSmartPointer transform = vtkSmartPointer::New(); transform->RotateWXYZ(vtkMath::DegreesFromRadians(angle), axis); double angles[3]; transform->GetOrientation(angles); This will give you the rotation angles around X, Y, and Z but unfortunately the VTK documentation does not say what order the rotations occur in. I think it it is Y, X, and then Z but I'm not certain. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From jp4work at gmail.com Sat Apr 9 21:27:00 2016 From: jp4work at gmail.com (JIA Pei) Date: Sat, 9 Apr 2016 18:27:00 -0700 Subject: [vtkusers] VTK_USE_LARGE_DATA is NOT available now? Message-ID: Hi, guys: I'm using VTK git, and trying to build it with VTK_USE_LARGE_DATA enabled, but it seems I always met the following issue: "-- Fetching " http://www.vtk.org/files/ExternalData/MD5/a0bbf76430c6a79128dece99f75dc524" CMake Error at /home/jiapei/Downloads/visualization/VTK/VTK/CMake/ExternalData.cmake:1005 (message): Object MD5=a0bbf76430c6a79128dece99f75dc524 not found at: " It looks like there is something to do with the ExternalData ??? Does anybody confront the same issue? Give me a hand please... Cheers -- Pei JIA, Ph.D. Email: jp4work at gmail.com cell in Canada: +1 778-863-5816 cell in China: +86 186-8244-3503 Welcome to Vision Open http://www.visionopen.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Sun Apr 10 10:55:53 2016 From: tjlp at netease.com (Liu_tj) Date: Sun, 10 Apr 2016 22:55:53 +0800 (CST) Subject: [vtkusers] How to display the points in a greyscale range in other colors for DICOM series via vtkImageViewers Message-ID: <427bdb49.e.15400ac02fa.Coremail.tjlp@netease.com> Hi, At present I use vtkImageViewers to display a DICOM series. And the points falling in a greyscale range should be displayed in other color. How to achieve that? I read the example in http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/Transparency. In this example, another vtkImageActor is created for the mask image. For the DICOM series, I don't know what should be the input data for the vtkImageMapToColors? How to get the vtkImgeData of the current slice? I also read the example for vtkImageBlend. How ever I don't know how to generate the vtkImageBlend for the DICOM series. Thanks for your VTK guys in advance. Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From fboli94 at gmail.com Sun Apr 10 11:07:55 2016 From: fboli94 at gmail.com (fblupi) Date: Sun, 10 Apr 2016 08:07:55 -0700 (MST) Subject: [vtkusers] How to display the points in a greyscale range in other colors for DICOM series via vtkImageViewers In-Reply-To: <427bdb49.e.15400ac02fa.Coremail.tjlp@netease.com> References: <427bdb49.e.15400ac02fa.Coremail.tjlp@netease.com> Message-ID: <1460300875750-5737604.post@n5.nabble.com> If you use vtkImageViewer2 it's easy adding color and you can do it by setting a vtkColorTransferFunction previously defined. Something like this: ... iv2 = vtkSmartPointer::New(); ctf = vtkSmartPointer::New(); // add colors some colors with ctf->AddRGBPoint(density, red, green, blue); iv2->GetWindowLevel()->SetLookupTable(ctf); ... I hope you will find this useful. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-display-the-points-in-a-greyscale-range-in-other-colors-for-DICOM-series-via-vtkImageViewers-tp5737603p5737604.html Sent from the VTK - Users mailing list archive at Nabble.com. From tjlp at netease.com Sun Apr 10 13:14:38 2016 From: tjlp at netease.com (Liu_tj) Date: Mon, 11 Apr 2016 01:14:38 +0800 (CST) Subject: [vtkusers] How to display the points in a greyscale range in other colors for DICOM series via vtkImageViewers In-Reply-To: <1460300875750-5737604.post@n5.nabble.com> References: <427bdb49.e.15400ac02fa.Coremail.tjlp@netease.com> <1460300875750-5737604.post@n5.nabble.com> Message-ID: <707a6d7a.2.154012b0a28.Coremail.tjlp@netease.com> Hi, fblupi, In your example, you change the vtkImageViewer2's vtkImageMapToWindowLevlColors, That will change the whole image color, instead of the points which fall in the greyscale range. By the way, for "ctf->AddRGBPoint(density, red, green, blue)", what's the meaning of density? Is it the greyscale value? With the AddRGBPoint(), how to keep the initial color of other points which are beyond the greyscale range? Thanks Liu Peng ?2016-04-10?"fblupi" ??? -----????----- ???:"fblupi" ????:2016?04?10? ??? ???:"vtkusers" ??:Re: [vtkusers] How to display the points in a greyscale range in other colors for DICOM series via vtkImageViewers If you use vtkImageViewer2 it's easy adding color and you can do it by setting a vtkColorTransferFunction previously defined. Something like this: ... iv2 = vtkSmartPointer::New(); ctf = vtkSmartPointer::New(); // add colors some colors with ctf->AddRGBPoint(density, red, green, blue); iv2->GetWindowLevel()->SetLookupTable(ctf); ... I hope you will find this useful. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-display-the-points-in-a-greyscale-range-in-other-colors-for-DICOM-series-via-vtkImageViewers-tp5737603p5737604.html Sent from the VTK - Users mailing list archive at Nabble.com. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From fboli94 at gmail.com Sun Apr 10 16:55:57 2016 From: fboli94 at gmail.com (fblupi) Date: Sun, 10 Apr 2016 13:55:57 -0700 (MST) Subject: [vtkusers] How to display the points in a greyscale range in other colors for DICOM series via vtkImageViewers In-Reply-To: <707a6d7a.2.154012b0a28.Coremail.tjlp@netease.com> References: <427bdb49.e.15400ac02fa.Coremail.tjlp@netease.com> <1460300875750-5737604.post@n5.nabble.com> <707a6d7a.2.154012b0a28.Coremail.tjlp@netease.com> Message-ID: <1460321757539-5737606.post@n5.nabble.com> "Density" is a density value for a material of your volume (for example air has around -1000, bone 400...). The original grayscale puts darker colors for materials with lower values. That's why you can see the air black. I don't know the value in which the original grayscale turns from black to gray. But you can use 3D Slicer to help you getting these values. With this software you can load a serie of DICOM files and inspect them. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-display-the-points-in-a-greyscale-range-in-other-colors-for-DICOM-series-via-vtkImageViewers-tp5737603p5737606.html Sent from the VTK - Users mailing list archive at Nabble.com. From keagan353 at hotmail.com Sun Apr 10 18:14:33 2016 From: keagan353 at hotmail.com (keags22) Date: Sun, 10 Apr 2016 15:14:33 -0700 (MST) Subject: [vtkusers] Is there a working version of TreeViews.java? Message-ID: <1460326473016-5737607.post@n5.nabble.com> I'm pretty new to VTK and am planning on creating a tree for my existing program. Is there a working version of TreeViews.java?or another example of a tree data structure? TreeViews seems to just give 4 blank panels so im assuming the code is outdated. Any help would be appreciated. -- View this message in context: http://vtk.1045678.n5.nabble.com/Is-there-a-working-version-of-TreeViews-java-tp5737607.html Sent from the VTK - Users mailing list archive at Nabble.com. From tjlp at netease.com Sun Apr 10 21:46:53 2016 From: tjlp at netease.com (Liu_tj) Date: Mon, 11 Apr 2016 09:46:53 +0800 (CST) Subject: [vtkusers] How to display the points in a greyscale range in other colors for DICOM series via vtkImageViewers In-Reply-To: <1460321757539-5737606.post@n5.nabble.com> References: <427bdb49.e.15400ac02fa.Coremail.tjlp@netease.com> <1460300875750-5737604.post@n5.nabble.com> <707a6d7a.2.154012b0a28.Coremail.tjlp@netease.com> <1460321757539-5737606.post@n5.nabble.com> Message-ID: <3e3dd11f.6.15403000473.Coremail.tjlp@netease.com> Hi,fblupi, At present our application only uses VTK. When vtkImageViewer2 is displayed, its vtkImageMapToWindowLevelColors has a default view. What I need is only the points falling in the specific greyscale range are displayed in other color, the other points keeps the old color. With your code, the vtkImageMapToWindowLevelColors will be changed and the points beyond the range will be displayed in dark. I get one thought: get the original lookuptable of vtkImageMapToWindowLevelColors and change the RGB of the point whose density falls in the range. However, when I try to get the lookupTable by m_imageViewer.GetWindowLevel().GetLookupTable(), it returns null. Thanks Liu Peng ?2016-04-11?"fblupi" ??? -----????----- ???:"fblupi" ????:2016?04?11? ??? ???:"vtkusers" ??:Re: [vtkusers] How to display the points in a greyscale range in other colors for DICOM series via vtkImageViewers "Density" is a density value for a material of your volume (for example air has around -1000, bone 400...). The original grayscale puts darker colors for materials with lower values. That's why you can see the air black. I don't know the value in which the original grayscale turns from black to gray. But you can use 3D Slicer to help you getting these values. With this software you can load a serie of DICOM files and inspect them. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-display-the-points-in-a-greyscale-range-in-other-colors-for-DICOM-series-via-vtkImageViewers-tp5737603p5737606.html Sent from the VTK - Users mailing list archive at Nabble.com. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeff.baumes at kitware.com Mon Apr 11 09:00:52 2016 From: jeff.baumes at kitware.com (Jeff Baumes) Date: Mon, 11 Apr 2016 13:00:52 +0000 Subject: [vtkusers] Is there a working version of TreeViews.java? In-Reply-To: <1460326473016-5737607.post@n5.nabble.com> References: <1460326473016-5737607.post@n5.nabble.com> Message-ID: I was able to verify that this is broken in current VTK. On my mac it gave me an empty Java window, a popped-out black render view panel, and when attempting to interact with the UI it crashed with Cocoa AWT: Not running on AppKit thread 0 when expected. I expect it would be a significant cleanup to get that example working again. Jeff On Sun, Apr 10, 2016 at 6:14 PM keags22 wrote: > I'm pretty new to VTK and am planning on creating a tree for my existing > program. > Is there a working version of TreeViews.java?or another example of a tree > data structure? TreeViews seems to just give 4 blank panels so im assuming > the code is outdated. > > Any help would be appreciated. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Is-there-a-working-version-of-TreeViews-java-tp5737607.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Aude.CHENET-ext at galderma.com Mon Apr 11 07:38:23 2016 From: Aude.CHENET-ext at galderma.com (CHENET Aude (External)) Date: Mon, 11 Apr 2016 11:38:23 +0000 Subject: [vtkusers] Multiple vtkTkRenderWidget in python Message-ID: <512AA6AA7E7E224A874888677C6CB2FB57106E@WWEURMBX03.galderma.com> Hi, I'm using vtk with python and try to do the following program : Choose a file using tkFileDialog (filepath = tkFileDialog.askopenfilename(title="Choisir une image",filetypes=[('tif files','.tif'),('tiff files','.tiff')])) Show the image in a window (render_widget = vtkTkRenderWindowInteractor(renderer_frame, rw=renWin, width=600, height=500)) My program have the following error Traceback (most recent call last): File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 328, in V = Viewer(filepath)#("D:\resultatsOCT\Didier Cheek01 b_reconstr.tif") File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 165, in __init__ height=500) File "C:\Python27\Lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py", line 70, in __init__ Tkinter.Widget.__init__(self, master, 'vtkTkRenderWidget', cnf, kw) File "C:\Python27\Lib\lib-tk\Tkinter.py", line 2090, in __init__ (widgetName, self._w) + extra + self._options(cnf)) _tkinter.TclError: invalid command name "vtkTkRenderWidget" The program runs normally if I don't call tkFileDialog to choose the file. It seems like we can't call tkFileDialog and then create a vtkTkRenderWindowInteractor Does anyone have an idea? Aude -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Apr 11 10:49:38 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 11 Apr 2016 08:49:38 -0600 Subject: [vtkusers] Multiple vtkTkRenderWidget in python In-Reply-To: <512AA6AA7E7E224A874888677C6CB2FB57106E@WWEURMBX03.galderma.com> References: <512AA6AA7E7E224A874888677C6CB2FB57106E@WWEURMBX03.galderma.com> Message-ID: Hi Aude, What version of VTK are you using? Can you try loading the vtkTkRederWidget binary model before opening the file dialog? For example, something like this: import Tkinter from vtk.tk.vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets vtkLoadPythonTkWidgets(Tkinter.Tk()) - David On Mon, Apr 11, 2016 at 5:38 AM, CHENET Aude (External) < Aude.CHENET-ext at galderma.com> wrote: > Hi, > > > > I?m using vtk with python and try to do the following program : > > Choose a file using tkFileDialog (filepath = > tkFileDialog.askopenfilename(title="Choisir une image",filetypes=[('tif > files','.tif'),('tiff files','.tiff')])) > > Show the image in a window (render_widget = > vtkTkRenderWindowInteractor(renderer_frame, > > rw=renWin, width=600, > > height=500)) > > > > My program have the following error > > Traceback (most recent call last): > > *File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line > 328, in * > > V = Viewer(filepath)#("D:\resultatsOCT\Didier Cheek01 b_reconstr.tif?) > > *File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line > 165, in __init__* > > height=500) > > *File > "C:\Python27\Lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py", line > 70, in __init__* > > Tkinter.Widget.__init__(self, master, 'vtkTkRenderWidget', cnf, kw) > > *File "C:\Python27\Lib\lib-tk\Tkinter.py", line 2090, in __init__* > > (widgetName, self._w) + extra + self._options(cnf)) > > _tkinter.TclError: invalid command name "vtkTkRenderWidget" > > > > The program runs normally if I don?t call tkFileDialog to choose the file. > It seems like we can?t call tkFileDialog and then create a > vtkTkRenderWindowInteractor > > Does anyone have an idea? > > > > Aude > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Apr 11 11:06:01 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 11 Apr 2016 09:06:01 -0600 Subject: [vtkusers] Multiple vtkTkRenderWidget in python In-Reply-To: <512AA6AA7E7E224A874888677C6CB2FB57209C@WWEURMBX03.galderma.com> References: <512AA6AA7E7E224A874888677C6CB2FB57106E@WWEURMBX03.galderma.com> <512AA6AA7E7E224A874888677C6CB2FB57209C@WWEURMBX03.galderma.com> Message-ID: Hi Aude, I suspect that, somehow, you end up with two separate tcl interpreters. But I don't know how that would happen. Try something else for me: import Tkinter root = Tkinter.Tk() from vtk.tk.vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets vtkLoadPythonTkWidgets(root) root.tk.call('vtkTkRenderWidget', '.vtkwidget') If this prints '.vtkwidget' then you know that vtkTkRenderWidget exists. If your program later says 'invalid command name "vtkTkRenderWidget"', then that message must be coming from a different tcl interpreter. - David On Mon, Apr 11, 2016 at 8:57 AM, CHENET Aude (External) < Aude.CHENET-ext at galderma.com> wrote: > The version I use is 6.3.0. > > > > I?ve tried what you?ve suggested, but didn?t work.. > > > > Aude > > > > *De :* David Gobbi [mailto:david.gobbi at gmail.com] > *Envoy? :* lundi 11 avril 2016 16:50 > *? :* CHENET Aude (External) > *Cc :* vtkusers at public.kitware.com > *Objet :* Re: [vtkusers] Multiple vtkTkRenderWidget in python > > > > Hi Aude, > > > > What version of VTK are you using? > > > > Can you try loading the vtkTkRederWidget binary model before opening the > file dialog? For example, something like this: > > > > import Tkinter > > from vtk.tk.vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets > > vtkLoadPythonTkWidgets(Tkinter.Tk()) > > > > - David > > > > > > > > > > On Mon, Apr 11, 2016 at 5:38 AM, CHENET Aude (External) < > Aude.CHENET-ext at galderma.com> wrote: > > Hi, > > > > I?m using vtk with python and try to do the following program : > > Choose a file using tkFileDialog (filepath = > tkFileDialog.askopenfilename(title="Choisir une image",filetypes=[('tif > files','.tif'),('tiff files','.tiff')])) > > Show the image in a window (render_widget = > vtkTkRenderWindowInteractor(renderer_frame, > > rw=renWin, width=600, > > height=500)) > > > > My program have the following error > > Traceback (most recent call last): > > *File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line > 328, in * > > V = Viewer(filepath)#("D:\resultatsOCT\Didier Cheek01 b_reconstr.tif?) > > *File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line > 165, in __init__* > > height=500) > > *File > "C:\Python27\Lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py", line > 70, in __init__* > > Tkinter.Widget.__init__(self, master, 'vtkTkRenderWidget', cnf, kw) > > *File "C:\Python27\Lib\lib-tk\Tkinter.py", line 2090, in __init__* > > (widgetName, self._w) + extra + self._options(cnf)) > > _tkinter.TclError: invalid command name "vtkTkRenderWidget" > > > > The program runs normally if I don?t call tkFileDialog to choose the file. > It seems like we can?t call tkFileDialog and then create a > vtkTkRenderWindowInteractor > > Does anyone have an idea? > > > > Aude > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Aude.CHENET-ext at galderma.com Mon Apr 11 10:57:39 2016 From: Aude.CHENET-ext at galderma.com (CHENET Aude (External)) Date: Mon, 11 Apr 2016 14:57:39 +0000 Subject: [vtkusers] Multiple vtkTkRenderWidget in python In-Reply-To: References: <512AA6AA7E7E224A874888677C6CB2FB57106E@WWEURMBX03.galderma.com> Message-ID: <512AA6AA7E7E224A874888677C6CB2FB57209C@WWEURMBX03.galderma.com> The version I use is 6.3.0. I?ve tried what you?ve suggested, but didn?t work.. Aude De : David Gobbi [mailto:david.gobbi at gmail.com] Envoy? : lundi 11 avril 2016 16:50 ? : CHENET Aude (External) Cc : vtkusers at public.kitware.com Objet : Re: [vtkusers] Multiple vtkTkRenderWidget in python Hi Aude, What version of VTK are you using? Can you try loading the vtkTkRederWidget binary model before opening the file dialog? For example, something like this: import Tkinter from vtk.tk.vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets vtkLoadPythonTkWidgets(Tkinter.Tk()) - David On Mon, Apr 11, 2016 at 5:38 AM, CHENET Aude (External) > wrote: Hi, I?m using vtk with python and try to do the following program : Choose a file using tkFileDialog (filepath = tkFileDialog.askopenfilename(title="Choisir une image",filetypes=[('tif files','.tif'),('tiff files','.tiff')])) Show the image in a window (render_widget = vtkTkRenderWindowInteractor(renderer_frame, rw=renWin, width=600, height=500)) My program have the following error Traceback (most recent call last): File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 328, in V = Viewer(filepath)#("D:\resultatsOCT\Didier Cheek01 b_reconstr.tif?) File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 165, in __init__ height=500) File "C:\Python27\Lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py", line 70, in __init__ Tkinter.Widget.__init__(self, master, 'vtkTkRenderWidget', cnf, kw) File "C:\Python27\Lib\lib-tk\Tkinter.py", line 2090, in __init__ (widgetName, self._w) + extra + self._options(cnf)) _tkinter.TclError: invalid command name "vtkTkRenderWidget" The program runs normally if I don?t call tkFileDialog to choose the file. It seems like we can?t call tkFileDialog and then create a vtkTkRenderWindowInteractor Does anyone have an idea? Aude -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji.tsumura at neosoftmedical.com Mon Apr 11 11:14:37 2016 From: kenji.tsumura at neosoftmedical.com (Kenji Tsumura) Date: Mon, 11 Apr 2016 15:14:37 +0000 Subject: [vtkusers] vtkImageResliceMapper, vtkImageReslice and pixel intensity In-Reply-To: References: <10285631702C4D4CB5C4921DC14337954EEE13ED@neocoilexch01> Message-ID: <10285631702C4D4CB5C4921DC14337954EEF95C0@neocoilexch01> Hi David, Thank you for the advice. I remember I tried to use vtkImageReslice, but I found it easier to use vtkImageResliceMapper, as all I have to do is to set camera information. As for pixel intensity, it seems I messed up reading DICOM. Thank you, again. Kenji From: David Gobbi [mailto:david.gobbi at gmail.com] Sent: Friday, April 08, 2016 1:30 PM To: Kenji Tsumura Cc: vtkusers at vtk.org Subject: Re: [vtkusers] vtkImageResliceMapper, vtkImageReslice and pixel intensity Hi Kenji, I advise against getting the vtkImageReslice object from the vtkImageResliceMapper. This object is meant to be for the mapper's own private use, and it most certainly will not always behave in the manner that you expect. Depending on the code path taken by vtkImageResliceMapper, the reslice object's spacing and the range of its output will change in tricky ways that are not documented and that might change from one version of VTK to the next. I'm sure that this isn't the answer you wanted, but if you want to reslice the image, then create a separate vtkImageReslice object outside of vtkImageResliceMapper. - David On Fri, Apr 8, 2016 at 12:08 PM, Kenji Tsumura > wrote: Hi, I have 3D MRI dataset and I resliced the data using vtkImageResliceMapper. I find it difficult to figure out why the pixel intensity of resliced images is so different from the original. In the attached file, the resliced image (image on the left) shows the mean value of 21935.5, and the original image (image on the right) shows the mean value of 1447.5. The following is the excerpt of my java source code. vtkExtendedImageResliceMapper extends vtkImageResliceMapper just to return ImageReslice, as there is no such public method. ---- initialization vtkExtendedImageResliceMapper planeMapper = new vtkExtendedImageResliceMapper(); planeMapper.SetInputData(imageData); planeMapper.SliceFacesCameraOn(); planeMapper.SliceAtFocalPointOn(); planeMapper.BorderOff(); planeMapper.SetSlabTypeToMean(); ---- after reslice // Get the image re-slice vtkImageReslice imageReslice = planeMapper.GetImageReslice(); // Get the image data vtkImageData reslicedImageData = imageReslice.GetOutput(); // Get the data array vtkDataArray dataArray = reslicedImageData.GetPointData().GetScalars(); // Get the data float[] image = null; if (dataArray instanceof vtkFloatArray) { vtkFloatArray floatArray = (vtkFloatArray) dataArray; image = floatArray.GetJavaArray(); } My environtment: VTK 7.0.0 CMake 3.1.1 Visual Studio Professional 2013 Eclipse Luna 4.4.1 (for my java application) I would appreciate any advice. Thank you, Kenji ?The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Aude.CHENET-ext at galderma.com Mon Apr 11 07:48:01 2016 From: Aude.CHENET-ext at galderma.com (CHENET Aude (External)) Date: Mon, 11 Apr 2016 11:48:01 +0000 Subject: [vtkusers] Multiple vtkTkRenderWidget in python Message-ID: <512AA6AA7E7E224A874888677C6CB2FB57207E@WWEURMBX03.galderma.com> Hi, I'm using vtk with python and try to do the following program : Choose a file using tkFileDialog (filepath = tkFileDialog.askopenfilename(title="Choisir une image",filetypes=[('tif files','.tif'),('tiff files','.tiff')])) Show the image in a window (render_widget = vtkTkRenderWindowInteractor(renderer_frame, rw=renWin, width=600, height=500)) My program have the following error Traceback (most recent call last): File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 328, in V = Viewer(filepath)#("D:\resultatsOCT\Didier Cheek01 b_reconstr.tif") File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 165, in __init__ height=500) File "C:\Python27\Lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py", line 70, in __init__ Tkinter.Widget.__init__(self, master, 'vtkTkRenderWidget', cnf, kw) File "C:\Python27\Lib\lib-tk\Tkinter.py", line 2090, in __init__ (widgetName, self._w) + extra + self._options(cnf)) _tkinter.TclError: invalid command name "vtkTkRenderWidget" The program runs normally if I don't call tkFileDialog to choose the file. It seems like we can't call tkFileDialog and then create a vtkTkRenderWindowInteractor Does anyone have an idea? Aude -------------- next part -------------- An HTML attachment was scrubbed... URL: From Aude.CHENET-ext at galderma.com Mon Apr 11 11:25:24 2016 From: Aude.CHENET-ext at galderma.com (CHENET Aude (External)) Date: Mon, 11 Apr 2016 15:25:24 +0000 Subject: [vtkusers] Multiple vtkTkRenderWidget in python In-Reply-To: References: <512AA6AA7E7E224A874888677C6CB2FB57106E@WWEURMBX03.galderma.com> <512AA6AA7E7E224A874888677C6CB2FB57209C@WWEURMBX03.galderma.com> Message-ID: <512AA6AA7E7E224A874888677C6CB2FB5720D2@WWEURMBX03.galderma.com> I?ve tried to add your code just before the call to vtkTkRenderWindowInteractor. And there is the same error invalid command name "vtkTkRenderWidget" I?ve tried to call tk.call('vtkTkRenderWidget', '.vtkwidget') with the tk object I already have in my code, and there is no error. I?ll look to find if there are different tcl interpreter installed and used. Aude De : David Gobbi [mailto:david.gobbi at gmail.com] Envoy? : lundi 11 avril 2016 17:06 ? : CHENET Aude (External) Cc : vtkusers at public.kitware.com Objet : Re: [vtkusers] Multiple vtkTkRenderWidget in python Hi Aude, I suspect that, somehow, you end up with two separate tcl interpreters. But I don't know how that would happen. Try something else for me: import Tkinter root = Tkinter.Tk() from vtk.tk.vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets vtkLoadPythonTkWidgets(root) root.tk.call('vtkTkRenderWidget', '.vtkwidget') If this prints '.vtkwidget' then you know that vtkTkRenderWidget exists. If your program later says 'invalid command name "vtkTkRenderWidget"', then that message must be coming from a different tcl interpreter. - David On Mon, Apr 11, 2016 at 8:57 AM, CHENET Aude (External) > wrote: The version I use is 6.3.0. I?ve tried what you?ve suggested, but didn?t work.. Aude De : David Gobbi [mailto:david.gobbi at gmail.com] Envoy? : lundi 11 avril 2016 16:50 ? : CHENET Aude (External) Cc : vtkusers at public.kitware.com Objet : Re: [vtkusers] Multiple vtkTkRenderWidget in python Hi Aude, What version of VTK are you using? Can you try loading the vtkTkRederWidget binary model before opening the file dialog? For example, something like this: import Tkinter from vtk.tk.vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets vtkLoadPythonTkWidgets(Tkinter.Tk()) - David On Mon, Apr 11, 2016 at 5:38 AM, CHENET Aude (External) > wrote: Hi, I?m using vtk with python and try to do the following program : Choose a file using tkFileDialog (filepath = tkFileDialog.askopenfilename(title="Choisir une image",filetypes=[('tif files','.tif'),('tiff files','.tiff')])) Show the image in a window (render_widget = vtkTkRenderWindowInteractor(renderer_frame, rw=renWin, width=600, height=500)) My program have the following error Traceback (most recent call last): File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 328, in V = Viewer(filepath)#("D:\resultatsOCT\Didier Cheek01 b_reconstr.tif?) File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 165, in __init__ height=500) File "C:\Python27\Lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py", line 70, in __init__ Tkinter.Widget.__init__(self, master, 'vtkTkRenderWidget', cnf, kw) File "C:\Python27\Lib\lib-tk\Tkinter.py", line 2090, in __init__ (widgetName, self._w) + extra + self._options(cnf)) _tkinter.TclError: invalid command name "vtkTkRenderWidget" The program runs normally if I don?t call tkFileDialog to choose the file. It seems like we can?t call tkFileDialog and then create a vtkTkRenderWindowInteractor Does anyone have an idea? Aude -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Apr 11 11:35:11 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 11 Apr 2016 09:35:11 -0600 Subject: [vtkusers] Multiple vtkTkRenderWidget in python In-Reply-To: <512AA6AA7E7E224A874888677C6CB2FB5720D2@WWEURMBX03.galderma.com> References: <512AA6AA7E7E224A874888677C6CB2FB57106E@WWEURMBX03.galderma.com> <512AA6AA7E7E224A874888677C6CB2FB57209C@WWEURMBX03.galderma.com> <512AA6AA7E7E224A874888677C6CB2FB5720D2@WWEURMBX03.galderma.com> Message-ID: Inside the code, you can identify a tk object by printing its address: print(repr(tk)) - David On Mon, Apr 11, 2016 at 9:25 AM, CHENET Aude (External) < Aude.CHENET-ext at galderma.com> wrote: > I?ve tried to add your code just before the call to > vtkTkRenderWindowInteractor. And there is the same error invalid command > name "vtkTkRenderWidget" > > I?ve tried to call tk.call('vtkTkRenderWidget', '.vtkwidget') with the tk > object I already have in my code, and there is no error. > > I?ll look to find if there are different tcl interpreter installed and > used. > > > > Aude > > > > *De :* David Gobbi [mailto:david.gobbi at gmail.com] > *Envoy? :* lundi 11 avril 2016 17:06 > > *? :* CHENET Aude (External) > *Cc :* vtkusers at public.kitware.com > *Objet :* Re: [vtkusers] Multiple vtkTkRenderWidget in python > > > > Hi Aude, > > > > I suspect that, somehow, you end up with two separate tcl interpreters. > > But I don't know how that would happen. Try something else for me: > > > > import Tkinter > > root = Tkinter.Tk() > > from vtk.tk.vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets > > vtkLoadPythonTkWidgets(root) > > root.tk.call('vtkTkRenderWidget', '.vtkwidget') > > > > If this prints '.vtkwidget' then you know that vtkTkRenderWidget exists. > > If your program later says 'invalid command name "vtkTkRenderWidget"', > > then that message must be coming from a different tcl interpreter. > > > > - David > > > > > > > > On Mon, Apr 11, 2016 at 8:57 AM, CHENET Aude (External) < > Aude.CHENET-ext at galderma.com> wrote: > > The version I use is 6.3.0. > > > > I?ve tried what you?ve suggested, but didn?t work.. > > > > Aude > > > > *De :* David Gobbi [mailto:david.gobbi at gmail.com] > *Envoy? :* lundi 11 avril 2016 16:50 > *? :* CHENET Aude (External) > *Cc :* vtkusers at public.kitware.com > *Objet :* Re: [vtkusers] Multiple vtkTkRenderWidget in python > > > > Hi Aude, > > > > What version of VTK are you using? > > > > Can you try loading the vtkTkRederWidget binary model before opening the > file dialog? For example, something like this: > > > > import Tkinter > > from vtk.tk.vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets > > vtkLoadPythonTkWidgets(Tkinter.Tk()) > > > > - David > > > > > > > > > > On Mon, Apr 11, 2016 at 5:38 AM, CHENET Aude (External) < > Aude.CHENET-ext at galderma.com> wrote: > > Hi, > > > > I?m using vtk with python and try to do the following program : > > Choose a file using tkFileDialog (filepath = > tkFileDialog.askopenfilename(title="Choisir une image",filetypes=[('tif > files','.tif'),('tiff files','.tiff')])) > > Show the image in a window (render_widget = > vtkTkRenderWindowInteractor(renderer_frame, > > rw=renWin, width=600, > > height=500)) > > > > My program have the following error > > Traceback (most recent call last): > > *File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line > 328, in * > > V = Viewer(filepath)#("D:\resultatsOCT\Didier Cheek01 b_reconstr.tif?) > > *File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line > 165, in __init__* > > height=500) > > *File > "C:\Python27\Lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py", line > 70, in __init__* > > Tkinter.Widget.__init__(self, master, 'vtkTkRenderWidget', cnf, kw) > > *File "C:\Python27\Lib\lib-tk\Tkinter.py", line 2090, in __init__* > > (widgetName, self._w) + extra + self._options(cnf)) > > _tkinter.TclError: invalid command name "vtkTkRenderWidget" > > > > The program runs normally if I don?t call tkFileDialog to choose the file. > It seems like we can?t call tkFileDialog and then create a > vtkTkRenderWindowInteractor > > Does anyone have an idea? > > > > Aude > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin.krotkiewski at gmail.com Mon Apr 11 16:26:29 2016 From: marcin.krotkiewski at gmail.com (marcin.krotkiewski) Date: Mon, 11 Apr 2016 22:26:29 +0200 Subject: [vtkusers] VTK7 and PolygonOffset Message-ID: <570C0875.8000007@gmail.com> Hello, I am wondering if there were any major changes between VTK6.3 and VTK7 in how SetResolveCoincidentTopologyPolygonOffsetParameters in the OpenGL2 backend works. I have been using OpenGL2 and polygon offset to display contour lines on 3D surface meshes (digital elevation models). The parameters I use are (1, mesh_size), where mesh_size is some value related to the 'physical' distance between nodes in my surface meshes. In VTK7 that gives very wrong results. To get similar behavior I seem to have to use (2, 1), regardless of 'physical' distances between the mesh nodes. Could anyone shed some light on that? Thanks! Marcin From zionman.hsu at gmail.com Mon Apr 11 21:31:52 2016 From: zionman.hsu at gmail.com (=?UTF-8?B?5b6Q5b+XIOiPrw==?=) Date: Tue, 12 Apr 2016 09:31:52 +0800 Subject: [vtkusers] vtkGenericDataArray.txx Windows Compiler Error [merged] In-Reply-To: References: Message-ID: Great job. It works fine with static debug building, now. 2016?4?7? ??4:16? "David Lonie" ??? > The patch here fixes it (and some other windows static build issues) for > me: > > https://gitlab.kitware.com/vtk/vtk/merge_requests/1403 > > Assuming the dashboards are happy with it we should get it merged tomorrow. > > Thanks for the bug reports! > Dave > > On Wed, Apr 6, 2016 at 10:04 AM, David Lonie > wrote: > >> On Wed, Apr 6, 2016 at 9:32 AM, David Lonie >> wrote: >> >>> Aha, so it seems to happen when building static libraries. I'll see if I >>> can reproduce this now. >>> >> >> I was able to reproduce with a static library debugging build. I'll post >> again when I have a patch. >> >> Dave >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Tue Apr 12 02:44:20 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Tue, 12 Apr 2016 16:44:20 +1000 Subject: [vtkusers] Disable mouse interaction on overlaid image Message-ID: Dear All I an image overlaid on another image. I only want mouse interaction such as window level change on only one image. How do I do that? I tried pickable off,on the second image but it doesn't work. Any help is highly appreciated! Regards Jothy -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Tue Apr 12 03:59:39 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Tue, 12 Apr 2016 09:59:39 +0200 Subject: [vtkusers] Reader plugin API in VolView? In-Reply-To: References: Message-ID: 2016-03-03 13:51 GMT+01:00 Elvis Stansvik : > Hi all, > > Sorry if this is off-topic, and I know VolView is probably not really > actively developed nowadays, but does anyone know if VolView has a plugin > API for file format readers, like ParaView has? I know there's a plugin API > for filters, but I couldn't find any info on writing custom readers. > Noone knows? Sorry for bumping my own thread like this, won't happen again! Elvis > > Is there anywhere I can browse the VolVIew code without having to download > the tarball? > > Thanks, > Elvis > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Aude.CHENET-ext at galderma.com Tue Apr 12 04:03:56 2016 From: Aude.CHENET-ext at galderma.com (CHENET Aude (External)) Date: Tue, 12 Apr 2016 08:03:56 +0000 Subject: [vtkusers] Multiple vtkTkRenderWidget in python In-Reply-To: References: <512AA6AA7E7E224A874888677C6CB2FB57106E@WWEURMBX03.galderma.com> <512AA6AA7E7E224A874888677C6CB2FB57209C@WWEURMBX03.galderma.com> <512AA6AA7E7E224A874888677C6CB2FB5720D2@WWEURMBX03.galderma.com> Message-ID: <512AA6AA7E7E224A874888677C6CB2FB572105@WWEURMBX03.galderma.com> Thank you for your help. I had 2 instances ok tk, and changing that the problem is solved! Aude De : David Gobbi [mailto:david.gobbi at gmail.com] Envoy? : lundi 11 avril 2016 17:35 ? : CHENET Aude (External) Cc : vtkusers at public.kitware.com Objet : Re: [vtkusers] Multiple vtkTkRenderWidget in python Inside the code, you can identify a tk object by printing its address: print(repr(tk)) - David On Mon, Apr 11, 2016 at 9:25 AM, CHENET Aude (External) > wrote: I?ve tried to add your code just before the call to vtkTkRenderWindowInteractor. And there is the same error invalid command name "vtkTkRenderWidget" I?ve tried to call tk.call('vtkTkRenderWidget', '.vtkwidget') with the tk object I already have in my code, and there is no error. I?ll look to find if there are different tcl interpreter installed and used. Aude De : David Gobbi [mailto:david.gobbi at gmail.com] Envoy? : lundi 11 avril 2016 17:06 ? : CHENET Aude (External) Cc : vtkusers at public.kitware.com Objet : Re: [vtkusers] Multiple vtkTkRenderWidget in python Hi Aude, I suspect that, somehow, you end up with two separate tcl interpreters. But I don't know how that would happen. Try something else for me: import Tkinter root = Tkinter.Tk() from vtk.tk.vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets vtkLoadPythonTkWidgets(root) root.tk.call('vtkTkRenderWidget', '.vtkwidget') If this prints '.vtkwidget' then you know that vtkTkRenderWidget exists. If your program later says 'invalid command name "vtkTkRenderWidget"', then that message must be coming from a different tcl interpreter. - David On Mon, Apr 11, 2016 at 8:57 AM, CHENET Aude (External) > wrote: The version I use is 6.3.0. I?ve tried what you?ve suggested, but didn?t work.. Aude De : David Gobbi [mailto:david.gobbi at gmail.com] Envoy? : lundi 11 avril 2016 16:50 ? : CHENET Aude (External) Cc : vtkusers at public.kitware.com Objet : Re: [vtkusers] Multiple vtkTkRenderWidget in python Hi Aude, What version of VTK are you using? Can you try loading the vtkTkRederWidget binary model before opening the file dialog? For example, something like this: import Tkinter from vtk.tk.vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets vtkLoadPythonTkWidgets(Tkinter.Tk()) - David On Mon, Apr 11, 2016 at 5:38 AM, CHENET Aude (External) > wrote: Hi, I?m using vtk with python and try to do the following program : Choose a file using tkFileDialog (filepath = tkFileDialog.askopenfilename(title="Choisir une image",filetypes=[('tif files','.tif'),('tiff files','.tiff')])) Show the image in a window (render_widget = vtkTkRenderWindowInteractor(renderer_frame, rw=renWin, width=600, height=500)) My program have the following error Traceback (most recent call last): File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 328, in V = Viewer(filepath)#("D:\resultatsOCT\Didier Cheek01 b_reconstr.tif?) File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 165, in __init__ height=500) File "C:\Python27\Lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py", line 70, in __init__ Tkinter.Widget.__init__(self, master, 'vtkTkRenderWidget', cnf, kw) File "C:\Python27\Lib\lib-tk\Tkinter.py", line 2090, in __init__ (widgetName, self._w) + extra + self._options(cnf)) _tkinter.TclError: invalid command name "vtkTkRenderWidget" The program runs normally if I don?t call tkFileDialog to choose the file. It seems like we can?t call tkFileDialog and then create a vtkTkRenderWindowInteractor Does anyone have an idea? Aude -------------- next part -------------- An HTML attachment was scrubbed... URL: From bmoonlu at yeah.net Tue Apr 12 07:04:54 2016 From: bmoonlu at yeah.net (=?UTF-8?B?6Lev5piO5pyI?=) Date: Tue, 12 Apr 2016 19:04:54 +0800 (CST) Subject: [vtkusers] Hollow polygon Message-ID: <60ff02a5.27d1.1540a254156.Coremail.bmoonlu@yeah.net> Hi All, I want to draw a polygon which has a hole in the center.I know the vtkdisksource can do this,but I want to give input dataset to draw. How can I do with this question? Thank you for any help. You sincerely. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Apr 12 08:16:32 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 12 Apr 2016 06:16:32 -0600 Subject: [vtkusers] Disable mouse interaction on overlaid image In-Reply-To: References: Message-ID: Hi Jothy, Are you using vtkInteractionStyleImage? I checked the code, and it doesn't seem to check the pickability of the image. Specifically, I mean the code in SetCurrentImageToNthImage(), which is called by StartWindowLevel(). - David On Tue, Apr 12, 2016 at 12:44 AM, Jothybasu Selvaraj wrote: > Dear All > > I an image overlaid on another image. I only want mouse interaction such > as window level change on only one image. How do I do that? > > I tried pickable off,on the second image but it doesn't work. > > Any help is highly appreciated! > > > Regards > > Jothy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Tue Apr 12 09:09:40 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 12 Apr 2016 09:09:40 -0400 Subject: [vtkusers] Hollow polygon In-Reply-To: <60ff02a5.27d1.1540a254156.Coremail.bmoonlu@yeah.net> References: <60ff02a5.27d1.1540a254156.Coremail.bmoonlu@yeah.net> Message-ID: Hello, The polygon with a hole in it is also a concave, so in order for us to draw it it you have to first convert it into a set of convex polygons. vtkDiskSource produces many polygons, not just one. hope that helps David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Apr 12, 2016 at 7:04 AM, ??? wrote: > Hi All, > I want to draw a polygon which has a hole in the center.I know the > vtkdisksource can do this,but I want to give input dataset to draw. > How can I do with this question? > Thank you for any help. > You sincerely. > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xabivtk at gmail.com Tue Apr 12 09:45:13 2016 From: xabivtk at gmail.com (Xabi Riobe) Date: Tue, 12 Apr 2016 15:45:13 +0200 Subject: [vtkusers] Fwd: vtkDecimatePro crash with CopyNormals=Off In-Reply-To: References: Message-ID: Hi, I have a crash when using vtkDecimatePro (vtk 6.3) if my input has normals with the CopyNormals flag set to 0 (='off'). Attached is a reproductible case with its input. The crash occurs at line 409: outputPD->CopyData(meshPD,ptId,map[ptId]); because it tries to access a part of a normals array that has not been computed properly due to the fact that it was marked with the flag to off. The flag is set in vtkPolyDataNormals. A workaround is to set it back to on before the decimation, but i would like to understand what is the issue. First, why this flag is not set back to On at the end of the normals filter (but other filters like vtkTransformPolyDataFilter will set it to off as well, producing the crash)? And second, is there something to fix in vtkDecimatePro? Thanks for your feedback link to data (vtp): *http://www.filedropper.com/mesh9 * #include #include #include #include #include int main () { // Read the input polydata vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName("./Mesh9.vtp"); reader->Update(); vtkSmartPointer norm = vtkSmartPointer::New(); norm->SetInputConnection(reader->GetOutputPort()); norm->ComputePointNormalsOn(); norm->Update(); const double reduction = 0.98; vtkSmartPointer decimate = vtkSmartPointer::New(); decimate->SetInputConnection(norm->GetOutputPort()); decimate->SetTargetReduction(reduction); decimate->PreserveTopologyOff(); decimate->Update(); return EXIT_SUCCESS; } -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- cmake_minimum_required(VERSION 2.8) PROJECT(Decimate) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) add_executable(Decimate main.cpp) if(VTK_LIBRARIES) target_link_libraries(Decimate ${VTK_LIBRARIES}) else() target_link_libraries(Decimate vtkHybrid vtkWidgets) endif() -------------- next part -------------- A non-text attachment was scrubbed... Name: main.cpp Type: text/x-c++src Size: 883 bytes Desc: not available URL: From elvis.stansvik at orexplore.com Tue Apr 12 09:56:23 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Tue, 12 Apr 2016 15:56:23 +0200 Subject: [vtkusers] Artifacts in volume rendering Message-ID: Hi all, Following Berk Geveci's great blog post from 2014 on writing a custom HDF5 reader in Python [1], I tried to take his code and modify it to load HDF5 files where the densities are float32 and vary between 0 and 64. The only change I did to his reader was to modify RequestData to scale the loaded data and convert it to uint16, like this: data = (data * 1023).astype(uint16) (should get me roughly in the range 0-65535). I then generated a test HDF5 file containing a cylindrical volume like this: def create_cylinder_file(filename, height, radius): """Create a cylindrical volume and save it in test.hdf5. The densities are saved as float32 and will vary sinusoidically from 0 to 64 along the cylinder height. The result is saved in the "test" dataset in the output file. """ z_values = 32 + 32 * sin(linspace(0, 2*pi, height)) diameter = radius * 2 data = zeros(shape=(diameter, diameter, height), dtype=float32) for x in range(diameter): for y in range(diameter): if (x - radius)**2 + (y - radius)**2 <= radius**2: data[x, y, :] = z_values # Write array to HDF5 file. with h5py.File(filename, 'w') as file_: data_set = file_.create_dataset( name='test', shape=data.shape, dtype=data.dtype, data=data ) I then test it all out using a vtkVolumeRayCastMapper based pipeline like this: reader = HDF5Source() reader.SetFileName('test.hdf5') rayCastFunction = vtk.vtkVolumeRayCastCompositeFunction() mapper = vtk.vtkVolumeRayCastMapper() mapper.SetVolumeRayCastFunction(rayCastFunction) mapper.SetInputConnection(reader.GetOutputPort()) colorTransferFunction = vtk.vtkColorTransferFunction() colorTransferFunction.AddRGBPoint(0, 0, 0, 0) # Black colorTransferFunction.AddRGBPoint(20000, 1, 0, 0) # Red colorTransferFunction.AddRGBPoint(40000, 0, 1, 0) # Green colorTransferFunction.AddRGBPoint(65535, 0, 0, 1) # Blue opacityTransferFunction = vtk.vtkPiecewiseFunction() opacityTransferFunction.AddPoint(0, 0) # Transparent opacityTransferFunction.AddPoint(65535, 1) # Opaque volumeProperty = vtk.vtkVolumeProperty() volumeProperty.SetColor(colorTransferFunction) volumeProperty.SetScalarOpacity(opacityTransferFunction) volumeProperty.ShadeOff() volumeProperty.SetInterpolationTypeToLinear() volume = vtk.vtkVolume() volume.SetMapper(mapper) volume.SetProperty(volumeProperty) renderer = vtk.vtkRenderer() renderer.AddVolume(volume) renderer.SetBackground(.85, .84, .83) renderWindow = vtk.vtkRenderWindow() renderWindow.AddRenderer(renderer) renderWindow.SetSize(600, 600) interactor = vtk.vtkRenderWindowInteractor() interactor.SetRenderWindow(renderWindow) interactor.Initialize() renderWindow.Render() interactor.Start() I'm attaching a main.py which contains the full code, including the HDFSource reader with my slight modification, and a screenshot showing the result. Noticy how there's some strange artifacts in the denser (greener, bluer) parts of the cylinder. Anyone know where these artifacts may come from? It's entirely possible that it has nothing to with the custom reader, but something with my pipeline..? Very grateful for any ideas! Cheers, Elvis [1] https://blog.kitware.com/developing-hdf5-readers-using-vtkpythonalgorithm/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: main.py Type: application/x-download Size: 4269 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: artifacts.png Type: image/png Size: 62129 bytes Desc: not available URL: From elvis.stansvik at orexplore.com Tue Apr 12 10:06:37 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Tue, 12 Apr 2016 16:06:37 +0200 Subject: [vtkusers] Artifacts in volume rendering In-Reply-To: References: Message-ID: 2016-04-12 15:56 GMT+02:00 Elvis Stansvik : > Hi all, > > Following Berk Geveci's great blog post from 2014 on writing a custom HDF5 > reader in Python [1], I tried to take his code and modify it to load HDF5 > files where the densities are float32 and vary between 0 and 64. > > The only change I did to his reader was to modify RequestData to scale the > loaded data and convert it to uint16, like this: > > data = (data * 1023).astype(uint16) > > (should get me roughly in the range 0-65535). > > I then generated a test HDF5 file containing a cylindrical volume like > this: > > def create_cylinder_file(filename, height, radius): > """Create a cylindrical volume and save it in test.hdf5. > > The densities are saved as float32 and will vary sinusoidically > from 0 to 64 along the cylinder height. > > The result is saved in the "test" dataset in the output file. > """ > z_values = 32 + 32 * sin(linspace(0, 2*pi, height)) > diameter = radius * 2 > data = zeros(shape=(diameter, diameter, height), dtype=float32) > > for x in range(diameter): > for y in range(diameter): > if (x - radius)**2 + (y - radius)**2 <= radius**2: > data[x, y, :] = z_values > > # Write array to HDF5 file. > with h5py.File(filename, 'w') as file_: > data_set = file_.create_dataset( > name='test', > shape=data.shape, > dtype=data.dtype, > data=data > ) > > I then test it all out using a vtkVolumeRayCastMapper based pipeline like > this: > > reader = HDF5Source() > reader.SetFileName('test.hdf5') > > rayCastFunction = vtk.vtkVolumeRayCastCompositeFunction() > > mapper = vtk.vtkVolumeRayCastMapper() > mapper.SetVolumeRayCastFunction(rayCastFunction) > mapper.SetInputConnection(reader.GetOutputPort()) > > colorTransferFunction = vtk.vtkColorTransferFunction() > colorTransferFunction.AddRGBPoint(0, 0, 0, 0) # Black > colorTransferFunction.AddRGBPoint(20000, 1, 0, 0) # Red > colorTransferFunction.AddRGBPoint(40000, 0, 1, 0) # Green > colorTransferFunction.AddRGBPoint(65535, 0, 0, 1) # Blue > > opacityTransferFunction = vtk.vtkPiecewiseFunction() > opacityTransferFunction.AddPoint(0, 0) # Transparent > opacityTransferFunction.AddPoint(65535, 1) # Opaque > > volumeProperty = vtk.vtkVolumeProperty() > volumeProperty.SetColor(colorTransferFunction) > volumeProperty.SetScalarOpacity(opacityTransferFunction) > volumeProperty.ShadeOff() > volumeProperty.SetInterpolationTypeToLinear() > > volume = vtk.vtkVolume() > volume.SetMapper(mapper) > volume.SetProperty(volumeProperty) > > renderer = vtk.vtkRenderer() > renderer.AddVolume(volume) > renderer.SetBackground(.85, .84, .83) > > renderWindow = vtk.vtkRenderWindow() > renderWindow.AddRenderer(renderer) > renderWindow.SetSize(600, 600) > > interactor = vtk.vtkRenderWindowInteractor() > interactor.SetRenderWindow(renderWindow) > interactor.Initialize() > > renderWindow.Render() > interactor.Start() > > I'm attaching a main.py which contains the full code, including the > HDFSource reader with my slight modification, and a screenshot showing the > result. > > Noticy how there's some strange artifacts in the denser (greener, bluer) > parts of the cylinder. Anyone know where these artifacts may come from? > It's entirely possible that it has nothing to with the custom reader, but > something with my pipeline..? > > Very grateful for any ideas! > I forgot to say: This is with VTK 6.2 from Ubuntu packages. Elvis > > Cheers, > Elvis > > [1] > https://blog.kitware.com/developing-hdf5-readers-using-vtkpythonalgorithm/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Tue Apr 12 10:16:17 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Tue, 12 Apr 2016 16:16:17 +0200 Subject: [vtkusers] Artifacts in volume rendering In-Reply-To: References: Message-ID: 2016-04-12 15:56 GMT+02:00 Elvis Stansvik : > Hi all, > > Following Berk Geveci's great blog post from 2014 on writing a custom HDF5 > reader in Python [1], I tried to take his code and modify it to load HDF5 > files where the densities are float32 and vary between 0 and 64. > > The only change I did to his reader was to modify RequestData to scale the > loaded data and convert it to uint16, like this: > > data = (data * 1023).astype(uint16) > > (should get me roughly in the range 0-65535). > > I then generated a test HDF5 file containing a cylindrical volume like > this: > > def create_cylinder_file(filename, height, radius): > """Create a cylindrical volume and save it in test.hdf5. > > The densities are saved as float32 and will vary sinusoidically > from 0 to 64 along the cylinder height. > > The result is saved in the "test" dataset in the output file. > """ > z_values = 32 + 32 * sin(linspace(0, 2*pi, height)) > diameter = radius * 2 > data = zeros(shape=(diameter, diameter, height), dtype=float32) > > for x in range(diameter): > for y in range(diameter): > if (x - radius)**2 + (y - radius)**2 <= radius**2: > data[x, y, :] = z_values > I made a quick test with densities uniformly random 0-64 instead (e.g. data[x, y, :] = uniform(0, 64, height) above instead), with the attached result. Notice how the artifacts are still present (they're particularly visible from this angle). Perhaps it's obvious to someone more experienced in visualisation than I am what is happening here? Elvis > > # Write array to HDF5 file. > with h5py.File(filename, 'w') as file_: > data_set = file_.create_dataset( > name='test', > shape=data.shape, > dtype=data.dtype, > data=data > ) > > I then test it all out using a vtkVolumeRayCastMapper based pipeline like > this: > > reader = HDF5Source() > reader.SetFileName('test.hdf5') > > rayCastFunction = vtk.vtkVolumeRayCastCompositeFunction() > > mapper = vtk.vtkVolumeRayCastMapper() > mapper.SetVolumeRayCastFunction(rayCastFunction) > mapper.SetInputConnection(reader.GetOutputPort()) > > colorTransferFunction = vtk.vtkColorTransferFunction() > colorTransferFunction.AddRGBPoint(0, 0, 0, 0) # Black > colorTransferFunction.AddRGBPoint(20000, 1, 0, 0) # Red > colorTransferFunction.AddRGBPoint(40000, 0, 1, 0) # Green > colorTransferFunction.AddRGBPoint(65535, 0, 0, 1) # Blue > > opacityTransferFunction = vtk.vtkPiecewiseFunction() > opacityTransferFunction.AddPoint(0, 0) # Transparent > opacityTransferFunction.AddPoint(65535, 1) # Opaque > > volumeProperty = vtk.vtkVolumeProperty() > volumeProperty.SetColor(colorTransferFunction) > volumeProperty.SetScalarOpacity(opacityTransferFunction) > volumeProperty.ShadeOff() > volumeProperty.SetInterpolationTypeToLinear() > > volume = vtk.vtkVolume() > volume.SetMapper(mapper) > volume.SetProperty(volumeProperty) > > renderer = vtk.vtkRenderer() > renderer.AddVolume(volume) > renderer.SetBackground(.85, .84, .83) > > renderWindow = vtk.vtkRenderWindow() > renderWindow.AddRenderer(renderer) > renderWindow.SetSize(600, 600) > > interactor = vtk.vtkRenderWindowInteractor() > interactor.SetRenderWindow(renderWindow) > interactor.Initialize() > > renderWindow.Render() > interactor.Start() > > I'm attaching a main.py which contains the full code, including the > HDFSource reader with my slight modification, and a screenshot showing the > result. > > Noticy how there's some strange artifacts in the denser (greener, bluer) > parts of the cylinder. Anyone know where these artifacts may come from? > It's entirely possible that it has nothing to with the custom reader, but > something with my pipeline..? > > Very grateful for any ideas! > > Cheers, > Elvis > > [1] > https://blog.kitware.com/developing-hdf5-readers-using-vtkpythonalgorithm/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: artifacts_uniform.png Type: image/png Size: 106541 bytes Desc: not available URL: From Aude.CHENET-ext at galderma.com Tue Apr 12 10:19:08 2016 From: Aude.CHENET-ext at galderma.com (CHENET Aude (External)) Date: Tue, 12 Apr 2016 14:19:08 +0000 Subject: [vtkusers] Creating exe with vtkTkWidgets Message-ID: <512AA6AA7E7E224A874888677C6CB2FB572191@WWEURMBX03.galderma.com> Hi all, I'm trying to make an executable from a python code which uses vtk 6.3.0 and TkWidgets. When I package my application, pyinstaller don't find the dependence to vtkRenderingPythonTkWidgets-6.3.dll. I've tried to add the dll into the directory where pyinstaller copy all the dll it founds, and that doesn't work. When I execute the .exe, there is an error ImportError: DLL load failed, always about the vtkRenderingPythonTkWidgets' one. Does anyone have an idea to solve this problem and create an executable embedding vtkTkWidgets? Aude -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Tue Apr 12 10:25:27 2016 From: ken.martin at kitware.com (Ken Martin) Date: Tue, 12 Apr 2016 10:25:27 -0400 Subject: [vtkusers] Reader plugin API in VolView? In-Reply-To: References: Message-ID: I do not recall a reader plugin API, filtering was the main focus for plugins. The readers are VTK readers so if you want to add your own reader you would follow the model of any vtk reader that produces vtkImageData, most of them are subclasses of vtkImageReader2 or vtkMedicalImasgeReader2, etc and then add that to VolView by modifying the code that handles file IO in VolView - Hope that helps - Ken On Tue, Apr 12, 2016 at 3:59 AM, Elvis Stansvik < elvis.stansvik at orexplore.com> wrote: > 2016-03-03 13:51 GMT+01:00 Elvis Stansvik : > >> Hi all, >> >> Sorry if this is off-topic, and I know VolView is probably not really >> actively developed nowadays, but does anyone know if VolView has a plugin >> API for file format readers, like ParaView has? I know there's a plugin API >> for filters, but I couldn't find any info on writing custom readers. >> > > Noone knows? Sorry for bumping my own thread like this, won't happen again! > > Elvis > > >> >> Is there anywhere I can browse the VolVIew code without having to >> download the tarball? >> >> Thanks, >> Elvis >> > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Tue Apr 12 10:46:56 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Tue, 12 Apr 2016 16:46:56 +0200 Subject: [vtkusers] Reader plugin API in VolView? In-Reply-To: References: Message-ID: 2016-04-12 16:25 GMT+02:00 Ken Martin : > I do not recall a reader plugin API, filtering was the main focus for > plugins. The readers are VTK readers so if you want to add your own reader > you would follow the model of any vtk reader that produces vtkImageData, > most of them are subclasses of vtkImageReader2 or vtkMedicalImasgeReader2, > etc and then add that to VolView by modifying the code that handles file > IO in VolView > Alright, thanks for confirming Ken! Too bad there's no plugin API, as rebuilding VolView is quite a chore. Elvis > > - Hope that helps > - Ken > > > On Tue, Apr 12, 2016 at 3:59 AM, Elvis Stansvik < > elvis.stansvik at orexplore.com> wrote: > >> 2016-03-03 13:51 GMT+01:00 Elvis Stansvik : >> >>> Hi all, >>> >>> Sorry if this is off-topic, and I know VolView is probably not really >>> actively developed nowadays, but does anyone know if VolView has a plugin >>> API for file format readers, like ParaView has? I know there's a plugin API >>> for filters, but I couldn't find any info on writing custom readers. >>> >> >> Noone knows? Sorry for bumping my own thread like this, won't happen >> again! >> >> Elvis >> >> >>> >>> Is there anywhere I can browse the VolVIew code without having to >>> download the tarball? >>> >>> Thanks, >>> Elvis >>> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > Ken Martin PhD > Chairman & CFO > Kitware Inc. > 28 Corporate Drive > Clifton Park NY 12065 > 518 371 3971 > > This communication, including all attachments, contains confidential and > legally privileged information, and it is intended only for the use of the > addressee. Access to this email by anyone else is unauthorized. If you are > not the intended recipient, any disclosure, copying, distribution or any > action taken in reliance on it is prohibited and may be unlawful. If you > received this communication in error please notify us immediately and > destroy the original message. Thank you. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Tue Apr 12 10:52:12 2016 From: ken.martin at kitware.com (Ken Martin) Date: Tue, 12 Apr 2016 10:52:12 -0400 Subject: [vtkusers] VTK7 and PolygonOffset In-Reply-To: <570C0875.8000007@gmail.com> References: <570C0875.8000007@gmail.com> Message-ID: For the OpenGL2 backend VTK version 7.0 the offset code is based on two properties, the factor and units. The shader math is shown below but the basic gist is that the units (coffset below) impacts all fragments while the factor (cfactor below) is weighted by the slope of the fragment. The greater the z-slope of a fragment the farther you need to offset to make sure the two fragments are not coincident. Positive values push farther back in the z buffer. The properties are unitless in that the coordinate system your actor is defined in has no impact on the values. "float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));\n" " gl_FragDepth = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;\n" VTK defaults these properties to the following values for polygons/lines/points such that if you turn on resolving coincident topology using polygon offset the defaults should work fairly well to put points on top of lines and line on top of polygons. Also be aware in VTK 7 you can specify mapper specific adjustments to these globals using the SetRelativeCoincidentTopologyPolygonOffsetParameters style methods. Those methods add the mapper specific value to the global for that mapper. Values in the range of -10 --- +10 generally make sense. The factor and units should typically have the same sign. static double vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetFactor = 2.0;static double vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetUnits = 2.0;static double vtkMapperGlobalResolveCoincidentTopologyLineOffsetFactor = 1.0;static double vtkMapperGlobalResolveCoincidentTopologyLineOffsetUnits = 1.0;static double vtkMapperGlobalResolveCoincidentTopologyPointOffsetUnits = 0.0; Hope that helps Ken On Mon, Apr 11, 2016 at 4:26 PM, marcin.krotkiewski < marcin.krotkiewski at gmail.com> wrote: > Hello, > > I am wondering if there were any major changes between VTK6.3 and VTK7 in > how SetResolveCoincidentTopologyPolygonOffsetParameters in the OpenGL2 > backend works. > > I have been using OpenGL2 and polygon offset to display contour lines on > 3D surface meshes (digital elevation models). The parameters I use are (1, > mesh_size), where mesh_size is some value related to the 'physical' > distance between nodes in my surface meshes. In VTK7 that gives very wrong > results. To get similar behavior I seem to have to use (2, 1), regardless > of 'physical' distances between the mesh nodes. > > Could anyone shed some light on that? > > Thanks! > > Marcin > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From abenchaaben at histalim.com Tue Apr 12 11:26:34 2016 From: abenchaaben at histalim.com (abenchaaben) Date: Tue, 12 Apr 2016 08:26:34 -0700 (MST) Subject: [vtkusers] VTK RGB rendering Volume Message-ID: <1460474794002-5737641.post@n5.nabble.com> Hello, I have a 2D RGB serie that i want to render it with VTK. I created the volume with the help of ITK and i have now a vti file. I used an example of rendering that i found online: double opacityWindow = 4096; double opacityLevel = 2048; int blendType = 6; int clip = 0; double reductionFactor = 1.0; double frameRate = 10.0; char *fileName = (char*)VolumePath.c_str(); bool independentComponents=true; // Create the renderer, render window and interactor vtkRenderer *renderer = vtkRenderer::New(); uinw->qvtkWidget->GetRenderWindow()->AddRenderer(renderer); QVTKInteractor *iren=uinw->qvtkWidget->GetInteractor(); vtkInteractorStyle *s= static_cast(iren->GetInteractorStyle()); vtkTDxInteractorStyleCamera *t= static_cast(s->GetTDxStyle()); const double angleSensitivity=0.02; const double translationSensitivity=0.001; t->GetSettings()->SetAngleSensitivity(angleSensitivity); t->GetSettings()->SetTranslationXSensitivity(translationSensitivity); t->GetSettings()->SetTranslationYSensitivity(translationSensitivity); t->GetSettings()->SetTranslationZSensitivity(translationSensitivity); iren->SetRenderWindow(uinw->qvtkWidget->GetRenderWindow()); iren->SetDesiredUpdateRate(frameRate / (1+clip) ); iren->GetInteractorStyle()->SetDefaultRenderer(renderer); // Read the data vtkAlgorithm *reader3=0; vtkImageData *input2=0; vtkXMLImageDataReader *xmlReader = vtkXMLImageDataReader::New(); xmlReader->SetFileName(fileName); xmlReader->Update(); input2=xmlReader->GetOutput(); reader3=xmlReader; // Verify that we actually have a volume int dim[3]; input2->GetDimensions(dim); if ( dim[0] < 2 || dim[1] < 2 || dim[2] < 2 ) { cout << "Error loading data!" << endl; exit(EXIT_FAILURE); } vtkImageResample *resample = vtkImageResample::New(); if ( reductionFactor < 1.0 ) { resample->SetInputConnection( reader3->GetOutputPort() ); resample->SetAxisMagnificationFactor(0, reductionFactor); resample->SetAxisMagnificationFactor(1, reductionFactor); resample->SetAxisMagnificationFactor(2, reductionFactor); } // Create our volume and mapper vtkVolume *volume = vtkVolume::New(); vtkFixedPointVolumeRayCastMapper *mapper = vtkFixedPointVolumeRayCastMapper::New(); if ( reductionFactor < 1.0 ) { mapper->SetInputConnection( resample->GetOutputPort() ); } else { mapper->SetInputConnection( reader3->GetOutputPort() ); } // Set the sample distance on the ray to be 1/2 the average spacing double spacing[3]; if ( reductionFactor < 1.0 ) { resample->GetOutput()->GetSpacing(spacing); } else { input2->GetSpacing(spacing); } // mapper->SetSampleDistance( (spacing[0]+spacing[1]+spacing[2])/6.0 ); // mapper->SetMaximumImageSampleDistance(10.0); // Create our transfer function vtkColorTransferFunction *colorFun = vtkColorTransferFunction::New(); vtkPiecewiseFunction *opacityFun = vtkPiecewiseFunction::New(); // Create the property and attach the transfer functions vtkVolumeProperty *property = vtkVolumeProperty::New(); property->SetIndependentComponents(independentComponents); property->SetColor( colorFun ); property->SetScalarOpacity( opacityFun ); property->SetInterpolationTypeToLinear(); // connect up the volume to the property and the mapper volume->SetProperty( property ); volume->SetMapper( mapper ); // Depending on the blend type selected as a command line option, // adjust the transfer function switch ( blendType ) { // MIP // Create an opacity ramp from the window and level values. // Color is white. Blending is MIP. case 0: colorFun->AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0 ); opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, opacityLevel + 0.5*opacityWindow, 1.0 ); mapper->SetBlendModeToMaximumIntensity(); break; // CompositeRamp // Create a ramp from the window and level values. Use compositing // without shading. Color is a ramp from black to white. case 1: colorFun->AddRGBSegment(opacityLevel - 0.5*opacityWindow, 0.0, 0.0, 0.0, opacityLevel + 0.5*opacityWindow, 1.0, 1.0, 1.0 ); opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, opacityLevel + 0.5*opacityWindow, 1.0 ); mapper->SetBlendModeToComposite(); property->ShadeOff(); break; // CompositeShadeRamp // Create a ramp from the window and level values. Use compositing // with shading. Color is white. case 2: colorFun->AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0 ); opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, opacityLevel + 0.5*opacityWindow, 1.0 ); mapper->SetBlendModeToComposite(); property->ShadeOn(); break; // CT_Skin // Use compositing and functions set to highlight skin in CT data // Not for use on RGB data case 3: colorFun->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); colorFun->AddRGBPoint( -1000, .62, .36, .18, 0.5, 0.0 ); colorFun->AddRGBPoint( -500, .88, .60, .29, 0.33, 0.45 ); colorFun->AddRGBPoint( 3071, .83, .66, 1, 0.5, 0.0 ); opacityFun->AddPoint(-3024, 0, 0.5, 0.0 ); opacityFun->AddPoint(-1000, 0, 0.5, 0.0 ); opacityFun->AddPoint(-500, 1.0, 0.33, 0.45 ); opacityFun->AddPoint(3071, 1.0, 0.5, 0.0); mapper->SetBlendModeToComposite(); property->ShadeOn(); property->SetAmbient(0.1); property->SetDiffuse(0.9); property->SetSpecular(0.2); property->SetSpecularPower(10.0); property->SetScalarOpacityUnitDistance(0.8919); break; // CT_Bone // Use compositing and functions set to highlight bone in CT data // Not for use on RGB data case 4: colorFun->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); colorFun->AddRGBPoint( -16, 0.73, 0.25, 0.30, 0.49, .61 ); colorFun->AddRGBPoint( 641, .90, .82, .56, .5, 0.0 ); colorFun->AddRGBPoint( 3071, 1, 1, 1, .5, 0.0 ); opacityFun->AddPoint(-3024, 0, 0.5, 0.0 ); opacityFun->AddPoint(-16, 0, .49, .61 ); opacityFun->AddPoint(641, .72, .5, 0.0 ); opacityFun->AddPoint(3071, .71, 0.5, 0.0); mapper->SetBlendModeToComposite(); property->ShadeOn(); property->SetAmbient(0.1); property->SetDiffuse(0.9); property->SetSpecular(0.2); property->SetSpecularPower(10.0); property->SetScalarOpacityUnitDistance(0.8919); break; // CT_Muscle // Use compositing and functions set to highlight muscle in CT data // Not for use on RGB data case 5: colorFun->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); colorFun->AddRGBPoint( -155, .55, .25, .15, 0.5, .92 ); colorFun->AddRGBPoint( 217, .88, .60, .29, 0.33, 0.45 ); colorFun->AddRGBPoint( 420, 1, .94, .95, 0.5, 0.0 ); colorFun->AddRGBPoint( 3071, .83, .66, 1, 0.5, 0.0 ); opacityFun->AddPoint(-3024, 0, 0.5, 0.0 ); opacityFun->AddPoint(-155, 0, 0.5, 0.92 ); opacityFun->AddPoint(217, .68, 0.33, 0.45 ); opacityFun->AddPoint(420,.83, 0.5, 0.0); opacityFun->AddPoint(3071, .80, 0.5, 0.0); mapper->SetBlendModeToComposite(); property->ShadeOn(); property->SetAmbient(0.1); property->SetDiffuse(0.9); property->SetSpecular(0.2); property->SetSpecularPower(10.0); property->SetScalarOpacityUnitDistance(0.8919); break; // RGB_Composite // Use compositing and functions set to highlight red/green/blue regions // in RGB data. Not for use on single component data case 6: opacityFun->AddPoint(0, 0.0); opacityFun->AddPoint(5.0, 0.0); opacityFun->AddPoint(30.0, 0.05); opacityFun->AddPoint(31.0, 0.0); opacityFun->AddPoint(90.0, 0.0); opacityFun->AddPoint(100.0, 0.3); opacityFun->AddPoint(110.0, 0.0); opacityFun->AddPoint(190.0, 0.0); opacityFun->AddPoint(200.0, 0.4); opacityFun->AddPoint(210.0, 0.0); opacityFun->AddPoint(245.0, 0.0); opacityFun->AddPoint(255.0, 0.5); mapper->SetBlendModeToComposite(); property->ShadeOff(); property->SetScalarOpacityUnitDistance(1.0); break; default: vtkGenericWarningMacro("Unknown blend type."); break; } // Set the default window size uinw->qvtkWidget->GetRenderWindow()->Render(); // Add the volume to the scene renderer->AddVolume( volume ); renderer->ResetCamera(); // interact with data uinw->qvtkWidget->GetRenderWindow()->Render(); opacityFun->Delete(); colorFun->Delete(); property->Delete(); volume->Delete(); mapper->Delete(); reader3->Delete(); resample->Delete(); renderer->Delete(); The problem is that nwith this example it give me the volume with color transformation and i want to display the volume with the true RGB color from the images serie that i use when i start. Does VTK support such operation?? -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-RGB-rendering-Volume-tp5737641.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Tue Apr 12 11:38:50 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 12 Apr 2016 09:38:50 -0600 Subject: [vtkusers] Creating exe with vtkTkWidgets In-Reply-To: <512AA6AA7E7E224A874888677C6CB2FB572191@WWEURMBX03.galderma.com> References: <512AA6AA7E7E224A874888677C6CB2FB572191@WWEURMBX03.galderma.com> Message-ID: Hi Aude, It's a tcl module, so it is expected that a dependency search will not find it. According to the code in vtkLoadPythonTkWidgets.py, it can be installed anywhere in python's sys.path or in or in tcl's auto_path. - David On Tue, Apr 12, 2016 at 8:19 AM, CHENET Aude (External) < Aude.CHENET-ext at galderma.com> wrote: > Hi all, > > > > I?m trying to make an executable from a python code which uses vtk 6.3.0 > and TkWidgets. > > When I package my application, pyinstaller don?t find the dependence to > vtkRenderingPythonTkWidgets-6.3.dll. I?ve tried to add the dll into the > directory where pyinstaller copy all the dll it founds, and that doesn?t > work. > > When I execute the .exe, there is an error ImportError: DLL load failed, > always about the vtkRenderingPythonTkWidgets? one. > > Does anyone have an idea to solve this problem and create an executable > embedding vtkTkWidgets? > > > > Aude > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fabian.trobles at gmail.com Tue Apr 12 13:01:52 2016 From: fabian.trobles at gmail.com (Fabian Torres) Date: Tue, 12 Apr 2016 12:01:52 -0500 Subject: [vtkusers] gpu_shader4 is not supported Message-ID: Hi all I'm trying to use vtk in a server with: windows server 2012 VS 2013 VTK 7.0.0 NVIDIA Tesla K40c VTK compiles in VS without any errors, but when I try to run the examples cone.exe or any other I get the next error Error: In C:/Libraries/VTK-7.0.0/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 545 vtkWin32OpenGLRenderWindow [0059BF18]: GL version 2.1 with gpu_shader4 extension is not supported by your graphics driver. Im not an OpenGL expert so I do not know how to fix this problem. Can anybody help me? Thanks a lot. -- Fabi?n Torres Robles Maestria en Ciencias en Ingenier?a Electr?nica Ingenier?a en Sistemas Electr?nicos tel. 58081280, 0445534661338 e-mail fabian.trobles at gmail.com, dae.wong at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at 3scan.com Tue Apr 12 18:05:48 2016 From: alex at 3scan.com (alex.braun) Date: Tue, 12 Apr 2016 15:05:48 -0700 (MST) Subject: [vtkusers] read a stack of images (as numpy array) into marching cubes Message-ID: <1460498748462-5737646.post@n5.nabble.com> I have a stack of PNGs that I'm reading into a numpy array (3D tensor) and then into a vtk array via: data = numpy_to_vtk(num_array=data.ravel(), deep=True, array_type=vtk.VTK_INT) I would like to feed this into vtkDiscreteMarchingCubes and then pump the output back to numpy or an obj file, but marching cubes takes a DataObject and I have no idea how to convert an array into one. Any suggestions? -- View this message in context: http://vtk.1045678.n5.nabble.com/read-a-stack-of-images-as-numpy-array-into-marching-cubes-tp5737646.html Sent from the VTK - Users mailing list archive at Nabble.com. From jothybasu at gmail.com Tue Apr 12 18:05:59 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Wed, 13 Apr 2016 08:05:59 +1000 Subject: [vtkusers] Disable mouse interaction on overlaid image In-Reply-To: References: Message-ID: Yes, I use vtkInteractorStyleImage. Cheers Jothy On Tue, Apr 12, 2016 at 10:16 PM, David Gobbi wrote: > Hi Jothy, > > Are you using vtkInteractionStyleImage? I checked the code, and it doesn't > seem to check the pickability of the image. Specifically, I mean the code > in > SetCurrentImageToNthImage(), which is called by StartWindowLevel(). > > - David > > On Tue, Apr 12, 2016 at 12:44 AM, Jothybasu Selvaraj > wrote: > >> Dear All >> >> I an image overlaid on another image. I only want mouse interaction such >> as window level change on only one image. How do I do that? >> >> I tried pickable off,on the second image but it doesn't work. >> >> Any help is highly appreciated! >> >> >> Regards >> >> Jothy >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Apr 12 18:42:30 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 12 Apr 2016 16:42:30 -0600 Subject: [vtkusers] Disable mouse interaction on overlaid image In-Reply-To: References: Message-ID: Hi Jothy, Can you try the code change in the following merge request to see if it fixes the problem? https://gitlab.kitware.com/vtk/vtk/merge_requests/1421 - David On Tue, Apr 12, 2016 at 4:05 PM, Jothybasu Selvaraj wrote: > Yes, I use vtkInteractorStyleImage. > > Cheers > > Jothy > > On Tue, Apr 12, 2016 at 10:16 PM, David Gobbi > wrote: > >> Hi Jothy, >> >> Are you using vtkInteractionStyleImage? I checked the code, and it >> doesn't >> seem to check the pickability of the image. Specifically, I mean the >> code in >> SetCurrentImageToNthImage(), which is called by StartWindowLevel(). >> >> - David >> >> On Tue, Apr 12, 2016 at 12:44 AM, Jothybasu Selvaraj > > wrote: >> >>> Dear All >>> >>> I an image overlaid on another image. I only want mouse interaction such >>> as window level change on only one image. How do I do that? >>> >>> I tried pickable off,on the second image but it doesn't work. >>> >>> Any help is highly appreciated! >>> >>> >>> Regards >>> >>> Jothy >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tossin at gmail.com Tue Apr 12 19:59:32 2016 From: tossin at gmail.com (Evan Kao) Date: Tue, 12 Apr 2016 16:59:32 -0700 Subject: [vtkusers] Is there an elegant way to switch event handling between VTK and Qt when using QVTKRenderWindowInteractor in Python? Message-ID: Hello vtk-users, I'm playing around with QVTKRenderWindowInteractor and had a question about handling events. Specifically is it possible to pick who is handling the events between PyQt and VTK? For instance, say I have the following setup: class View(QMainWindow): def __init__(self, ...): ... self.vtkWidget = QVTKRenderWindowInteractor(...) ... def keyPressEvent(self, e): ... At the start of the application, any key press event will be handled by the keyPressEvent method. But once I click on the vtkWidget, all events are handled by the vtkWidget's RenderWindowInteractor and there doesn't seem like a convenient way to switch control back to the main window. At least for me, clicking on other parts of the application window does not return control to Qt. I have noticed that if I press a button, event handling is returned to keyPressEvent, but it seems a little cumbersome to have to set up a dummy button to switch between VTK and Qt. Is there a smarter way? Also, if it matters, I'm using PyQt 4.11.4, VTK 5.10.0, Python 2.7.11 on a Windows 7 64-bit machine. Thanks, Evan Kao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Tue Apr 12 20:15:27 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Wed, 13 Apr 2016 10:15:27 +1000 Subject: [vtkusers] Disable mouse interaction on overlaid image In-Reply-To: References: Message-ID: Hi David I am not familiar with using Gitlab. So, I subclassed vtkInteractorStyleImage and override SetCurrentImageToNthImage(). Still it didn't work, because the layer number is hardcoded into StartWindowLevel() with this->SetCurrentImageToNthImage(-1); So the mouse only interacts with the last image. I changed it to "0" so that it pick the first image. It solves my problem. I only want to interact with the first image :). Thank a lot for your inputs. Cheers Jothy On Wed, Apr 13, 2016 at 8:42 AM, David Gobbi wrote: > Hi Jothy, > > Can you try the code change in the following merge request to > see if it fixes the problem? > > https://gitlab.kitware.com/vtk/vtk/merge_requests/1421 > > - David > > > On Tue, Apr 12, 2016 at 4:05 PM, Jothybasu Selvaraj > wrote: > >> Yes, I use vtkInteractorStyleImage. >> >> Cheers >> >> Jothy >> >> On Tue, Apr 12, 2016 at 10:16 PM, David Gobbi >> wrote: >> >>> Hi Jothy, >>> >>> Are you using vtkInteractionStyleImage? I checked the code, and it >>> doesn't >>> seem to check the pickability of the image. Specifically, I mean the >>> code in >>> SetCurrentImageToNthImage(), which is called by StartWindowLevel(). >>> >>> - David >>> >>> On Tue, Apr 12, 2016 at 12:44 AM, Jothybasu Selvaraj < >>> jothybasu at gmail.com> wrote: >>> >>>> Dear All >>>> >>>> I an image overlaid on another image. I only want mouse interaction >>>> such as window level change on only one image. How do I do that? >>>> >>>> I tried pickable off,on the second image but it doesn't work. >>>> >>>> Any help is highly appreciated! >>>> >>>> >>>> Regards >>>> >>>> Jothy >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Tue Apr 12 20:18:08 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Wed, 13 Apr 2016 10:18:08 +1000 Subject: [vtkusers] Disable mouse interaction on overlaid image In-Reply-To: References: Message-ID: I would rather like to have this SetCurrentImageToNthImage to be public and user definable. Jothy On Wed, Apr 13, 2016 at 10:15 AM, Jothybasu Selvaraj wrote: > Hi David > > I am not familiar with using Gitlab. So, I subclassed > vtkInteractorStyleImage and override SetCurrentImageToNthImage(). > > Still it didn't work, because the layer number is hardcoded into StartWindowLevel() > with this->SetCurrentImageToNthImage(-1); So the mouse only interacts with > the last image. I changed it to "0" so that it pick the first image. > > It solves my problem. I only want to interact with the first image :). > > > Thank a lot for your inputs. > > > Cheers > > Jothy > > On Wed, Apr 13, 2016 at 8:42 AM, David Gobbi > wrote: > >> Hi Jothy, >> >> Can you try the code change in the following merge request to >> see if it fixes the problem? >> >> https://gitlab.kitware.com/vtk/vtk/merge_requests/1421 >> >> - David >> >> >> On Tue, Apr 12, 2016 at 4:05 PM, Jothybasu Selvaraj >> wrote: >> >>> Yes, I use vtkInteractorStyleImage. >>> >>> Cheers >>> >>> Jothy >>> >>> On Tue, Apr 12, 2016 at 10:16 PM, David Gobbi >>> wrote: >>> >>>> Hi Jothy, >>>> >>>> Are you using vtkInteractionStyleImage? I checked the code, and it >>>> doesn't >>>> seem to check the pickability of the image. Specifically, I mean the >>>> code in >>>> SetCurrentImageToNthImage(), which is called by StartWindowLevel(). >>>> >>>> - David >>>> >>>> On Tue, Apr 12, 2016 at 12:44 AM, Jothybasu Selvaraj < >>>> jothybasu at gmail.com> wrote: >>>> >>>>> Dear All >>>>> >>>>> I an image overlaid on another image. I only want mouse interaction >>>>> such as window level change on only one image. How do I do that? >>>>> >>>>> I tried pickable off,on the second image but it doesn't work. >>>>> >>>>> Any help is highly appreciated! >>>>> >>>>> >>>>> Regards >>>>> >>>>> Jothy >>>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From onlyjus at gmail.com Tue Apr 12 21:00:16 2016 From: onlyjus at gmail.com (Justin Weber) Date: Tue, 12 Apr 2016 21:00:16 -0400 Subject: [vtkusers] Is there an elegant way to switch event handling between VTK and Qt when using QVTKRenderWindowInteractor in Python? In-Reply-To: References: Message-ID: Whatever widget currently has the focus will get the events. You can manually set what widget has the focus by calling the setFocus() method of that widget. You can check if a widget has a focus by calling the hasFocus() method. You can look at the widget documentation for more event methods: http://doc.qt.io/qt-4.8/qwidget-members.html So what are you actually trying to do? Justin On Apr 12, 2016 8:02 PM, "Evan Kao" wrote: > Hello vtk-users, > > I'm playing around with QVTKRenderWindowInteractor and had a question > about handling events. Specifically is it possible to pick who is handling > the events between PyQt and VTK? > > For instance, say I have the following setup: > > class View(QMainWindow): > > def __init__(self, ...): > ... > self.vtkWidget = QVTKRenderWindowInteractor(...) > ... > > def keyPressEvent(self, e): > ... > > > At the start of the application, any key press event will be handled by > the keyPressEvent method. But once I click on the vtkWidget, all events > are handled by the vtkWidget's RenderWindowInteractor and there doesn't > seem like a convenient way to switch control back to the main window. At > least for me, clicking on other parts of the application window does not > return control to Qt. > > I have noticed that if I press a button, event handling is returned to > keyPressEvent, but it seems a little cumbersome to have to set up a dummy > button to switch between VTK and Qt. Is there a smarter way? > > Also, if it matters, I'm using PyQt 4.11.4, VTK 5.10.0, Python 2.7.11 on a > Windows 7 64-bit machine. > > Thanks, > Evan Kao > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.wormser at gmx.de Wed Apr 13 04:33:52 2016 From: max.wormser at gmx.de (mwormser) Date: Wed, 13 Apr 2016 01:33:52 -0700 (MST) Subject: [vtkusers] How to properly manage memory using Python and VTK In-Reply-To: <1459763947807-5737509.post@n5.nabble.com> References: <1459763947807-5737509.post@n5.nabble.com> Message-ID: <1460536432333-5737653.post@n5.nabble.com> I kind of figured out what the problem was. For any future readers who might face a similar problem: I was using VTK 6.2 since at the time there was not VTK for Python 3.4. When I saw there was VTK 7.0 for Python 3.4 I upgraded, debugged my code a little and since then my code runs *much* faster than before. For really large data I still run into RAM problems, though. But at least my program can produce roughly 50% larger files than before and runs faster at the same time. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-properly-manage-memory-using-Python-and-VTK-tp5737509p5737653.html Sent from the VTK - Users mailing list archive at Nabble.com. From ronaldvanduren at hotmail.com Wed Apr 13 06:54:56 2016 From: ronaldvanduren at hotmail.com (Ronald van Duren) Date: Wed, 13 Apr 2016 10:54:56 +0000 Subject: [vtkusers] Convert OpenCV Mat to vtkImageData Message-ID: Dear VTK Community, I'm trying to run several computer vision algorithms on a serie of video frames. But because these algorithms result in some very strange output I figured there might be something wrong with my video frames. So to check if the frames are correct I want to visualize them with VTK. VTK doesn't support the Mat type so I convert the Mat(the video frames) to vtkImageData, but vtkImageData is just shown as a white rectangle. I get the video frames by converting infrared frames to an openCV Mat type like this. openni::Grayscale16Pixel* imgBuf = (openni::Grayscale16Pixel*)irFrame.getData(); int w = irFrame.getWidth(); int h = irFrame.getHeight(); cv::Mat frameOne(h, w, CV_16U, imgBuf); frameOne.convertTo(frameOne, CV_8U); I then try to convert the Mat to vtkImageData like this. vtkSmartPointer convertMatToVtkImageData(const Mat &source) { vtkSmartPointer output = vtkSmartPointer::New(); vtkSmartPointer outInfo = vtkSmartPointer::New(); output->SetDimensions(source.cols, source.rows, 1); output->AllocateScalars(VTK_UNSIGNED_CHAR, source.channels()); unsigned char* dptr = reinterpret_cast(output->GetScalarPointer()); size_t elem_step = output->GetIncrements()[1]/sizeof(unsigned char); for (int y = 0; y < source.rows; ++y) { unsigned char* drow = dptr + elem_step * y; const unsigned char *srow = source.ptr(y); for (int x = 0; x < source.cols; ++x) drow[x] = *srow++; } output->Modified(); return output; } Is there something wrong with my code or am I trying to do something that is not possible? Some extra info: * I use Android and do most of the programming in C++ (NDK) * I make use of the Structure Sensor's IR sensor to get the video frames * I cannot use the vtkImageImporter -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Wed Apr 13 08:54:38 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Wed, 13 Apr 2016 14:54:38 +0200 Subject: [vtkusers] Artifacts in volume rendering In-Reply-To: References: Message-ID: 2016-04-12 16:16 GMT+02:00 Elvis Stansvik : > 2016-04-12 15:56 GMT+02:00 Elvis Stansvik : > >> Hi all, >> >> Following Berk Geveci's great blog post from 2014 on writing a custom >> HDF5 reader in Python [1], I tried to take his code and modify it to load >> HDF5 files where the densities are float32 and vary between 0 and 64. >> >> The only change I did to his reader was to modify RequestData to scale >> the loaded data and convert it to uint16, like this: >> >> data = (data * 1023).astype(uint16) >> >> (should get me roughly in the range 0-65535). >> >> I then generated a test HDF5 file containing a cylindrical volume like >> this: >> >> def create_cylinder_file(filename, height, radius): >> """Create a cylindrical volume and save it in test.hdf5. >> >> The densities are saved as float32 and will vary sinusoidically >> from 0 to 64 along the cylinder height. >> >> The result is saved in the "test" dataset in the output file. >> """ >> z_values = 32 + 32 * sin(linspace(0, 2*pi, height)) >> diameter = radius * 2 >> data = zeros(shape=(diameter, diameter, height), dtype=float32) >> >> for x in range(diameter): >> for y in range(diameter): >> if (x - radius)**2 + (y - radius)**2 <= radius**2: >> data[x, y, :] = z_values >> > > I made a quick test with densities uniformly random 0-64 instead (e.g. > data[x, y, :] = uniform(0, 64, height) above instead), with the attached > result. Notice how the artifacts are still present (they're particularly > visible from this angle). > > Perhaps it's obvious to someone more experienced in visualisation than I > am what is happening here? > Noone has seen these sort of artifacts before? I've tried blurring my synthetic data a little, as well as turning on shading again, but the artifacts are always there. I don't understand where these "stripes" are coming from, or why I'm seeing red voxels at all towards the denser parts of the cylinder. My color transfer function has no red at all in the range 40000-65535. Elvis > > Elvis > > >> >> # Write array to HDF5 file. >> with h5py.File(filename, 'w') as file_: >> data_set = file_.create_dataset( >> name='test', >> shape=data.shape, >> dtype=data.dtype, >> data=data >> ) >> >> I then test it all out using a vtkVolumeRayCastMapper based pipeline like >> this: >> >> reader = HDF5Source() >> reader.SetFileName('test.hdf5') >> >> rayCastFunction = vtk.vtkVolumeRayCastCompositeFunction() >> >> mapper = vtk.vtkVolumeRayCastMapper() >> mapper.SetVolumeRayCastFunction(rayCastFunction) >> mapper.SetInputConnection(reader.GetOutputPort()) >> >> colorTransferFunction = vtk.vtkColorTransferFunction() >> colorTransferFunction.AddRGBPoint(0, 0, 0, 0) # Black >> colorTransferFunction.AddRGBPoint(20000, 1, 0, 0) # Red >> colorTransferFunction.AddRGBPoint(40000, 0, 1, 0) # Green >> colorTransferFunction.AddRGBPoint(65535, 0, 0, 1) # Blue >> >> opacityTransferFunction = vtk.vtkPiecewiseFunction() >> opacityTransferFunction.AddPoint(0, 0) # Transparent >> opacityTransferFunction.AddPoint(65535, 1) # Opaque >> >> volumeProperty = vtk.vtkVolumeProperty() >> volumeProperty.SetColor(colorTransferFunction) >> volumeProperty.SetScalarOpacity(opacityTransferFunction) >> volumeProperty.ShadeOff() >> volumeProperty.SetInterpolationTypeToLinear() >> >> volume = vtk.vtkVolume() >> volume.SetMapper(mapper) >> volume.SetProperty(volumeProperty) >> >> renderer = vtk.vtkRenderer() >> renderer.AddVolume(volume) >> renderer.SetBackground(.85, .84, .83) >> >> renderWindow = vtk.vtkRenderWindow() >> renderWindow.AddRenderer(renderer) >> renderWindow.SetSize(600, 600) >> >> interactor = vtk.vtkRenderWindowInteractor() >> interactor.SetRenderWindow(renderWindow) >> interactor.Initialize() >> >> renderWindow.Render() >> interactor.Start() >> >> I'm attaching a main.py which contains the full code, including the >> HDFSource reader with my slight modification, and a screenshot showing the >> result. >> >> Noticy how there's some strange artifacts in the denser (greener, bluer) >> parts of the cylinder. Anyone know where these artifacts may come from? >> It's entirely possible that it has nothing to with the custom reader, but >> something with my pipeline..? >> >> Very grateful for any ideas! >> >> Cheers, >> Elvis >> >> [1] >> https://blog.kitware.com/developing-hdf5-readers-using-vtkpythonalgorithm/ >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Wed Apr 13 09:00:51 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Wed, 13 Apr 2016 15:00:51 +0200 Subject: [vtkusers] Where is the format of UPDATE_EXTENT / WHOLE_EXTENT documented? Message-ID: Hi all, This is a very basic question, but I've searched through a lot of VTK docs without finding anything conclusive: Where is the format for the UPDATE_EXTENT / WHOLE_EXTENT pipeline information keys documented? >From looking at various examples, I understand that the extents are an array of 6 doubles, but in which order do the boundaries come in the array? [x0, x1, y0, y1, z0, z1], or [z0, z1, y0, y1, x0, x1], or something else? Where in general can I expect to find docs for commonly used information keys like this? Thanks in advance, Elvis -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.chen at gmail.com Wed Apr 13 09:42:07 2016 From: elvis.chen at gmail.com (Elvis Chen) Date: Wed, 13 Apr 2016 09:42:07 -0400 Subject: [vtkusers] Opinion needed: extending vtkLandmarkTransform class Message-ID: hi all, I have an algorithm that solves Orthogonal Procrustes Analysis (i.e. vtkLandmarkTransform) with anisotropic scales. That is, given two sets of homologous points, X, and Y, my algorithm solves the following registration problem: Y = R S X + t where R is 3x3 orthonomal rotation, t the translation, and S = diag(Sx,Sy,Sz) where the scales are anisotropic. It is the generalization of the similarity mode (isotropic scale) in vtkLandmarktransform. I have further extended/incorporated it into an ICP framework. The publication can be found at http://link.springer.com/article/10.1007/s11548-015-1199-9, and an initial implementation (C++/Matlab) can be found at https://github.com/chene77/RobartsICP I would like to implement them as vtk classes and would appreciate any help and tips. I am a typical vtk USER and not necessarily a developer; I am sure I can and need to learn quite a bit. To start, I am thinking of subclassing vtkLandmarkTransform. I would appreciate any opinion/suggestions as on: - is this the best place to start, and - any coding guideline/documentation, Thank you, -- Elvis Chen Robarts Research Institute -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Wed Apr 13 09:52:21 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 13 Apr 2016 09:52:21 -0400 Subject: [vtkusers] Artifacts in volume rendering In-Reply-To: References: Message-ID: Hi Elvis, volume rendering is known to have some artifacts from certain angles. It is data-dependent, and sometimes the artifacts are more pronounced. This is due to many trade-offs between rendering speed and quality. I sometimes encounter them too, with volume-rendered medical data. Regards, D?enan On Wed, Apr 13, 2016 at 8:54 AM, Elvis Stansvik < elvis.stansvik at orexplore.com> wrote: > 2016-04-12 16:16 GMT+02:00 Elvis Stansvik : > >> 2016-04-12 15:56 GMT+02:00 Elvis Stansvik : >> >>> Hi all, >>> >>> Following Berk Geveci's great blog post from 2014 on writing a custom >>> HDF5 reader in Python [1], I tried to take his code and modify it to load >>> HDF5 files where the densities are float32 and vary between 0 and 64. >>> >>> The only change I did to his reader was to modify RequestData to scale >>> the loaded data and convert it to uint16, like this: >>> >>> data = (data * 1023).astype(uint16) >>> >>> (should get me roughly in the range 0-65535). >>> >>> I then generated a test HDF5 file containing a cylindrical volume like >>> this: >>> >>> def create_cylinder_file(filename, height, radius): >>> """Create a cylindrical volume and save it in test.hdf5. >>> >>> The densities are saved as float32 and will vary sinusoidically >>> from 0 to 64 along the cylinder height. >>> >>> The result is saved in the "test" dataset in the output file. >>> """ >>> z_values = 32 + 32 * sin(linspace(0, 2*pi, height)) >>> diameter = radius * 2 >>> data = zeros(shape=(diameter, diameter, height), dtype=float32) >>> >>> for x in range(diameter): >>> for y in range(diameter): >>> if (x - radius)**2 + (y - radius)**2 <= radius**2: >>> data[x, y, :] = z_values >>> >> >> I made a quick test with densities uniformly random 0-64 instead (e.g. >> data[x, y, :] = uniform(0, 64, height) above instead), with the attached >> result. Notice how the artifacts are still present (they're particularly >> visible from this angle). >> >> Perhaps it's obvious to someone more experienced in visualisation than I >> am what is happening here? >> > > Noone has seen these sort of artifacts before? > > I've tried blurring my synthetic data a little, as well as turning on > shading again, but the artifacts are always there. > > I don't understand where these "stripes" are coming from, or why I'm > seeing red voxels at all towards the denser parts of the cylinder. My color > transfer function has no red at all in the range 40000-65535. > > Elvis > > >> >> Elvis >> >> >>> >>> # Write array to HDF5 file. >>> with h5py.File(filename, 'w') as file_: >>> data_set = file_.create_dataset( >>> name='test', >>> shape=data.shape, >>> dtype=data.dtype, >>> data=data >>> ) >>> >>> I then test it all out using a vtkVolumeRayCastMapper based pipeline >>> like this: >>> >>> reader = HDF5Source() >>> reader.SetFileName('test.hdf5') >>> >>> rayCastFunction = vtk.vtkVolumeRayCastCompositeFunction() >>> >>> mapper = vtk.vtkVolumeRayCastMapper() >>> mapper.SetVolumeRayCastFunction(rayCastFunction) >>> mapper.SetInputConnection(reader.GetOutputPort()) >>> >>> colorTransferFunction = vtk.vtkColorTransferFunction() >>> colorTransferFunction.AddRGBPoint(0, 0, 0, 0) # Black >>> colorTransferFunction.AddRGBPoint(20000, 1, 0, 0) # Red >>> colorTransferFunction.AddRGBPoint(40000, 0, 1, 0) # Green >>> colorTransferFunction.AddRGBPoint(65535, 0, 0, 1) # Blue >>> >>> opacityTransferFunction = vtk.vtkPiecewiseFunction() >>> opacityTransferFunction.AddPoint(0, 0) # Transparent >>> opacityTransferFunction.AddPoint(65535, 1) # Opaque >>> >>> volumeProperty = vtk.vtkVolumeProperty() >>> volumeProperty.SetColor(colorTransferFunction) >>> volumeProperty.SetScalarOpacity(opacityTransferFunction) >>> volumeProperty.ShadeOff() >>> volumeProperty.SetInterpolationTypeToLinear() >>> >>> volume = vtk.vtkVolume() >>> volume.SetMapper(mapper) >>> volume.SetProperty(volumeProperty) >>> >>> renderer = vtk.vtkRenderer() >>> renderer.AddVolume(volume) >>> renderer.SetBackground(.85, .84, .83) >>> >>> renderWindow = vtk.vtkRenderWindow() >>> renderWindow.AddRenderer(renderer) >>> renderWindow.SetSize(600, 600) >>> >>> interactor = vtk.vtkRenderWindowInteractor() >>> interactor.SetRenderWindow(renderWindow) >>> interactor.Initialize() >>> >>> renderWindow.Render() >>> interactor.Start() >>> >>> I'm attaching a main.py which contains the full code, including the >>> HDFSource reader with my slight modification, and a screenshot showing the >>> result. >>> >>> Noticy how there's some strange artifacts in the denser (greener, bluer) >>> parts of the cylinder. Anyone know where these artifacts may come from? >>> It's entirely possible that it has nothing to with the custom reader, but >>> something with my pipeline..? >>> >>> Very grateful for any ideas! >>> >>> Cheers, >>> Elvis >>> >>> [1] >>> https://blog.kitware.com/developing-hdf5-readers-using-vtkpythonalgorithm/ >>> >> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Wed Apr 13 09:54:47 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Wed, 13 Apr 2016 09:54:47 -0400 Subject: [vtkusers] Artifacts in volume rendering In-Reply-To: References: Message-ID: Hi Elvis, Can you post your images somewhere (I couldn't find them in the email)? Thanks, On Wed, Apr 13, 2016 at 9:52 AM, D?enan Zuki? wrote: > Hi Elvis, > > volume rendering is known to have some artifacts from certain angles. It > is data-dependent, and sometimes the artifacts are more pronounced. This is > due to many trade-offs between rendering speed and quality. I sometimes > encounter them too, with volume-rendered medical data. > > Regards, > D?enan > > On Wed, Apr 13, 2016 at 8:54 AM, Elvis Stansvik < > elvis.stansvik at orexplore.com> wrote: > >> 2016-04-12 16:16 GMT+02:00 Elvis Stansvik : >> >>> 2016-04-12 15:56 GMT+02:00 Elvis Stansvik >>> : >>> >>>> Hi all, >>>> >>>> Following Berk Geveci's great blog post from 2014 on writing a custom >>>> HDF5 reader in Python [1], I tried to take his code and modify it to load >>>> HDF5 files where the densities are float32 and vary between 0 and 64. >>>> >>>> The only change I did to his reader was to modify RequestData to scale >>>> the loaded data and convert it to uint16, like this: >>>> >>>> data = (data * 1023).astype(uint16) >>>> >>>> (should get me roughly in the range 0-65535). >>>> >>>> I then generated a test HDF5 file containing a cylindrical volume like >>>> this: >>>> >>>> def create_cylinder_file(filename, height, radius): >>>> """Create a cylindrical volume and save it in test.hdf5. >>>> >>>> The densities are saved as float32 and will vary sinusoidically >>>> from 0 to 64 along the cylinder height. >>>> >>>> The result is saved in the "test" dataset in the output file. >>>> """ >>>> z_values = 32 + 32 * sin(linspace(0, 2*pi, height)) >>>> diameter = radius * 2 >>>> data = zeros(shape=(diameter, diameter, height), dtype=float32) >>>> >>>> for x in range(diameter): >>>> for y in range(diameter): >>>> if (x - radius)**2 + (y - radius)**2 <= radius**2: >>>> data[x, y, :] = z_values >>>> >>> >>> I made a quick test with densities uniformly random 0-64 instead (e.g. >>> data[x, y, :] = uniform(0, 64, height) above instead), with the attached >>> result. Notice how the artifacts are still present (they're particularly >>> visible from this angle). >>> >>> Perhaps it's obvious to someone more experienced in visualisation than I >>> am what is happening here? >>> >> >> Noone has seen these sort of artifacts before? >> >> I've tried blurring my synthetic data a little, as well as turning on >> shading again, but the artifacts are always there. >> >> I don't understand where these "stripes" are coming from, or why I'm >> seeing red voxels at all towards the denser parts of the cylinder. My color >> transfer function has no red at all in the range 40000-65535. >> >> Elvis >> >> >>> >>> Elvis >>> >>> >>>> >>>> # Write array to HDF5 file. >>>> with h5py.File(filename, 'w') as file_: >>>> data_set = file_.create_dataset( >>>> name='test', >>>> shape=data.shape, >>>> dtype=data.dtype, >>>> data=data >>>> ) >>>> >>>> I then test it all out using a vtkVolumeRayCastMapper based pipeline >>>> like this: >>>> >>>> reader = HDF5Source() >>>> reader.SetFileName('test.hdf5') >>>> >>>> rayCastFunction = vtk.vtkVolumeRayCastCompositeFunction() >>>> >>>> mapper = vtk.vtkVolumeRayCastMapper() >>>> mapper.SetVolumeRayCastFunction(rayCastFunction) >>>> mapper.SetInputConnection(reader.GetOutputPort()) >>>> >>>> colorTransferFunction = vtk.vtkColorTransferFunction() >>>> colorTransferFunction.AddRGBPoint(0, 0, 0, 0) # Black >>>> colorTransferFunction.AddRGBPoint(20000, 1, 0, 0) # Red >>>> colorTransferFunction.AddRGBPoint(40000, 0, 1, 0) # Green >>>> colorTransferFunction.AddRGBPoint(65535, 0, 0, 1) # Blue >>>> >>>> opacityTransferFunction = vtk.vtkPiecewiseFunction() >>>> opacityTransferFunction.AddPoint(0, 0) # Transparent >>>> opacityTransferFunction.AddPoint(65535, 1) # Opaque >>>> >>>> volumeProperty = vtk.vtkVolumeProperty() >>>> volumeProperty.SetColor(colorTransferFunction) >>>> volumeProperty.SetScalarOpacity(opacityTransferFunction) >>>> volumeProperty.ShadeOff() >>>> volumeProperty.SetInterpolationTypeToLinear() >>>> >>>> volume = vtk.vtkVolume() >>>> volume.SetMapper(mapper) >>>> volume.SetProperty(volumeProperty) >>>> >>>> renderer = vtk.vtkRenderer() >>>> renderer.AddVolume(volume) >>>> renderer.SetBackground(.85, .84, .83) >>>> >>>> renderWindow = vtk.vtkRenderWindow() >>>> renderWindow.AddRenderer(renderer) >>>> renderWindow.SetSize(600, 600) >>>> >>>> interactor = vtk.vtkRenderWindowInteractor() >>>> interactor.SetRenderWindow(renderWindow) >>>> interactor.Initialize() >>>> >>>> renderWindow.Render() >>>> interactor.Start() >>>> >>>> I'm attaching a main.py which contains the full code, including the >>>> HDFSource reader with my slight modification, and a screenshot showing the >>>> result. >>>> >>>> Noticy how there's some strange artifacts in the denser (greener, >>>> bluer) parts of the cylinder. Anyone know where these artifacts may come >>>> from? It's entirely possible that it has nothing to with the custom reader, >>>> but something with my pipeline..? >>>> >>>> Very grateful for any ideas! >>>> >>>> Cheers, >>>> Elvis >>>> >>>> [1] >>>> https://blog.kitware.com/developing-hdf5-readers-using-vtkpythonalgorithm/ >>>> >>> >>> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Wed Apr 13 09:56:09 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 13 Apr 2016 09:56:09 -0400 Subject: [vtkusers] Artifacts in volume rendering In-Reply-To: References: Message-ID: Here it is. On Wed, Apr 13, 2016 at 9:54 AM, Aashish Chaudhary < aashish.chaudhary at kitware.com> wrote: > Hi Elvis, > > Can you post your images somewhere (I couldn't find them in the email)? > > Thanks, > > > On Wed, Apr 13, 2016 at 9:52 AM, D?enan Zuki? wrote: > >> Hi Elvis, >> >> volume rendering is known to have some artifacts from certain angles. It >> is data-dependent, and sometimes the artifacts are more pronounced. This is >> due to many trade-offs between rendering speed and quality. I sometimes >> encounter them too, with volume-rendered medical data. >> >> Regards, >> D?enan >> >> On Wed, Apr 13, 2016 at 8:54 AM, Elvis Stansvik < >> elvis.stansvik at orexplore.com> wrote: >> >>> 2016-04-12 16:16 GMT+02:00 Elvis Stansvik >>> : >>> >>>> 2016-04-12 15:56 GMT+02:00 Elvis Stansvik >>> >: >>>> >>>>> Hi all, >>>>> >>>>> Following Berk Geveci's great blog post from 2014 on writing a custom >>>>> HDF5 reader in Python [1], I tried to take his code and modify it to load >>>>> HDF5 files where the densities are float32 and vary between 0 and 64. >>>>> >>>>> The only change I did to his reader was to modify RequestData to scale >>>>> the loaded data and convert it to uint16, like this: >>>>> >>>>> data = (data * 1023).astype(uint16) >>>>> >>>>> (should get me roughly in the range 0-65535). >>>>> >>>>> I then generated a test HDF5 file containing a cylindrical volume like >>>>> this: >>>>> >>>>> def create_cylinder_file(filename, height, radius): >>>>> """Create a cylindrical volume and save it in test.hdf5. >>>>> >>>>> The densities are saved as float32 and will vary sinusoidically >>>>> from 0 to 64 along the cylinder height. >>>>> >>>>> The result is saved in the "test" dataset in the output file. >>>>> """ >>>>> z_values = 32 + 32 * sin(linspace(0, 2*pi, height)) >>>>> diameter = radius * 2 >>>>> data = zeros(shape=(diameter, diameter, height), dtype=float32) >>>>> >>>>> for x in range(diameter): >>>>> for y in range(diameter): >>>>> if (x - radius)**2 + (y - radius)**2 <= radius**2: >>>>> data[x, y, :] = z_values >>>>> >>>> >>>> I made a quick test with densities uniformly random 0-64 instead (e.g. >>>> data[x, y, :] = uniform(0, 64, height) above instead), with the attached >>>> result. Notice how the artifacts are still present (they're particularly >>>> visible from this angle). >>>> >>>> Perhaps it's obvious to someone more experienced in visualisation than >>>> I am what is happening here? >>>> >>> >>> Noone has seen these sort of artifacts before? >>> >>> I've tried blurring my synthetic data a little, as well as turning on >>> shading again, but the artifacts are always there. >>> >>> I don't understand where these "stripes" are coming from, or why I'm >>> seeing red voxels at all towards the denser parts of the cylinder. My color >>> transfer function has no red at all in the range 40000-65535. >>> >>> Elvis >>> >>> >>>> >>>> Elvis >>>> >>>> >>>>> >>>>> # Write array to HDF5 file. >>>>> with h5py.File(filename, 'w') as file_: >>>>> data_set = file_.create_dataset( >>>>> name='test', >>>>> shape=data.shape, >>>>> dtype=data.dtype, >>>>> data=data >>>>> ) >>>>> >>>>> I then test it all out using a vtkVolumeRayCastMapper based pipeline >>>>> like this: >>>>> >>>>> reader = HDF5Source() >>>>> reader.SetFileName('test.hdf5') >>>>> >>>>> rayCastFunction = vtk.vtkVolumeRayCastCompositeFunction() >>>>> >>>>> mapper = vtk.vtkVolumeRayCastMapper() >>>>> mapper.SetVolumeRayCastFunction(rayCastFunction) >>>>> mapper.SetInputConnection(reader.GetOutputPort()) >>>>> >>>>> colorTransferFunction = vtk.vtkColorTransferFunction() >>>>> colorTransferFunction.AddRGBPoint(0, 0, 0, 0) # Black >>>>> colorTransferFunction.AddRGBPoint(20000, 1, 0, 0) # Red >>>>> colorTransferFunction.AddRGBPoint(40000, 0, 1, 0) # Green >>>>> colorTransferFunction.AddRGBPoint(65535, 0, 0, 1) # Blue >>>>> >>>>> opacityTransferFunction = vtk.vtkPiecewiseFunction() >>>>> opacityTransferFunction.AddPoint(0, 0) # Transparent >>>>> opacityTransferFunction.AddPoint(65535, 1) # Opaque >>>>> >>>>> volumeProperty = vtk.vtkVolumeProperty() >>>>> volumeProperty.SetColor(colorTransferFunction) >>>>> volumeProperty.SetScalarOpacity(opacityTransferFunction) >>>>> volumeProperty.ShadeOff() >>>>> volumeProperty.SetInterpolationTypeToLinear() >>>>> >>>>> volume = vtk.vtkVolume() >>>>> volume.SetMapper(mapper) >>>>> volume.SetProperty(volumeProperty) >>>>> >>>>> renderer = vtk.vtkRenderer() >>>>> renderer.AddVolume(volume) >>>>> renderer.SetBackground(.85, .84, .83) >>>>> >>>>> renderWindow = vtk.vtkRenderWindow() >>>>> renderWindow.AddRenderer(renderer) >>>>> renderWindow.SetSize(600, 600) >>>>> >>>>> interactor = vtk.vtkRenderWindowInteractor() >>>>> interactor.SetRenderWindow(renderWindow) >>>>> interactor.Initialize() >>>>> >>>>> renderWindow.Render() >>>>> interactor.Start() >>>>> >>>>> I'm attaching a main.py which contains the full code, including the >>>>> HDFSource reader with my slight modification, and a screenshot showing the >>>>> result. >>>>> >>>>> Noticy how there's some strange artifacts in the denser (greener, >>>>> bluer) parts of the cylinder. Anyone know where these artifacts may come >>>>> from? It's entirely possible that it has nothing to with the custom reader, >>>>> but something with my pipeline..? >>>>> >>>>> Very grateful for any ideas! >>>>> >>>>> Cheers, >>>>> Elvis >>>>> >>>>> [1] >>>>> https://blog.kitware.com/developing-hdf5-readers-using-vtkpythonalgorithm/ >>>>> >>>> >>>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: artifacts_uniform.png Type: image/png Size: 106541 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: artifacts.png Type: image/png Size: 62129 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: main.py Type: application/octet-stream Size: 4269 bytes Desc: not available URL: From cory.quammen at kitware.com Wed Apr 13 09:58:36 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 13 Apr 2016 09:58:36 -0400 Subject: [vtkusers] Convert OpenCV Mat to vtkImageData In-Reply-To: References: Message-ID: Hi Ronald, That looks reasonable. Perhaps the problem is in the image display code. Maybe you could save the vtkImageData to a .vti file with vtkXMLImageDataWriter and view it in ParaView to see if the image looks reasonable. If it does, then the problem lies in the display code. Thanks, Cory On Wed, Apr 13, 2016 at 6:54 AM, Ronald van Duren wrote: > Dear VTK Community, > > > I'm trying to run several computer vision algorithms on a serie of video > frames. But because these algorithms result in some very strange output I > figured there might be something wrong with my video frames. So to check if > the frames are correct I want to visualize them with VTK. VTK doesn't > support the Mat type so I convert the Mat(the video frames) to vtkImageData, > but vtkImageData is just shown as a white rectangle. > > I get the video frames by converting infrared frames to an openCV Mat type > like this. > > openni::Grayscale16Pixel* imgBuf = > (openni::Grayscale16Pixel*)irFrame.getData(); > > int w = irFrame.getWidth(); > int h = irFrame.getHeight(); > cv::Mat frameOne(h, w, CV_16U, imgBuf); > frameOne.convertTo(frameOne, CV_8U); > > I then try to convert the Mat to vtkImageData like this. > > vtkSmartPointer convertMatToVtkImageData(const Mat &source) > { > vtkSmartPointer output = > vtkSmartPointer::New(); > vtkSmartPointer outInfo = > vtkSmartPointer::New(); > > output->SetDimensions(source.cols, source.rows, 1); > output->AllocateScalars(VTK_UNSIGNED_CHAR, source.channels()); > > unsigned char* dptr = reinterpret_cast char*>(output->GetScalarPointer()); > size_t elem_step = output->GetIncrements()[1]/sizeof(unsigned char); > > for (int y = 0; y < source.rows; ++y) > { > unsigned char* drow = dptr + elem_step * y; > const unsigned char *srow = source.ptr(y); > for (int x = 0; x < source.cols; ++x) > drow[x] = *srow++; > } > > output->Modified(); > return output; > } > > Is there something wrong with my code or am I trying to do something that is > not possible? > > Some extra info: > > I use Android and do most of the programming in C++ (NDK) > I make use of the Structure Sensor's IR sensor to get the video frames > I cannot use the vtkImageImporter > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen R&D Engineer Kitware, Inc. From cory.quammen at kitware.com Wed Apr 13 10:06:25 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 13 Apr 2016 10:06:25 -0400 Subject: [vtkusers] Where is the format of UPDATE_EXTENT / WHOLE_EXTENT documented? In-Reply-To: References: Message-ID: On Wed, Apr 13, 2016 at 9:00 AM, Elvis Stansvik wrote: > Hi all, > > This is a very basic question, but I've searched through a lot of VTK docs > without finding anything conclusive: Where is the format for the > UPDATE_EXTENT / WHOLE_EXTENT pipeline information keys documented? > > From looking at various examples, I understand that the extents are an array > of 6 doubles, but in which order do the boundaries come in the array? [x0, > x1, y0, y1, z0, z1], or [z0, z1, y0, y1, x0, x1], or something else? The first one. Note also that x1, y1, and z1 are the maximum valid index in the extent, not the size. > Where in general can I expect to find docs for commonly used information > keys like this? Perhaps this page will help: http://www.vtk.org/doc/nightly/html/group__InformationKeys.html -- Cory Quammen R&D Engineer Kitware, Inc. From ultam93 at yahoo.com Wed Apr 13 13:27:04 2016 From: ultam93 at yahoo.com (c_mihai) Date: Wed, 13 Apr 2016 10:27:04 -0700 (MST) Subject: [vtkusers] Trouble with vtkbooleanOperationPolydataFilter Message-ID: <1460568424147-5737667.post@n5.nabble.com> Has anyone figured out how to get this class to work constantly? I'm trying to use it to perform substractions/carvings. It seems to work when using simple figures, like a moon or a cylinder. But it fails for me when using text(I vtkVectorText, then I vtkLinearExtrusionFilter and finally use vtkTriangleFilter to obtain the 3D text) or a bar code. Screenshots for a failed to work example: 1) (Before)Model to be substracted/carved on: http://puu.sh/ogToi/66d8f78576.jpg http://puu.sh/ogTPZ/4189e38286.jpg 2) (After): a) for the bar code http://puu.sh/ogSVE/d8000da4d2.jpg http://puu.sh/ogSZB/5e9531fdb9.jpg b) for the text(created the way I explained above) http://puu.sh/ogU2p/43cad5fe16.jpg -- View this message in context: http://vtk.1045678.n5.nabble.com/Trouble-with-vtkbooleanOperationPolydataFilter-tp5737667.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Wed Apr 13 19:08:10 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 13 Apr 2016 17:08:10 -0600 Subject: [vtkusers] Disable mouse interaction on overlaid image In-Reply-To: References: Message-ID: Hi Jothy, I've added a change so that SetCurrentImageToNthImage is public: https://gitlab.kitware.com/vtk/vtk/merge_requests/1421/diffs If you're not sure about how to get the changes with git, then you can download the files here: https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.h https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.cxx Please test to see if this solves the issue. - David On Tue, Apr 12, 2016 at 6:18 PM, Jothybasu Selvaraj wrote: > I would rather like to have this SetCurrentImageToNthImage to be public > and user definable. > > > Jothy > > On Wed, Apr 13, 2016 at 10:15 AM, Jothybasu Selvaraj > wrote: > >> Hi David >> >> I am not familiar with using Gitlab. So, I subclassed >> vtkInteractorStyleImage and override SetCurrentImageToNthImage(). >> >> Still it didn't work, because the layer number is hardcoded into StartWindowLevel() >> with this->SetCurrentImageToNthImage(-1); So the mouse only interacts with >> the last image. I changed it to "0" so that it pick the first image. >> >> It solves my problem. I only want to interact with the first image :). >> >> >> Thank a lot for your inputs. >> >> >> Cheers >> >> Jothy >> >> On Wed, Apr 13, 2016 at 8:42 AM, David Gobbi >> wrote: >> >>> Hi Jothy, >>> >>> Can you try the code change in the following merge request to >>> see if it fixes the problem? >>> >>> https://gitlab.kitware.com/vtk/vtk/merge_requests/1421 >>> >>> - David >>> >>> >>> On Tue, Apr 12, 2016 at 4:05 PM, Jothybasu Selvaraj >> > wrote: >>> >>>> Yes, I use vtkInteractorStyleImage. >>>> >>>> Cheers >>>> >>>> Jothy >>>> >>>> On Tue, Apr 12, 2016 at 10:16 PM, David Gobbi >>>> wrote: >>>> >>>>> Hi Jothy, >>>>> >>>>> Are you using vtkInteractionStyleImage? I checked the code, and it >>>>> doesn't >>>>> seem to check the pickability of the image. Specifically, I mean the >>>>> code in >>>>> SetCurrentImageToNthImage(), which is called by StartWindowLevel(). >>>>> >>>>> - David >>>>> >>>>> On Tue, Apr 12, 2016 at 12:44 AM, Jothybasu Selvaraj < >>>>> jothybasu at gmail.com> wrote: >>>>> >>>>>> Dear All >>>>>> >>>>>> I an image overlaid on another image. I only want mouse interaction >>>>>> such as window level change on only one image. How do I do that? >>>>>> >>>>>> I tried pickable off,on the second image but it doesn't work. >>>>>> >>>>>> Any help is highly appreciated! >>>>>> >>>>>> >>>>>> Regards >>>>>> >>>>>> Jothy >>>>>> >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Apr 13 19:26:53 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 13 Apr 2016 17:26:53 -0600 Subject: [vtkusers] Opinion needed: extending vtkLandmarkTransform class In-Reply-To: References: Message-ID: Hi Elvis, The official "starting point" is probably the wiki: http://www.vtk.org/Wiki/VTK There's also a mailing list where all the developers hang out: http://www.vtk.org/mailman/listinfo/vtk-developers Regarding the anisotropic scaling, that could go directly into vtkLandmarkTransform alongside the current RigidBody, Similarity, and Affine settings. By the way, I've been meaning for ages to fix the "Affine" code... it is implemented with a matrix inversion and it fails for certain landmark configurations. It should be using a generalized inverse of some kind to make it more robust. Cheers, - David On Wed, Apr 13, 2016 at 7:42 AM, Elvis Chen wrote: > hi all, > > I have an algorithm that solves Orthogonal Procrustes Analysis (i.e. > vtkLandmarkTransform) with anisotropic scales. That is, given two sets of > homologous points, X, and Y, my algorithm solves the following registration > problem: > > Y = R S X + t > > where R is 3x3 orthonomal rotation, t the translation, and S = > diag(Sx,Sy,Sz) where the scales are anisotropic. It is the generalization > of the similarity mode (isotropic scale) in vtkLandmarktransform. > > I have further extended/incorporated it into an ICP framework. The > publication can be found at > http://link.springer.com/article/10.1007/s11548-015-1199-9, and an > initial implementation (C++/Matlab) can be found at > https://github.com/chene77/RobartsICP > > I would like to implement them as vtk classes and would appreciate any > help and tips. I am a typical vtk USER and not necessarily a developer; I > am sure I can and need to learn quite a bit. > > To start, I am thinking of subclassing vtkLandmarkTransform. I would > appreciate any opinion/suggestions as on: > > - is this the best place to start, and > - any coding guideline/documentation, > > Thank you, > > -- > Elvis Chen > Robarts Research Institute > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Wed Apr 13 19:53:02 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Thu, 14 Apr 2016 09:53:02 +1000 Subject: [vtkusers] Disable mouse interaction on overlaid image In-Reply-To: References: Message-ID: Great! Thanks very much! Jothy On Thu, Apr 14, 2016 at 9:08 AM, David Gobbi wrote: > Hi Jothy, > > I've added a change so that SetCurrentImageToNthImage is public: > https://gitlab.kitware.com/vtk/vtk/merge_requests/1421/diffs > > If you're not sure about how to get the changes with git, then you can > download the files here: > > https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.h > > https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.cxx > > Please test to see if this solves the issue. > > - David > > > > > On Tue, Apr 12, 2016 at 6:18 PM, Jothybasu Selvaraj > wrote: > >> I would rather like to have this SetCurrentImageToNthImage to be public >> and user definable. >> >> >> Jothy >> >> On Wed, Apr 13, 2016 at 10:15 AM, Jothybasu Selvaraj > > wrote: >> >>> Hi David >>> >>> I am not familiar with using Gitlab. So, I subclassed >>> vtkInteractorStyleImage and override SetCurrentImageToNthImage(). >>> >>> Still it didn't work, because the layer number is hardcoded into StartWindowLevel() >>> with this->SetCurrentImageToNthImage(-1); So the mouse only interacts with >>> the last image. I changed it to "0" so that it pick the first image. >>> >>> It solves my problem. I only want to interact with the first image :). >>> >>> >>> Thank a lot for your inputs. >>> >>> >>> Cheers >>> >>> Jothy >>> >>> On Wed, Apr 13, 2016 at 8:42 AM, David Gobbi >>> wrote: >>> >>>> Hi Jothy, >>>> >>>> Can you try the code change in the following merge request to >>>> see if it fixes the problem? >>>> >>>> https://gitlab.kitware.com/vtk/vtk/merge_requests/1421 >>>> >>>> - David >>>> >>>> >>>> On Tue, Apr 12, 2016 at 4:05 PM, Jothybasu Selvaraj < >>>> jothybasu at gmail.com> wrote: >>>> >>>>> Yes, I use vtkInteractorStyleImage. >>>>> >>>>> Cheers >>>>> >>>>> Jothy >>>>> >>>>> On Tue, Apr 12, 2016 at 10:16 PM, David Gobbi >>>>> wrote: >>>>> >>>>>> Hi Jothy, >>>>>> >>>>>> Are you using vtkInteractionStyleImage? I checked the code, and it >>>>>> doesn't >>>>>> seem to check the pickability of the image. Specifically, I mean the >>>>>> code in >>>>>> SetCurrentImageToNthImage(), which is called by StartWindowLevel(). >>>>>> >>>>>> - David >>>>>> >>>>>> On Tue, Apr 12, 2016 at 12:44 AM, Jothybasu Selvaraj < >>>>>> jothybasu at gmail.com> wrote: >>>>>> >>>>>>> Dear All >>>>>>> >>>>>>> I an image overlaid on another image. I only want mouse interaction >>>>>>> such as window level change on only one image. How do I do that? >>>>>>> >>>>>>> I tried pickable off,on the second image but it doesn't work. >>>>>>> >>>>>>> Any help is highly appreciated! >>>>>>> >>>>>>> >>>>>>> Regards >>>>>>> >>>>>>> Jothy >>>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.v.ankudinov at mail.ru Thu Apr 14 05:04:46 2016 From: i.v.ankudinov at mail.ru (IlinkaGrap) Date: Thu, 14 Apr 2016 02:04:46 -0700 (MST) Subject: [vtkusers] Powercrust weird behaviour. Message-ID: <1460624686011-5737680.post@n5.nabble.com> Hi! Recently I have been playing with this (http://www.sq3.org.uk/powercrust/) Powercrust port to VTK and spotted this weird behaviour, that occurs on every single model that you try to reconstruct. Let me explain this with the case of Stanford Bunny resolution2 surface reconstruction. When I reconstruct the Stanford Bunny 3D model(res2) from the ply file which has 8171 points I get the mesh with 32049! polygons and 46631! vertices. As far as I understand what Powercrust does is just joining the points of the originial cloud in the topologically-correct way. The questions that bothers me is, why do we have 46k number of vertices instead of 8k. I have to mention that I checked the cloud for duplicates sorting the std::vector and using std::unique and there were none. I would also like to add that I face this behaviour with any model I try to reconstruct using Powercrust. I would be very grateful if anyone could provide some information on this case. Best regards, Ilia -- View this message in context: http://vtk.1045678.n5.nabble.com/Powercrust-weird-behaviour-tp5737680.html Sent from the VTK - Users mailing list archive at Nabble.com. From tim.hutton at gmail.com Thu Apr 14 06:55:45 2016 From: tim.hutton at gmail.com (Tim Hutton) Date: Thu, 14 Apr 2016 11:55:45 +0100 Subject: [vtkusers] Powercrust weird behaviour. In-Reply-To: <1460624686011-5737680.post@n5.nabble.com> References: <1460624686011-5737680.post@n5.nabble.com> Message-ID: Hi Ilia, It is expected behavior that the powercrust algorithm adds points. You can decimate the mesh afterwards if desired. Tim On 14 April 2016 at 10:04, IlinkaGrap wrote: > Hi! Recently I have been playing with this > (http://www.sq3.org.uk/powercrust/) Powercrust port to VTK and spotted > this > weird behaviour, that occurs on every single model that you try to > reconstruct. > > Let me explain this with the case of Stanford Bunny resolution2 surface > reconstruction. > > When I reconstruct the Stanford Bunny 3D model(res2) from the ply file > which > has 8171 points I get the mesh with 32049! polygons and 46631! vertices. As > far as I understand what Powercrust does is just joining the points of the > originial cloud in the topologically-correct way. > > The questions that bothers me is, why do we have 46k number of vertices > instead of 8k. I have to mention that I checked the cloud for duplicates > sorting the std::vector and using std::unique and there were none. > I would also like to add that I face this behaviour with any model I try to > reconstruct using Powercrust. > > I would be very grateful if anyone could provide some information on this > case. > > Best regards, > Ilia > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Powercrust-weird-behaviour-tp5737680.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Tim Hutton - http://www.sq3.org.uk - http://profiles.google.com/tim.hutton/ - https://github.com/timhutton -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.v.ankudinov at mail.ru Thu Apr 14 07:00:04 2016 From: i.v.ankudinov at mail.ru (IlinkaGrap) Date: Thu, 14 Apr 2016 04:00:04 -0700 (MST) Subject: [vtkusers] Powercrust weird behaviour. In-Reply-To: <1460624686011-5737680.post@n5.nabble.com> References: <1460624686011-5737680.post@n5.nabble.com> Message-ID: <1460631604490-5737682.post@n5.nabble.com> Another thing. If this behaviour is normal. Is there a way to downsample the mesh after powercrust? I tried decimatepro but it didnt work, giving "does not accept polygons that are not triangles". Powercrust does produce such polygons, apparently. Many thanks, Ilia -- View this message in context: http://vtk.1045678.n5.nabble.com/Powercrust-weird-behaviour-tp5737680p5737682.html Sent from the VTK - Users mailing list archive at Nabble.com. From i.v.ankudinov at mail.ru Thu Apr 14 07:01:25 2016 From: i.v.ankudinov at mail.ru (IlinkaGrap) Date: Thu, 14 Apr 2016 04:01:25 -0700 (MST) Subject: [vtkusers] Powercrust weird behaviour. In-Reply-To: References: <1460624686011-5737680.post@n5.nabble.com> Message-ID: <1460631685644-5737683.post@n5.nabble.com> Thank you! Can I kindly ask you to help me with another question above? Ilia -- View this message in context: http://vtk.1045678.n5.nabble.com/Powercrust-weird-behaviour-tp5737680p5737683.html Sent from the VTK - Users mailing list archive at Nabble.com. From tim.hutton at gmail.com Thu Apr 14 07:02:00 2016 From: tim.hutton at gmail.com (Tim Hutton) Date: Thu, 14 Apr 2016 12:02:00 +0100 Subject: [vtkusers] Powercrust weird behaviour. In-Reply-To: <1460631604490-5737682.post@n5.nabble.com> References: <1460624686011-5737680.post@n5.nabble.com> <1460631604490-5737682.post@n5.nabble.com> Message-ID: You can use vtkTriangleFilter first. On 14 April 2016 at 12:00, IlinkaGrap wrote: > Another thing. If this behaviour is normal. Is there a way to downsample > the > mesh after powercrust? > > I tried decimatepro but it didnt work, giving "does not accept polygons > that are not triangles". Powercrust does produce such polygons, apparently. > > Many thanks, > Ilia > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Powercrust-weird-behaviour-tp5737680p5737682.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Tim Hutton - http://www.sq3.org.uk - http://profiles.google.com/tim.hutton/ - https://github.com/timhutton -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.v.ankudinov at mail.ru Thu Apr 14 07:04:16 2016 From: i.v.ankudinov at mail.ru (IlinkaGrap) Date: Thu, 14 Apr 2016 04:04:16 -0700 (MST) Subject: [vtkusers] Powercrust weird behaviour. In-Reply-To: References: <1460624686011-5737680.post@n5.nabble.com> <1460631604490-5737682.post@n5.nabble.com> Message-ID: <1460631856282-5737685.post@n5.nabble.com> Great, thanks! Regards, Ilia -- View this message in context: http://vtk.1045678.n5.nabble.com/Powercrust-weird-behaviour-tp5737680p5737685.html Sent from the VTK - Users mailing list archive at Nabble.com. From abenchaaben at histalim.com Thu Apr 14 09:15:15 2016 From: abenchaaben at histalim.com (abenchaaben) Date: Thu, 14 Apr 2016 06:15:15 -0700 (MST) Subject: [vtkusers] VTK RGB rendering Volume In-Reply-To: <1460474794002-5737641.post@n5.nabble.com> References: <1460474794002-5737641.post@n5.nabble.com> Message-ID: <1460639715579-5737687.post@n5.nabble.com> Any help please??? -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-RGB-rendering-Volume-tp5737641p5737687.html Sent from the VTK - Users mailing list archive at Nabble.com. From cory.quammen at kitware.com Thu Apr 14 09:25:31 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 14 Apr 2016 09:25:31 -0400 Subject: [vtkusers] VTK RGB rendering Volume In-Reply-To: <1460474794002-5737641.post@n5.nabble.com> References: <1460474794002-5737641.post@n5.nabble.com> Message-ID: The poly data mappers have support for directly mapping color data, but looking just now it doesn't seem that the volume mappers do. Lisa and Aashish, can you volume render RGB data directly without going through the color map? Thanks, Cory On Tue, Apr 12, 2016 at 11:26 AM, abenchaaben wrote: > Hello, > > I have a 2D RGB serie that i want to render it with VTK. I created the > volume with the help of ITK and i have now a vti file. > > I used an example of rendering that i found online: > > > double opacityWindow = 4096; > double opacityLevel = 2048; > int blendType = 6; > int clip = 0; > double reductionFactor = 1.0; > double frameRate = 10.0; > char *fileName = (char*)VolumePath.c_str(); > > bool independentComponents=true; > > // Create the renderer, render window and interactor > vtkRenderer *renderer = vtkRenderer::New(); > uinw->qvtkWidget->GetRenderWindow()->AddRenderer(renderer); > > QVTKInteractor *iren=uinw->qvtkWidget->GetInteractor(); > vtkInteractorStyle *s= static_cast *>(iren->GetInteractorStyle()); > vtkTDxInteractorStyleCamera *t= > static_cast(s->GetTDxStyle()); > const double angleSensitivity=0.02; > const double translationSensitivity=0.001; > t->GetSettings()->SetAngleSensitivity(angleSensitivity); > > t->GetSettings()->SetTranslationXSensitivity(translationSensitivity); > > t->GetSettings()->SetTranslationYSensitivity(translationSensitivity); > > t->GetSettings()->SetTranslationZSensitivity(translationSensitivity); > > iren->SetRenderWindow(uinw->qvtkWidget->GetRenderWindow()); > iren->SetDesiredUpdateRate(frameRate / (1+clip) ); > > iren->GetInteractorStyle()->SetDefaultRenderer(renderer); > > // Read the data > vtkAlgorithm *reader3=0; > vtkImageData *input2=0; > > vtkXMLImageDataReader *xmlReader = vtkXMLImageDataReader::New(); > xmlReader->SetFileName(fileName); > xmlReader->Update(); > input2=xmlReader->GetOutput(); > reader3=xmlReader; > > > // Verify that we actually have a volume > int dim[3]; > input2->GetDimensions(dim); > if ( dim[0] < 2 || > dim[1] < 2 || > dim[2] < 2 ) > { > cout << "Error loading data!" << endl; > exit(EXIT_FAILURE); > } > > vtkImageResample *resample = vtkImageResample::New(); > if ( reductionFactor < 1.0 ) > { > resample->SetInputConnection( reader3->GetOutputPort() ); > resample->SetAxisMagnificationFactor(0, reductionFactor); > resample->SetAxisMagnificationFactor(1, reductionFactor); > resample->SetAxisMagnificationFactor(2, reductionFactor); > } > > // Create our volume and mapper > vtkVolume *volume = vtkVolume::New(); > vtkFixedPointVolumeRayCastMapper *mapper = > vtkFixedPointVolumeRayCastMapper::New(); > > if ( reductionFactor < 1.0 ) > { > mapper->SetInputConnection( resample->GetOutputPort() ); > } > else > { > mapper->SetInputConnection( reader3->GetOutputPort() ); > } > > > // Set the sample distance on the ray to be 1/2 the average spacing > double spacing[3]; > if ( reductionFactor < 1.0 ) > { > resample->GetOutput()->GetSpacing(spacing); > } > else > { > input2->GetSpacing(spacing); > } > > // mapper->SetSampleDistance( > (spacing[0]+spacing[1]+spacing[2])/6.0 ); > // mapper->SetMaximumImageSampleDistance(10.0); > > > // Create our transfer function > vtkColorTransferFunction *colorFun = > vtkColorTransferFunction::New(); > vtkPiecewiseFunction *opacityFun = vtkPiecewiseFunction::New(); > > // Create the property and attach the transfer functions > vtkVolumeProperty *property = vtkVolumeProperty::New(); > property->SetIndependentComponents(independentComponents); > property->SetColor( colorFun ); > property->SetScalarOpacity( opacityFun ); > property->SetInterpolationTypeToLinear(); > > // connect up the volume to the property and the mapper > volume->SetProperty( property ); > volume->SetMapper( mapper ); > > // Depending on the blend type selected as a command line option, > // adjust the transfer function > switch ( blendType ) > { > // MIP > // Create an opacity ramp from the window and level values. > // Color is white. Blending is MIP. > case 0: > colorFun->AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0 ); > opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, > opacityLevel + 0.5*opacityWindow, 1.0 ); > mapper->SetBlendModeToMaximumIntensity(); > break; > > // CompositeRamp > // Create a ramp from the window and level values. Use compositing > // without shading. Color is a ramp from black to white. > case 1: > colorFun->AddRGBSegment(opacityLevel - 0.5*opacityWindow, 0.0, 0.0, > 0.0, > opacityLevel + 0.5*opacityWindow, 1.0, 1.0, 1.0 ); > opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, > opacityLevel + 0.5*opacityWindow, 1.0 ); > mapper->SetBlendModeToComposite(); > property->ShadeOff(); > break; > > // CompositeShadeRamp > // Create a ramp from the window and level values. Use compositing > // with shading. Color is white. > case 2: > colorFun->AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0 ); > opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, > opacityLevel + 0.5*opacityWindow, 1.0 ); > mapper->SetBlendModeToComposite(); > property->ShadeOn(); > break; > > // CT_Skin > // Use compositing and functions set to highlight skin in CT data > // Not for use on RGB data > case 3: > colorFun->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); > colorFun->AddRGBPoint( -1000, .62, .36, .18, 0.5, 0.0 ); > colorFun->AddRGBPoint( -500, .88, .60, .29, 0.33, 0.45 ); > colorFun->AddRGBPoint( 3071, .83, .66, 1, 0.5, 0.0 ); > > opacityFun->AddPoint(-3024, 0, 0.5, 0.0 ); > opacityFun->AddPoint(-1000, 0, 0.5, 0.0 ); > opacityFun->AddPoint(-500, 1.0, 0.33, 0.45 ); > opacityFun->AddPoint(3071, 1.0, 0.5, 0.0); > > mapper->SetBlendModeToComposite(); > property->ShadeOn(); > property->SetAmbient(0.1); > property->SetDiffuse(0.9); > property->SetSpecular(0.2); > property->SetSpecularPower(10.0); > property->SetScalarOpacityUnitDistance(0.8919); > break; > > // CT_Bone > // Use compositing and functions set to highlight bone in CT data > // Not for use on RGB data > case 4: > colorFun->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); > colorFun->AddRGBPoint( -16, 0.73, 0.25, 0.30, 0.49, .61 ); > colorFun->AddRGBPoint( 641, .90, .82, .56, .5, 0.0 ); > colorFun->AddRGBPoint( 3071, 1, 1, 1, .5, 0.0 ); > > opacityFun->AddPoint(-3024, 0, 0.5, 0.0 ); > opacityFun->AddPoint(-16, 0, .49, .61 ); > opacityFun->AddPoint(641, .72, .5, 0.0 ); > opacityFun->AddPoint(3071, .71, 0.5, 0.0); > > mapper->SetBlendModeToComposite(); > property->ShadeOn(); > property->SetAmbient(0.1); > property->SetDiffuse(0.9); > property->SetSpecular(0.2); > property->SetSpecularPower(10.0); > property->SetScalarOpacityUnitDistance(0.8919); > break; > > // CT_Muscle > // Use compositing and functions set to highlight muscle in CT data > // Not for use on RGB data > case 5: > colorFun->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); > colorFun->AddRGBPoint( -155, .55, .25, .15, 0.5, .92 ); > colorFun->AddRGBPoint( 217, .88, .60, .29, 0.33, 0.45 ); > colorFun->AddRGBPoint( 420, 1, .94, .95, 0.5, 0.0 ); > colorFun->AddRGBPoint( 3071, .83, .66, 1, 0.5, 0.0 ); > > opacityFun->AddPoint(-3024, 0, 0.5, 0.0 ); > opacityFun->AddPoint(-155, 0, 0.5, 0.92 ); > opacityFun->AddPoint(217, .68, 0.33, 0.45 ); > opacityFun->AddPoint(420,.83, 0.5, 0.0); > opacityFun->AddPoint(3071, .80, 0.5, 0.0); > > mapper->SetBlendModeToComposite(); > property->ShadeOn(); > property->SetAmbient(0.1); > property->SetDiffuse(0.9); > property->SetSpecular(0.2); > property->SetSpecularPower(10.0); > property->SetScalarOpacityUnitDistance(0.8919); > break; > > // RGB_Composite > // Use compositing and functions set to highlight red/green/blue > regions > // in RGB data. Not for use on single component data > case 6: > opacityFun->AddPoint(0, 0.0); > opacityFun->AddPoint(5.0, 0.0); > opacityFun->AddPoint(30.0, 0.05); > opacityFun->AddPoint(31.0, 0.0); > opacityFun->AddPoint(90.0, 0.0); > opacityFun->AddPoint(100.0, 0.3); > opacityFun->AddPoint(110.0, 0.0); > opacityFun->AddPoint(190.0, 0.0); > opacityFun->AddPoint(200.0, 0.4); > opacityFun->AddPoint(210.0, 0.0); > opacityFun->AddPoint(245.0, 0.0); > opacityFun->AddPoint(255.0, 0.5); > > mapper->SetBlendModeToComposite(); > property->ShadeOff(); > property->SetScalarOpacityUnitDistance(1.0); > break; > default: > vtkGenericWarningMacro("Unknown blend type."); > break; > } > > // Set the default window size > uinw->qvtkWidget->GetRenderWindow()->Render(); > > // Add the volume to the scene > renderer->AddVolume( volume ); > > renderer->ResetCamera(); > > // interact with data > uinw->qvtkWidget->GetRenderWindow()->Render(); > > opacityFun->Delete(); > colorFun->Delete(); > property->Delete(); > > volume->Delete(); > mapper->Delete(); > reader3->Delete(); > resample->Delete(); > renderer->Delete(); > > The problem is that nwith this example it give me the volume with color > transformation and i want to display the volume with the true RGB color from > the images serie that i use when i start. > > Does VTK support such operation?? > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/VTK-RGB-rendering-Volume-tp5737641.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen R&D Engineer Kitware, Inc. From xabivtk at gmail.com Thu Apr 14 09:45:44 2016 From: xabivtk at gmail.com (Xabi Riobe) Date: Thu, 14 Apr 2016 15:45:44 +0200 Subject: [vtkusers] vtkDecimatePro crash with CopyNormals=Off In-Reply-To: References: Message-ID: I still don't fully understand the mechanism of the vtkDataSetAttributes copy flags when passing from a filter to another, is there some documentation anywhere? (appart from the doxygen) And is someone familiar with the vtkDecimatePro to help me find a fix for the case of points insertion with normals? Thanks 2016-04-12 15:45 GMT+02:00 Xabi Riobe : > Hi, > > I have a crash when using vtkDecimatePro (vtk 6.3) if my input has normals > with the CopyNormals flag set to 0 (='off'). > > Attached is a reproductible case with its input. > > The crash occurs at line 409: > outputPD->CopyData(meshPD,ptId,map[ptId]); > > because it tries to access a part of a normals array that has not been > computed properly due to the fact that it was marked with the flag to off. > > The flag is set in vtkPolyDataNormals. A workaround is to set it back to > on before the decimation, but i would like to understand what is the issue. > > First, why this flag is not set back to On at the end of the normals > filter (but other filters like vtkTransformPolyDataFilter will set it to > off as well, producing the crash)? > > And second, is there something to fix in vtkDecimatePro? > > > Thanks for your feedback > > > link to data (vtp): *http://www.filedropper.com/mesh9 > * > > > #include > #include > #include > #include > #include > > int main () > { > // Read the input polydata > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName("./Mesh9.vtp"); > reader->Update(); > > vtkSmartPointer norm = > vtkSmartPointer::New(); > norm->SetInputConnection(reader->GetOutputPort()); > norm->ComputePointNormalsOn(); > norm->Update(); > > const double reduction = 0.98; > > vtkSmartPointer decimate = > vtkSmartPointer::New(); > decimate->SetInputConnection(norm->GetOutputPort()); > decimate->SetTargetReduction(reduction); > decimate->PreserveTopologyOff(); > decimate->Update(); > > return EXIT_SUCCESS; > } > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lisa.avila at kitware.com Thu Apr 14 10:26:58 2016 From: lisa.avila at kitware.com (Lisa Avila) Date: Thu, 14 Apr 2016 10:26:58 -0400 Subject: [vtkusers] VTK RGB rendering Volume In-Reply-To: References: <1460474794002-5737641.post@n5.nabble.com> Message-ID: If you set IndependentComponents to 0, and you have unsigned char data, you can render RGBA data. The ScalarOpacity transfer function will be used to map the 4th component to opacity. You can set this to a linear ramp from 0 to 1 to directly render the A channel if you want, but sometimes we derive the 4th component from something like hue (useful for the visible human data for example) and then the transfer function is helpful to eliminate all the "blue" regions. Lisa On Thu, Apr 14, 2016 at 9:25 AM, Cory Quammen wrote: > The poly data mappers have support for directly mapping color data, > but looking just now it doesn't seem that the volume mappers do. > > Lisa and Aashish, can you volume render RGB data directly without > going through the color map? > > Thanks, > Cory > > On Tue, Apr 12, 2016 at 11:26 AM, abenchaaben > wrote: > > Hello, > > > > I have a 2D RGB serie that i want to render it with VTK. I created the > > volume with the help of ITK and i have now a vti file. > > > > I used an example of rendering that i found online: > > > > > > double opacityWindow = 4096; > > double opacityLevel = 2048; > > int blendType = 6; > > int clip = 0; > > double reductionFactor = 1.0; > > double frameRate = 10.0; > > char *fileName = (char*)VolumePath.c_str(); > > > > bool independentComponents=true; > > > > // Create the renderer, render window and interactor > > vtkRenderer *renderer = vtkRenderer::New(); > > uinw->qvtkWidget->GetRenderWindow()->AddRenderer(renderer); > > > > QVTKInteractor *iren=uinw->qvtkWidget->GetInteractor(); > > vtkInteractorStyle *s= static_cast > *>(iren->GetInteractorStyle()); > > vtkTDxInteractorStyleCamera *t= > > static_cast(s->GetTDxStyle()); > > const double angleSensitivity=0.02; > > const double translationSensitivity=0.001; > > t->GetSettings()->SetAngleSensitivity(angleSensitivity); > > > > t->GetSettings()->SetTranslationXSensitivity(translationSensitivity); > > > > t->GetSettings()->SetTranslationYSensitivity(translationSensitivity); > > > > t->GetSettings()->SetTranslationZSensitivity(translationSensitivity); > > > > iren->SetRenderWindow(uinw->qvtkWidget->GetRenderWindow()); > > iren->SetDesiredUpdateRate(frameRate / (1+clip) ); > > > > iren->GetInteractorStyle()->SetDefaultRenderer(renderer); > > > > // Read the data > > vtkAlgorithm *reader3=0; > > vtkImageData *input2=0; > > > > vtkXMLImageDataReader *xmlReader = vtkXMLImageDataReader::New(); > > xmlReader->SetFileName(fileName); > > xmlReader->Update(); > > input2=xmlReader->GetOutput(); > > reader3=xmlReader; > > > > > > // Verify that we actually have a volume > > int dim[3]; > > input2->GetDimensions(dim); > > if ( dim[0] < 2 || > > dim[1] < 2 || > > dim[2] < 2 ) > > { > > cout << "Error loading data!" << endl; > > exit(EXIT_FAILURE); > > } > > > > vtkImageResample *resample = vtkImageResample::New(); > > if ( reductionFactor < 1.0 ) > > { > > resample->SetInputConnection( reader3->GetOutputPort() ); > > resample->SetAxisMagnificationFactor(0, reductionFactor); > > resample->SetAxisMagnificationFactor(1, reductionFactor); > > resample->SetAxisMagnificationFactor(2, reductionFactor); > > } > > > > // Create our volume and mapper > > vtkVolume *volume = vtkVolume::New(); > > vtkFixedPointVolumeRayCastMapper *mapper = > > vtkFixedPointVolumeRayCastMapper::New(); > > > > if ( reductionFactor < 1.0 ) > > { > > mapper->SetInputConnection( resample->GetOutputPort() ); > > } > > else > > { > > mapper->SetInputConnection( reader3->GetOutputPort() ); > > } > > > > > > // Set the sample distance on the ray to be 1/2 the average > spacing > > double spacing[3]; > > if ( reductionFactor < 1.0 ) > > { > > resample->GetOutput()->GetSpacing(spacing); > > } > > else > > { > > input2->GetSpacing(spacing); > > } > > > > // mapper->SetSampleDistance( > > (spacing[0]+spacing[1]+spacing[2])/6.0 ); > > // mapper->SetMaximumImageSampleDistance(10.0); > > > > > > // Create our transfer function > > vtkColorTransferFunction *colorFun = > > vtkColorTransferFunction::New(); > > vtkPiecewiseFunction *opacityFun = vtkPiecewiseFunction::New(); > > > > // Create the property and attach the transfer functions > > vtkVolumeProperty *property = vtkVolumeProperty::New(); > > property->SetIndependentComponents(independentComponents); > > property->SetColor( colorFun ); > > property->SetScalarOpacity( opacityFun ); > > property->SetInterpolationTypeToLinear(); > > > > // connect up the volume to the property and the mapper > > volume->SetProperty( property ); > > volume->SetMapper( mapper ); > > > > // Depending on the blend type selected as a command line option, > > // adjust the transfer function > > switch ( blendType ) > > { > > // MIP > > // Create an opacity ramp from the window and level values. > > // Color is white. Blending is MIP. > > case 0: > > colorFun->AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0 > ); > > opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, > > opacityLevel + 0.5*opacityWindow, 1.0 ); > > mapper->SetBlendModeToMaximumIntensity(); > > break; > > > > // CompositeRamp > > // Create a ramp from the window and level values. Use > compositing > > // without shading. Color is a ramp from black to white. > > case 1: > > colorFun->AddRGBSegment(opacityLevel - 0.5*opacityWindow, 0.0, > 0.0, > > 0.0, > > opacityLevel + 0.5*opacityWindow, 1.0, 1.0, 1.0 ); > > opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, > > opacityLevel + 0.5*opacityWindow, 1.0 ); > > mapper->SetBlendModeToComposite(); > > property->ShadeOff(); > > break; > > > > // CompositeShadeRamp > > // Create a ramp from the window and level values. Use > compositing > > // with shading. Color is white. > > case 2: > > colorFun->AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0 > ); > > opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, > > opacityLevel + 0.5*opacityWindow, 1.0 ); > > mapper->SetBlendModeToComposite(); > > property->ShadeOn(); > > break; > > > > // CT_Skin > > // Use compositing and functions set to highlight skin in CT data > > // Not for use on RGB data > > case 3: > > colorFun->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); > > colorFun->AddRGBPoint( -1000, .62, .36, .18, 0.5, 0.0 ); > > colorFun->AddRGBPoint( -500, .88, .60, .29, 0.33, 0.45 ); > > colorFun->AddRGBPoint( 3071, .83, .66, 1, 0.5, 0.0 ); > > > > opacityFun->AddPoint(-3024, 0, 0.5, 0.0 ); > > opacityFun->AddPoint(-1000, 0, 0.5, 0.0 ); > > opacityFun->AddPoint(-500, 1.0, 0.33, 0.45 ); > > opacityFun->AddPoint(3071, 1.0, 0.5, 0.0); > > > > mapper->SetBlendModeToComposite(); > > property->ShadeOn(); > > property->SetAmbient(0.1); > > property->SetDiffuse(0.9); > > property->SetSpecular(0.2); > > property->SetSpecularPower(10.0); > > property->SetScalarOpacityUnitDistance(0.8919); > > break; > > > > // CT_Bone > > // Use compositing and functions set to highlight bone in CT data > > // Not for use on RGB data > > case 4: > > colorFun->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); > > colorFun->AddRGBPoint( -16, 0.73, 0.25, 0.30, 0.49, .61 ); > > colorFun->AddRGBPoint( 641, .90, .82, .56, .5, 0.0 ); > > colorFun->AddRGBPoint( 3071, 1, 1, 1, .5, 0.0 ); > > > > opacityFun->AddPoint(-3024, 0, 0.5, 0.0 ); > > opacityFun->AddPoint(-16, 0, .49, .61 ); > > opacityFun->AddPoint(641, .72, .5, 0.0 ); > > opacityFun->AddPoint(3071, .71, 0.5, 0.0); > > > > mapper->SetBlendModeToComposite(); > > property->ShadeOn(); > > property->SetAmbient(0.1); > > property->SetDiffuse(0.9); > > property->SetSpecular(0.2); > > property->SetSpecularPower(10.0); > > property->SetScalarOpacityUnitDistance(0.8919); > > break; > > > > // CT_Muscle > > // Use compositing and functions set to highlight muscle in CT > data > > // Not for use on RGB data > > case 5: > > colorFun->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); > > colorFun->AddRGBPoint( -155, .55, .25, .15, 0.5, .92 ); > > colorFun->AddRGBPoint( 217, .88, .60, .29, 0.33, 0.45 ); > > colorFun->AddRGBPoint( 420, 1, .94, .95, 0.5, 0.0 ); > > colorFun->AddRGBPoint( 3071, .83, .66, 1, 0.5, 0.0 ); > > > > opacityFun->AddPoint(-3024, 0, 0.5, 0.0 ); > > opacityFun->AddPoint(-155, 0, 0.5, 0.92 ); > > opacityFun->AddPoint(217, .68, 0.33, 0.45 ); > > opacityFun->AddPoint(420,.83, 0.5, 0.0); > > opacityFun->AddPoint(3071, .80, 0.5, 0.0); > > > > mapper->SetBlendModeToComposite(); > > property->ShadeOn(); > > property->SetAmbient(0.1); > > property->SetDiffuse(0.9); > > property->SetSpecular(0.2); > > property->SetSpecularPower(10.0); > > property->SetScalarOpacityUnitDistance(0.8919); > > break; > > > > // RGB_Composite > > // Use compositing and functions set to highlight red/green/blue > > regions > > // in RGB data. Not for use on single component data > > case 6: > > opacityFun->AddPoint(0, 0.0); > > opacityFun->AddPoint(5.0, 0.0); > > opacityFun->AddPoint(30.0, 0.05); > > opacityFun->AddPoint(31.0, 0.0); > > opacityFun->AddPoint(90.0, 0.0); > > opacityFun->AddPoint(100.0, 0.3); > > opacityFun->AddPoint(110.0, 0.0); > > opacityFun->AddPoint(190.0, 0.0); > > opacityFun->AddPoint(200.0, 0.4); > > opacityFun->AddPoint(210.0, 0.0); > > opacityFun->AddPoint(245.0, 0.0); > > opacityFun->AddPoint(255.0, 0.5); > > > > mapper->SetBlendModeToComposite(); > > property->ShadeOff(); > > property->SetScalarOpacityUnitDistance(1.0); > > break; > > default: > > vtkGenericWarningMacro("Unknown blend type."); > > break; > > } > > > > // Set the default window size > > uinw->qvtkWidget->GetRenderWindow()->Render(); > > > > // Add the volume to the scene > > renderer->AddVolume( volume ); > > > > renderer->ResetCamera(); > > > > // interact with data > > uinw->qvtkWidget->GetRenderWindow()->Render(); > > > > opacityFun->Delete(); > > colorFun->Delete(); > > property->Delete(); > > > > volume->Delete(); > > mapper->Delete(); > > reader3->Delete(); > > resample->Delete(); > > renderer->Delete(); > > > > The problem is that nwith this example it give me the volume with color > > transformation and i want to display the volume with the true RGB color > from > > the images serie that i use when i start. > > > > Does VTK support such operation?? > > > > > > > > -- > > View this message in context: > http://vtk.1045678.n5.nabble.com/VTK-RGB-rendering-Volume-tp5737641.html > > Sent from the VTK - Users mailing list archive at Nabble.com. > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ali.hadimogullari at netcad.com.tr Thu Apr 14 10:48:48 2016 From: ali.hadimogullari at netcad.com.tr (alihadim) Date: Thu, 14 Apr 2016 07:48:48 -0700 (MST) Subject: [vtkusers] 30 million points and Render Message-ID: <1460645328211-5737692.post@n5.nabble.com> Hi All, I have to 30 million points file data and I want to render. Do you have suggestions; * Use one cell and million point add * Use many cell ana dividing points. * use filtering method. (which) Because When I created data I took error messages. "System out-off memory." -- View this message in context: http://vtk.1045678.n5.nabble.com/30-million-points-and-Render-tp5737692.html Sent from the VTK - Users mailing list archive at Nabble.com. From lisa.avila at kitware.com Thu Apr 14 10:50:30 2016 From: lisa.avila at kitware.com (Lisa Avila) Date: Thu, 14 Apr 2016 10:50:30 -0400 Subject: [vtkusers] VTK RGB rendering Volume In-Reply-To: References: <1460474794002-5737641.post@n5.nabble.com> Message-ID: I should have mentioned that in the example code, IndependentComponents is set to 1 - hence the four components of the data set are considered separate properties that are rendered independently then combined using the component weights. This would be useful, for example, if you have confocal microscopy data that was scanned using multiple different fluorescent dyes to produce a stack of color tiff images (where red = the first scan, green = the second scan, etc.) In this case the ColorTransferFunctions are used (but in IndependentComponents is set to 0, the first three components are used directly as RGB). Lisa On Thu, Apr 14, 2016 at 10:26 AM, Lisa Avila wrote: > If you set IndependentComponents to 0, and you have unsigned char data, > you can render RGBA data. The ScalarOpacity transfer function will be used > to map the 4th component to opacity. You can set this to a linear ramp from > 0 to 1 to directly render the A channel if you want, but sometimes we > derive the 4th component from something like hue (useful for the visible > human data for example) and then the transfer function is helpful to > eliminate all the "blue" regions. > > Lisa > > > On Thu, Apr 14, 2016 at 9:25 AM, Cory Quammen > wrote: > >> The poly data mappers have support for directly mapping color data, >> but looking just now it doesn't seem that the volume mappers do. >> >> Lisa and Aashish, can you volume render RGB data directly without >> going through the color map? >> >> Thanks, >> Cory >> >> On Tue, Apr 12, 2016 at 11:26 AM, abenchaaben >> wrote: >> > Hello, >> > >> > I have a 2D RGB serie that i want to render it with VTK. I created the >> > volume with the help of ITK and i have now a vti file. >> > >> > I used an example of rendering that i found online: >> > >> > >> > double opacityWindow = 4096; >> > double opacityLevel = 2048; >> > int blendType = 6; >> > int clip = 0; >> > double reductionFactor = 1.0; >> > double frameRate = 10.0; >> > char *fileName = (char*)VolumePath.c_str(); >> > >> > bool independentComponents=true; >> > >> > // Create the renderer, render window and interactor >> > vtkRenderer *renderer = vtkRenderer::New(); >> > uinw->qvtkWidget->GetRenderWindow()->AddRenderer(renderer); >> > >> > QVTKInteractor *iren=uinw->qvtkWidget->GetInteractor(); >> > vtkInteractorStyle *s= static_cast> > *>(iren->GetInteractorStyle()); >> > vtkTDxInteractorStyleCamera *t= >> > static_cast(s->GetTDxStyle()); >> > const double angleSensitivity=0.02; >> > const double translationSensitivity=0.001; >> > t->GetSettings()->SetAngleSensitivity(angleSensitivity); >> > >> > t->GetSettings()->SetTranslationXSensitivity(translationSensitivity); >> > >> > t->GetSettings()->SetTranslationYSensitivity(translationSensitivity); >> > >> > t->GetSettings()->SetTranslationZSensitivity(translationSensitivity); >> > >> > iren->SetRenderWindow(uinw->qvtkWidget->GetRenderWindow()); >> > iren->SetDesiredUpdateRate(frameRate / (1+clip) ); >> > >> > iren->GetInteractorStyle()->SetDefaultRenderer(renderer); >> > >> > // Read the data >> > vtkAlgorithm *reader3=0; >> > vtkImageData *input2=0; >> > >> > vtkXMLImageDataReader *xmlReader = vtkXMLImageDataReader::New(); >> > xmlReader->SetFileName(fileName); >> > xmlReader->Update(); >> > input2=xmlReader->GetOutput(); >> > reader3=xmlReader; >> > >> > >> > // Verify that we actually have a volume >> > int dim[3]; >> > input2->GetDimensions(dim); >> > if ( dim[0] < 2 || >> > dim[1] < 2 || >> > dim[2] < 2 ) >> > { >> > cout << "Error loading data!" << endl; >> > exit(EXIT_FAILURE); >> > } >> > >> > vtkImageResample *resample = vtkImageResample::New(); >> > if ( reductionFactor < 1.0 ) >> > { >> > resample->SetInputConnection( reader3->GetOutputPort() ); >> > resample->SetAxisMagnificationFactor(0, reductionFactor); >> > resample->SetAxisMagnificationFactor(1, reductionFactor); >> > resample->SetAxisMagnificationFactor(2, reductionFactor); >> > } >> > >> > // Create our volume and mapper >> > vtkVolume *volume = vtkVolume::New(); >> > vtkFixedPointVolumeRayCastMapper *mapper = >> > vtkFixedPointVolumeRayCastMapper::New(); >> > >> > if ( reductionFactor < 1.0 ) >> > { >> > mapper->SetInputConnection( resample->GetOutputPort() ); >> > } >> > else >> > { >> > mapper->SetInputConnection( reader3->GetOutputPort() ); >> > } >> > >> > >> > // Set the sample distance on the ray to be 1/2 the average >> spacing >> > double spacing[3]; >> > if ( reductionFactor < 1.0 ) >> > { >> > resample->GetOutput()->GetSpacing(spacing); >> > } >> > else >> > { >> > input2->GetSpacing(spacing); >> > } >> > >> > // mapper->SetSampleDistance( >> > (spacing[0]+spacing[1]+spacing[2])/6.0 ); >> > // mapper->SetMaximumImageSampleDistance(10.0); >> > >> > >> > // Create our transfer function >> > vtkColorTransferFunction *colorFun = >> > vtkColorTransferFunction::New(); >> > vtkPiecewiseFunction *opacityFun = vtkPiecewiseFunction::New(); >> > >> > // Create the property and attach the transfer functions >> > vtkVolumeProperty *property = vtkVolumeProperty::New(); >> > property->SetIndependentComponents(independentComponents); >> > property->SetColor( colorFun ); >> > property->SetScalarOpacity( opacityFun ); >> > property->SetInterpolationTypeToLinear(); >> > >> > // connect up the volume to the property and the mapper >> > volume->SetProperty( property ); >> > volume->SetMapper( mapper ); >> > >> > // Depending on the blend type selected as a command line >> option, >> > // adjust the transfer function >> > switch ( blendType ) >> > { >> > // MIP >> > // Create an opacity ramp from the window and level values. >> > // Color is white. Blending is MIP. >> > case 0: >> > colorFun->AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, >> 1.0 ); >> > opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, >> > opacityLevel + 0.5*opacityWindow, 1.0 ); >> > mapper->SetBlendModeToMaximumIntensity(); >> > break; >> > >> > // CompositeRamp >> > // Create a ramp from the window and level values. Use >> compositing >> > // without shading. Color is a ramp from black to white. >> > case 1: >> > colorFun->AddRGBSegment(opacityLevel - 0.5*opacityWindow, 0.0, >> 0.0, >> > 0.0, >> > opacityLevel + 0.5*opacityWindow, 1.0, 1.0, 1.0 ); >> > opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, >> > opacityLevel + 0.5*opacityWindow, 1.0 ); >> > mapper->SetBlendModeToComposite(); >> > property->ShadeOff(); >> > break; >> > >> > // CompositeShadeRamp >> > // Create a ramp from the window and level values. Use >> compositing >> > // with shading. Color is white. >> > case 2: >> > colorFun->AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, >> 1.0 ); >> > opacityFun->AddSegment( opacityLevel - 0.5*opacityWindow, 0.0, >> > opacityLevel + 0.5*opacityWindow, 1.0 ); >> > mapper->SetBlendModeToComposite(); >> > property->ShadeOn(); >> > break; >> > >> > // CT_Skin >> > // Use compositing and functions set to highlight skin in CT >> data >> > // Not for use on RGB data >> > case 3: >> > colorFun->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); >> > colorFun->AddRGBPoint( -1000, .62, .36, .18, 0.5, 0.0 ); >> > colorFun->AddRGBPoint( -500, .88, .60, .29, 0.33, 0.45 ); >> > colorFun->AddRGBPoint( 3071, .83, .66, 1, 0.5, 0.0 ); >> > >> > opacityFun->AddPoint(-3024, 0, 0.5, 0.0 ); >> > opacityFun->AddPoint(-1000, 0, 0.5, 0.0 ); >> > opacityFun->AddPoint(-500, 1.0, 0.33, 0.45 ); >> > opacityFun->AddPoint(3071, 1.0, 0.5, 0.0); >> > >> > mapper->SetBlendModeToComposite(); >> > property->ShadeOn(); >> > property->SetAmbient(0.1); >> > property->SetDiffuse(0.9); >> > property->SetSpecular(0.2); >> > property->SetSpecularPower(10.0); >> > property->SetScalarOpacityUnitDistance(0.8919); >> > break; >> > >> > // CT_Bone >> > // Use compositing and functions set to highlight bone in CT >> data >> > // Not for use on RGB data >> > case 4: >> > colorFun->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); >> > colorFun->AddRGBPoint( -16, 0.73, 0.25, 0.30, 0.49, .61 ); >> > colorFun->AddRGBPoint( 641, .90, .82, .56, .5, 0.0 ); >> > colorFun->AddRGBPoint( 3071, 1, 1, 1, .5, 0.0 ); >> > >> > opacityFun->AddPoint(-3024, 0, 0.5, 0.0 ); >> > opacityFun->AddPoint(-16, 0, .49, .61 ); >> > opacityFun->AddPoint(641, .72, .5, 0.0 ); >> > opacityFun->AddPoint(3071, .71, 0.5, 0.0); >> > >> > mapper->SetBlendModeToComposite(); >> > property->ShadeOn(); >> > property->SetAmbient(0.1); >> > property->SetDiffuse(0.9); >> > property->SetSpecular(0.2); >> > property->SetSpecularPower(10.0); >> > property->SetScalarOpacityUnitDistance(0.8919); >> > break; >> > >> > // CT_Muscle >> > // Use compositing and functions set to highlight muscle in CT >> data >> > // Not for use on RGB data >> > case 5: >> > colorFun->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); >> > colorFun->AddRGBPoint( -155, .55, .25, .15, 0.5, .92 ); >> > colorFun->AddRGBPoint( 217, .88, .60, .29, 0.33, 0.45 ); >> > colorFun->AddRGBPoint( 420, 1, .94, .95, 0.5, 0.0 ); >> > colorFun->AddRGBPoint( 3071, .83, .66, 1, 0.5, 0.0 ); >> > >> > opacityFun->AddPoint(-3024, 0, 0.5, 0.0 ); >> > opacityFun->AddPoint(-155, 0, 0.5, 0.92 ); >> > opacityFun->AddPoint(217, .68, 0.33, 0.45 ); >> > opacityFun->AddPoint(420,.83, 0.5, 0.0); >> > opacityFun->AddPoint(3071, .80, 0.5, 0.0); >> > >> > mapper->SetBlendModeToComposite(); >> > property->ShadeOn(); >> > property->SetAmbient(0.1); >> > property->SetDiffuse(0.9); >> > property->SetSpecular(0.2); >> > property->SetSpecularPower(10.0); >> > property->SetScalarOpacityUnitDistance(0.8919); >> > break; >> > >> > // RGB_Composite >> > // Use compositing and functions set to highlight red/green/blue >> > regions >> > // in RGB data. Not for use on single component data >> > case 6: >> > opacityFun->AddPoint(0, 0.0); >> > opacityFun->AddPoint(5.0, 0.0); >> > opacityFun->AddPoint(30.0, 0.05); >> > opacityFun->AddPoint(31.0, 0.0); >> > opacityFun->AddPoint(90.0, 0.0); >> > opacityFun->AddPoint(100.0, 0.3); >> > opacityFun->AddPoint(110.0, 0.0); >> > opacityFun->AddPoint(190.0, 0.0); >> > opacityFun->AddPoint(200.0, 0.4); >> > opacityFun->AddPoint(210.0, 0.0); >> > opacityFun->AddPoint(245.0, 0.0); >> > opacityFun->AddPoint(255.0, 0.5); >> > >> > mapper->SetBlendModeToComposite(); >> > property->ShadeOff(); >> > property->SetScalarOpacityUnitDistance(1.0); >> > break; >> > default: >> > vtkGenericWarningMacro("Unknown blend type."); >> > break; >> > } >> > >> > // Set the default window size >> > uinw->qvtkWidget->GetRenderWindow()->Render(); >> > >> > // Add the volume to the scene >> > renderer->AddVolume( volume ); >> > >> > renderer->ResetCamera(); >> > >> > // interact with data >> > uinw->qvtkWidget->GetRenderWindow()->Render(); >> > >> > opacityFun->Delete(); >> > colorFun->Delete(); >> > property->Delete(); >> > >> > volume->Delete(); >> > mapper->Delete(); >> > reader3->Delete(); >> > resample->Delete(); >> > renderer->Delete(); >> > >> > The problem is that nwith this example it give me the volume with color >> > transformation and i want to display the volume with the true RGB color >> from >> > the images serie that i use when i start. >> > >> > Does VTK support such operation?? >> > >> > >> > >> > -- >> > View this message in context: >> http://vtk.1045678.n5.nabble.com/VTK-RGB-rendering-Volume-tp5737641.html >> > Sent from the VTK - Users mailing list archive at Nabble.com. >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/vtkusers >> >> >> >> -- >> Cory Quammen >> R&D Engineer >> Kitware, Inc. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abenchaaben at histalim.com Thu Apr 14 10:54:19 2016 From: abenchaaben at histalim.com (abenchaaben) Date: Thu, 14 Apr 2016 07:54:19 -0700 (MST) Subject: [vtkusers] VTK RGB rendering Volume In-Reply-To: References: <1460474794002-5737641.post@n5.nabble.com> Message-ID: <1460645659464-5737694.post@n5.nabble.com> Hi Lisa, Thank you for replying. This is what i did. My data is unsigned char and i set the IndependentComponents to false. I use the blend type RGB_Composite like it was mentioned in the example. But when i display the result, i had a black screen. i tried to visualize the some VTI data with volview with the IndependentComponents to false and it work. So i'm sure it's not the file that cause the problem. But i really dont know what also can be wrong... -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-RGB-rendering-Volume-tp5737641p5737694.html Sent from the VTK - Users mailing list archive at Nabble.com. From cory.quammen at kitware.com Thu Apr 14 11:20:10 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 14 Apr 2016 11:20:10 -0400 Subject: [vtkusers] Trouble with vtkbooleanOperationPolydataFilter In-Reply-To: <1460568424147-5737667.post@n5.nabble.com> References: <1460568424147-5737667.post@n5.nabble.com> Message-ID: Are you using the latest VTK master? If not, which version are you using? If you are using master, there is a topic under review for inclusion in VTK that you could try instead to see how it works: https://gitlab.kitware.com/vtk/vtk/merge_requests/1272 HTH, Cory On Wed, Apr 13, 2016 at 1:27 PM, c_mihai via vtkusers wrote: > Has anyone figured out how to get this class to work constantly? > I'm trying to use it to perform substractions/carvings. > It seems to work when using simple figures, like a moon or a cylinder. But > it fails for me when using text(I vtkVectorText, then I > vtkLinearExtrusionFilter and finally use vtkTriangleFilter to obtain the 3D > text) or a bar code. > Screenshots for a failed to work example: > 1) (Before)Model to be substracted/carved on: > http://puu.sh/ogToi/66d8f78576.jpg > http://puu.sh/ogTPZ/4189e38286.jpg > 2) (After): > a) for the bar code > http://puu.sh/ogSVE/d8000da4d2.jpg > http://puu.sh/ogSZB/5e9531fdb9.jpg > b) for the text(created the way I explained above) > http://puu.sh/ogU2p/43cad5fe16.jpg > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Trouble-with-vtkbooleanOperationPolydataFilter-tp5737667.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen R&D Engineer Kitware, Inc. From cory.quammen at kitware.com Thu Apr 14 11:37:14 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 14 Apr 2016 11:37:14 -0400 Subject: [vtkusers] vtk keyboard keys In-Reply-To: <1460041626695-5737577.post@n5.nabble.com> References: <1460020373039-5737565.post@n5.nabble.com> <1460036387291-5737571.post@n5.nabble.com> <1460037248803-5737574.post@n5.nabble.com> <1460041626695-5737577.post@n5.nabble.com> Message-ID: I think you are missing the setting of the interactor in the render window, e.g., renderWindow->SetInteractor(renderWindowInteractor); On Thu, Apr 7, 2016 at 11:07 AM, aria dob wrote: > this is my program > > > #include "stdafx.h" > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > vtkSmartPointer act =vtkSmartPointer::New(); > vtkSmartPointer renderer > =vtkSmartPointer::New(); > vtkSmartPointer renderWindow > =vtkSmartPointer::New(); > > vtkSmartPointer renderWindowInteractor > =vtkSmartPointer::New(); > > class KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera > { > public: > static KeyPressInteractorStyle* New(); > vtkTypeMacro(KeyPressInteractorStyle, > vtkInteractorStyleTrackballCamera); > > virtual void OnKeyPress() > { double handpos[3] = {0.7,-1.2,2.6}; > > // Get the keypress > vtkRenderWindowInteractor *rwi = this->Interactor; > std::string key = rwi->GetKeySym(); > > // Output the key that was pressed > std::cout << "Pressed " << key << std::endl; > > // Handle an arrow key > if (key == "Up") > { > std::cout << "The up arrow was pressed." << > std::endl; > handpos[0]++; > act->SetPosition(handpos[0], handpos[1], > handpos[2]); > renderer->Render(); > renderWindow->Render(); > } > > if (key == "a") > { > std::cout << "The up arrow was pressed." << > std::endl; > handpos[1]++; > act->SetPosition(handpos[0], handpos[1], > handpos[2]); > renderer->Render(); > renderWindow->Render(); > } > if (key == "h") > { > std::cout << "The up arrow was pressed." << > std::endl; > handpos[2]++; > act->SetPosition(handpos[0], handpos[1], > handpos[2]); > renderer->Render(); > renderWindow->Render(); > } > // Forward events > vtkInteractorStyleTrackballCamera::OnKeyPress(); > } > }; > vtkStandardNewMacro(KeyPressInteractorStyle); > > int _tmain(int argc, _TCHAR* argv[]) > { > // ajouter la main > vtkPolyDataReader *read= vtkPolyDataReader::New (); > read->SetFileName("C:/hand.vtk"); > read->Update(); > // Create a mapper and actor(la main) > vtkSmartPointer map > =vtkSmartPointer::New(); > map->SetInputConnection(read->GetOutputPort()); > //act->GetProperty()->SetColor(1.0,0.49,0.25); > act->SetMapper(map); > act->SetPosition(0.7,-1.2,2.6); > act->SetScale(0.09); > act->RotateX(0); > act->GetProperty()->SetColor(1.0,0.49,0.25); > // act->GetProperty()->SetEdgeColor(0,0,0); > act->GetProperty()->EdgeVisibilityOn(); > renderWindow->AddRenderer(renderer); > renderWindowInteractor->SetRenderWindow(renderWindow); > > vtkSmartPointer style = > vtkSmartPointer::New(); > renderWindowInteractor->SetInteractorStyle(style); > style->SetCurrentRenderer(renderer); > > renderer->AddActor(act); > renderer->SetBackground(.1, .2, .3); // Background color dark blue > > renderWindow->SetSize(1300,700); > > renderWindow->Render(); > renderWindowInteractor->Start(); > > > return(0)} > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/vtk-keyboard-keys-tp5737565p5737577.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ultam93 at yahoo.com Thu Apr 14 12:13:04 2016 From: ultam93 at yahoo.com (c_mihai) Date: Thu, 14 Apr 2016 09:13:04 -0700 (MST) Subject: [vtkusers] Trouble with vtkbooleanOperationPolydataFilter In-Reply-To: References: <1460568424147-5737667.post@n5.nabble.com> Message-ID: <1460650384350-5737697.post@n5.nabble.com> I'm using the one from the vtk 7.0.0 release. -- View this message in context: http://vtk.1045678.n5.nabble.com/Trouble-with-vtkbooleanOperationPolydataFilter-tp5737667p5737697.html Sent from the VTK - Users mailing list archive at Nabble.com. From cory.quammen at kitware.com Thu Apr 14 12:55:43 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 14 Apr 2016 12:55:43 -0400 Subject: [vtkusers] Trouble with vtkbooleanOperationPolydataFilter In-Reply-To: <1460650384350-5737697.post@n5.nabble.com> References: <1460568424147-5737667.post@n5.nabble.com> <1460650384350-5737697.post@n5.nabble.com> Message-ID: There are known issues with the boolean operation filter. If your geometry has long skinny triangles, it may not work. Hopefully the new contribution from Adam Updegrove will work in your case. When I finally find some time to thoroughly review it, I'll work to get it into VTK. Cory On Thu, Apr 14, 2016 at 12:13 PM, c_mihai via vtkusers wrote: > I'm using the one from the vtk 7.0.0 release. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Trouble-with-vtkbooleanOperationPolydataFilter-tp5737667p5737697.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eduardo.ecamargo at gmail.com Thu Apr 14 13:27:56 2016 From: eduardo.ecamargo at gmail.com (Eduardo - Gmail) Date: Thu, 14 Apr 2016 10:27:56 -0700 Subject: [vtkusers] Job position, Vancouver - Canada In-Reply-To: References: Message-ID: Hi!! Does anybody know about any job position (for work with vtk) open in Vancouver, Canada?? Kind Regards, Camargo, Eduardo, M.Sc. Skype: camargo_rh "Work hard toward your goals, no matter what obstacles get in your way. Even if you think you can?t do it, just be disciplined, put your mind to it, and then do your best." - Jean Chiar - SETI Institute -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Fri Apr 15 01:55:55 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Fri, 15 Apr 2016 15:55:55 +1000 Subject: [vtkusers] Memory management Message-ID: Dear All I am not familiar with c++, so I would like to have your suggestion in memory management in VTK/Qt. I have a class to read a series of CT images constructed like this DICOMReader::DICOMReader(QWidget *parent) { this->ImageSet=vtkSmartPointer::New(); } DICOMReader::~DICOMReader() { } void DICOMReader::readImageSeries() {//reading code goes here, only the last filter is shown here typedef itk::ImageToVTKImageFilter ConnectorType; ConnectorType::Pointer Converter = ConnectorType::New(); Converter->SetInput(reader->GetOutput()); Converter->Update(); this->ImageSet=Converter->GetOutput(); } then I pass this image to a viewer class like this: //Read image DICOMReader *reader=new DICOMReader(this); reader->readImageSeries(); ImageViewer2D *ViewerEBRT= new ImageViewer2D(); ViewerEBRT->SetImageData(reader->ImageSet); SetImageData is defined as void ImageViewer2D::SetImageData(vtkImageData *Img) { this->ImageData=Img; } Looks likes there is some silly mistake they way data is passed on. Can anyone suggest me a better way. Thanks Jothy -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Fri Apr 15 04:52:10 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 15 Apr 2016 10:52:10 +0200 Subject: [vtkusers] Advice on pipeline for multiple volumes Message-ID: Hi all, I have a series (in the end, probably hundreds) of roughly cylindrical volumes. Each volume represent ~0.1-1 meter of a rock core. Together the volumes form the complete (~500 m) rock core. Each volume is stored in a HDF5-file, and I've implemented a basic VTK reader class to load a volume from such a file. I now need to provide a sideways-scrollable view of these rock cores, where at any time only 1-3 meter (depending on zoom) is visible, as shown in the attached rough sketch. (As a side note: The original plan was for our software to also provide a (semi-)automatic way of orienting/positioning the pieces of the broken core, so they fit together the way they're supposed to (the way they sat in the mountain), but because of the problems with rendering multiple volumes which intersect in 3D space, we've postponed that idea for now and will render each volume disjoint from the others.) What I'm pondering now is how to best set up a VTK pipeline to drive this view. The volumes are quite high res (~4000x250x250 voxels per meter), so not much more than what is currently shown in the view can be kept in memory. My first idea is to have a set of reader + ExtractVOI pairs, and based on the currently shown section of the core, configure them as necessary to load the required extents of the volume(s). The set of such reader + ExtractVOI pairs (source paths into the pipeline so to speak) would need to be dynamic, since along some sections of the core, it is broken up into many small volumes (requiring more reader + ExtractVOI pairs), and sometimes consists of fairly large 1 meter chunks (requiring fewer reader + ExtractVOI pairs). First of all, does this idea sound sane? At any point in time, I would then have maybe 3-4 reader + ExtractVOI pairs, each giving rise to a volume, and each having their own volume property + mapper and all being rendered by the same renderer. The only other solution I've thought of would be to make a special reader that works with multiple files, and which, based on the requested extent loads data from these files. I would then only have a single ExtractVOI which extracts the required volume, and the reader takes care of loading the required data to form a volume based on what is currently in view. But I'm not sure I like this idea because I think down the road I'd like it to be multiple volumes, not just one. Another question is interactivity: I realize that it's probably unrealistic to have a scrollbar the way I've drawn it in the sketch, since loading the volumes will be quite intensive and block the UI for a while, which would make the scrolling operation "jerky". I've read that there are some problems with putting parts of a VTK pipeline in a separate thread, but is there any way threading could help me out here? If not, I think I'll go with simpler left/right buttons, which would move the view by some fixed amount. I think then the user would be more forgiving with the UI blocking for a short while while the new volume data is loaded. I'm very grateful for any advice here, as I'm new to VTK. Has anyone done something similar to this before? Cheers, Elvis -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: multi_volume_view.png Type: image/png Size: 23029 bytes Desc: not available URL: From elvis.stansvik at orexplore.com Fri Apr 15 08:54:56 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 15 Apr 2016 14:54:56 +0200 Subject: [vtkusers] Use transfer function editors from Python? Message-ID: Hi all, I'd like to use the transfer function editors that VTK seems to provide (used by e.g. Paraview) from Python. Is it possible? Looking at http://www.vtk.org/pipermail/vtkusers/2013-December/082410.html I read the slightly worrying: "[...] Save/restore state and python interface are not working as expected. [...]" Though that was an old message when the new editors were first introduced in 2013. Is it still the case that the Python interface for the editor classes is not working as expected? Does anyone know of a Python application/example that makes use of the editors? (I'm using VTK 6.2 and PyQt 5.5.1). Thanks, Elvis -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.j.brown at live.co.uk Fri Apr 15 09:13:24 2016 From: richard.j.brown at live.co.uk (mbcx9rb9) Date: Fri, 15 Apr 2016 06:13:24 -0700 (MST) Subject: [vtkusers] vtkChartXY picking Message-ID: <1460726004464-5737711.post@n5.nabble.com> Hi all, I'd like to create a custom interactor for vtkChartXY (inherited from vtkContextInteractorStyle), but I can't figure out how to select single points with the left click of the mouse. Once I manage to that, I would need to return the index of the selected point. This seems very straightforward to me, but I haven't seen any concrete examples. Any pointers would be greatly appreciated. Regards, Richard -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp5737711.html Sent from the VTK - Users mailing list archive at Nabble.com. From matimontg at gmail.com Fri Apr 15 09:20:53 2016 From: matimontg at gmail.com (Matias Montroull) Date: Fri, 15 Apr 2016 13:20:53 +0000 Subject: [vtkusers] (no subject) Message-ID: Hi, I was trying to build ActiViz 6.3 and I received the following error: LINK : fatal error LNK1104: cannot open file 'vtkRenderingFreeTypeOpenGL.lib' ActiViz 6.2 compiled just fine so it seems that the RenderingFreeTypeOpenGL module no longer exists in version VTK 6.3 and later Any way to remove this error? I would think the ActiViz source code will need to be patched? By the way, I'm using a an ActiViz git source I cloned back in September 2015 Thank you, Matias. -- Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Fri Apr 15 09:27:26 2016 From: matimontg at gmail.com (Matias Montroull) Date: Fri, 15 Apr 2016 13:27:26 +0000 Subject: [vtkusers] Building ActiViz 6.3 | vtkRenderingFreeTypeOpenGL Problem Message-ID: Hi, I was trying to build ActiViz 6.3 and I received the following error: LINK : fatal error LNK1104: cannot open file 'vtkRenderingFreeTypeOpenGL.lib' ActiViz 6.2 compiled just fine so it seems that the RenderingFreeTypeOpenGL module no longer exists in version VTK 6.3 and later Any way to remove this error? I would think the ActiViz source code will need to be patched? By the way, I'm using a an ActiViz git source I cloned back in September 2015 Thank you, Matias. -- Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Apr 15 09:46:12 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 15 Apr 2016 07:46:12 -0600 Subject: [vtkusers] Disable mouse interaction on overlaid image In-Reply-To: References: Message-ID: Hi Jothy, Have you had a chance to test the changes yet? - David On Wed, Apr 13, 2016 at 5:53 PM, Jothybasu Selvaraj wrote: > Great! > > Thanks very much! > > Jothy > > On Thu, Apr 14, 2016 at 9:08 AM, David Gobbi > wrote: > >> Hi Jothy, >> >> I've added a change so that SetCurrentImageToNthImage is public: >> https://gitlab.kitware.com/vtk/vtk/merge_requests/1421/diffs >> >> If you're not sure about how to get the changes with git, then you can >> download the files here: >> >> https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.h >> >> https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.cxx >> >> Please test to see if this solves the issue. >> >> - David >> >> >> >> >> On Tue, Apr 12, 2016 at 6:18 PM, Jothybasu Selvaraj >> wrote: >> >>> I would rather like to have this SetCurrentImageToNthImage to be public >>> and user definable. >>> >>> >>> Jothy >>> >>> On Wed, Apr 13, 2016 at 10:15 AM, Jothybasu Selvaraj < >>> jothybasu at gmail.com> wrote: >>> >>>> Hi David >>>> >>>> I am not familiar with using Gitlab. So, I subclassed >>>> vtkInteractorStyleImage and override SetCurrentImageToNthImage(). >>>> >>>> Still it didn't work, because the layer number is hardcoded into StartWindowLevel() >>>> with this->SetCurrentImageToNthImage(-1); So the mouse only interacts with >>>> the last image. I changed it to "0" so that it pick the first image. >>>> >>>> It solves my problem. I only want to interact with the first image :). >>>> >>>> >>>> Thank a lot for your inputs. >>>> >>>> >>>> Cheers >>>> >>>> Jothy >>>> >>>> On Wed, Apr 13, 2016 at 8:42 AM, David Gobbi >>>> wrote: >>>> >>>>> Hi Jothy, >>>>> >>>>> Can you try the code change in the following merge request to >>>>> see if it fixes the problem? >>>>> >>>>> https://gitlab.kitware.com/vtk/vtk/merge_requests/1421 >>>>> >>>>> - David >>>>> >>>>> >>>>> On Tue, Apr 12, 2016 at 4:05 PM, Jothybasu Selvaraj < >>>>> jothybasu at gmail.com> wrote: >>>>> >>>>>> Yes, I use vtkInteractorStyleImage. >>>>>> >>>>>> Cheers >>>>>> >>>>>> Jothy >>>>>> >>>>>> On Tue, Apr 12, 2016 at 10:16 PM, David Gobbi >>>>>> wrote: >>>>>> >>>>>>> Hi Jothy, >>>>>>> >>>>>>> Are you using vtkInteractionStyleImage? I checked the code, and it >>>>>>> doesn't >>>>>>> seem to check the pickability of the image. Specifically, I mean >>>>>>> the code in >>>>>>> SetCurrentImageToNthImage(), which is called by StartWindowLevel(). >>>>>>> >>>>>>> - David >>>>>>> >>>>>>> On Tue, Apr 12, 2016 at 12:44 AM, Jothybasu Selvaraj < >>>>>>> jothybasu at gmail.com> wrote: >>>>>>> >>>>>>>> Dear All >>>>>>>> >>>>>>>> I an image overlaid on another image. I only want mouse interaction >>>>>>>> such as window level change on only one image. How do I do that? >>>>>>>> >>>>>>>> I tried pickable off,on the second image but it doesn't work. >>>>>>>> >>>>>>>> Any help is highly appreciated! >>>>>>>> >>>>>>>> >>>>>>>> Regards >>>>>>>> >>>>>>>> Jothy >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Fri Apr 15 10:09:00 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Fri, 15 Apr 2016 10:09:00 -0400 Subject: [vtkusers] Use transfer function editors from Python? In-Reply-To: References: Message-ID: Hi Elvis, Have a look at http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Charts/Core/Testing/Cxx/TestScalarsToColors.cxx for an example of how to set up the transfer function editors used in ParaView. You can eliminate the check at the end for vtkOpenGL2ContextDevice2D - make sure to initialize and start the interactor, though. I don't see anything in this example that won't work in Python - if there is, please report back any problems you encounter. HTH, Cory On Fri, Apr 15, 2016 at 8:54 AM, Elvis Stansvik wrote: > Hi all, > > I'd like to use the transfer function editors that VTK seems to provide > (used by e.g. Paraview) from Python. Is it possible? > > Looking at > > http://www.vtk.org/pipermail/vtkusers/2013-December/082410.html > > I read the slightly worrying: > > "[...] Save/restore state and python interface are not working as > expected. [...]" > > Though that was an old message when the new editors were first introduced in > 2013. Is it still the case that the Python interface for the editor classes > is not working as expected? > > Does anyone know of a Python application/example that makes use of the > editors? (I'm using VTK 6.2 and PyQt 5.5.1). > > Thanks, > Elvis > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen R&D Engineer Kitware, Inc. From l.paul at uclouvain.be Fri Apr 15 10:25:28 2016 From: l.paul at uclouvain.be (Laurent) Date: Fri, 15 Apr 2016 07:25:28 -0700 (MST) Subject: [vtkusers] Angle between two vectors In-Reply-To: <8D0D9CEA6D5FF82-22C0-2B82D@webmail-d246.sysops.aol.com> References: <1388814180.35712.YahooMailNeo@web125605.mail.ne1.yahoo.com> <8D0D77966A44917-1B34-17397@webmail-d269.sysops.aol.com> <8D0D9136F090E1E-1C58-2344C@webmail-vd013.sysops.aol.com> <20140106184852.377346375@mail.rogue-research.com> <8D0D9CEA6D5FF82-22C0-2B82D@webmail-d246.sysops.aol.com> Message-ID: <1460730328174-5737716.post@n5.nabble.com> Dear users, Sorry to dig up this post, but I'm troubled by the results I get. I used to use the acos() method until I found out that the resulting values were poor. We fixed it using the atan2 method instead. Seems working much better! David (Gobbi), could you elaborate a bit on the error when the angle approaches 0? I mean, I get huge differences between both methods. As an example, I get atan2 Vs acos (in degres): - 3.67 Vs 10.08 - 11.03 Vs 15.82 - 3.24 Vs 20.02 - 7.78 Vs 20.05 - ... How to explain these differences? I've checked if clamp values would give better results but the dot produces values between -1 and +1. I've checked multiple times if there was no mistake, and there's not. I'm horrified! Since I use the python/numpy distribution from paraview 4.1, AngleBetweenVectors in not implmented and I had to reimplement the calculation; That's why I jumped into it more deeply. Thanks, Laurent. -- View this message in context: http://vtk.1045678.n5.nabble.com/Angle-between-two-vectors-tp5725202p5737716.html Sent from the VTK - Users mailing list archive at Nabble.com. From elvis.stansvik at orexplore.com Fri Apr 15 10:36:07 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 15 Apr 2016 16:36:07 +0200 Subject: [vtkusers] Use transfer function editors from Python? In-Reply-To: References: Message-ID: 2016-04-15 16:09 GMT+02:00 Cory Quammen : > Hi Elvis, > > Have a look at > > > http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Charts/Core/Testing/Cxx/TestScalarsToColors.cxx > > for an example of how to set up the transfer function editors used in > ParaView. > > You can eliminate the check at the end for vtkOpenGL2ContextDevice2D - > make sure to initialize and start the interactor, though. > > I don't see anything in this example that won't work in Python - if > there is, please report back any problems you encounter. > Excellent, thanks a lot. I'll report back how it went. Elvis > > HTH, > Cory > > On Fri, Apr 15, 2016 at 8:54 AM, Elvis Stansvik > wrote: > > Hi all, > > > > I'd like to use the transfer function editors that VTK seems to provide > > (used by e.g. Paraview) from Python. Is it possible? > > > > Looking at > > > > http://www.vtk.org/pipermail/vtkusers/2013-December/082410.html > > > > I read the slightly worrying: > > > > "[...] Save/restore state and python interface are not working as > > expected. [...]" > > > > Though that was an old message when the new editors were first > introduced in > > 2013. Is it still the case that the Python interface for the editor > classes > > is not working as expected? > > > > Does anyone know of a Python application/example that makes use of the > > editors? (I'm using VTK 6.2 and PyQt 5.5.1). > > > > Thanks, > > Elvis > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Apr 15 11:10:39 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 15 Apr 2016 09:10:39 -0600 Subject: [vtkusers] Angle between two vectors In-Reply-To: <1460730328174-5737716.post@n5.nabble.com> References: <1388814180.35712.YahooMailNeo@web125605.mail.ne1.yahoo.com> <8D0D77966A44917-1B34-17397@webmail-d269.sysops.aol.com> <8D0D9136F090E1E-1C58-2344C@webmail-vd013.sysops.aol.com> <20140106184852.377346375@mail.rogue-research.com> <8D0D9CEA6D5FF82-22C0-2B82D@webmail-d246.sysops.aol.com> <1460730328174-5737716.post@n5.nabble.com> Message-ID: Hi Laurent, The differences between acos() and atan2() are on the order of 1e-10, so they cannot explain the huge differences that you are seeing in your results. You almost definitely made a mistake in your code, e.g. forgetting to normalize a vector. - David On Fri, Apr 15, 2016 at 8:25 AM, Laurent wrote: > Dear users, > > Sorry to dig up this post, but I'm troubled by the results I get. > I used to use the acos() method until I found out that the resulting values > were poor. > We fixed it using the atan2 method instead. Seems working much better! > > David (Gobbi), could you elaborate a bit on the error when the angle > approaches 0? > I mean, I get huge differences between both methods. As an example, I get > atan2 Vs acos (in degres): > - 3.67 Vs 10.08 > - 11.03 Vs 15.82 > - 3.24 Vs 20.02 > - 7.78 Vs 20.05 > - ... > > How to explain these differences? > I've checked if clamp values would give better results but the dot produces > values between -1 and +1. > I've checked multiple times if there was no mistake, and there's not. > I'm horrified! > > Since I use the python/numpy distribution from paraview 4.1, > AngleBetweenVectors in not implmented and I had to reimplement the > calculation; That's why I jumped into it more deeply. > > Thanks, > Laurent. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Fri Apr 15 11:46:57 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 15 Apr 2016 17:46:57 +0200 Subject: [vtkusers] Use transfer function editors from Python? In-Reply-To: References: Message-ID: 2016-04-15 16:36 GMT+02:00 Elvis Stansvik : > 2016-04-15 16:09 GMT+02:00 Cory Quammen : > >> Hi Elvis, >> >> Have a look at >> >> >> http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Charts/Core/Testing/Cxx/TestScalarsToColors.cxx >> >> for an example of how to set up the transfer function editors used in >> ParaView. >> >> You can eliminate the check at the end for vtkOpenGL2ContextDevice2D - >> make sure to initialize and start the interactor, though. >> >> I don't see anything in this example that won't work in Python - if >> there is, please report back any problems you encounter. >> > > Excellent, thanks a lot. I'll report back how it went. > Worked like a charm :) It's not quite the same as the editors in ParaView though. In ParaView, the opacity and color transfer functions are edited separately, like this: https://blog.kitware.com/blog/files/48_1536770536.png Do you know if it's possible to get that kind of editing through VTK classes, with the color transfer function edited using a gradient editor below and the X/Y editor only for the the opacity transfer function, or is ParaView doing something custom here? (I the class vtkCompositeTransferFunctionItem has "composite" in its name precisely because it provides editing of both color/opacity in the same editor, while I would like the separated approach that ParaView has.) Elvis > Elvis > > >> >> HTH, >> Cory >> >> On Fri, Apr 15, 2016 at 8:54 AM, Elvis Stansvik >> wrote: >> > Hi all, >> > >> > I'd like to use the transfer function editors that VTK seems to provide >> > (used by e.g. Paraview) from Python. Is it possible? >> > >> > Looking at >> > >> > http://www.vtk.org/pipermail/vtkusers/2013-December/082410.html >> > >> > I read the slightly worrying: >> > >> > "[...] Save/restore state and python interface are not working as >> > expected. [...]" >> > >> > Though that was an old message when the new editors were first >> introduced in >> > 2013. Is it still the case that the Python interface for the editor >> classes >> > is not working as expected? >> > >> > Does anyone know of a Python application/example that makes use of the >> > editors? (I'm using VTK 6.2 and PyQt 5.5.1). >> > >> > Thanks, >> > Elvis >> > >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/vtkusers >> > >> >> >> >> -- >> Cory Quammen >> R&D Engineer >> Kitware, Inc. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Fri Apr 15 12:51:29 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Fri, 15 Apr 2016 12:51:29 -0400 Subject: [vtkusers] Use transfer function editors from Python? In-Reply-To: References: Message-ID: On Fri, Apr 15, 2016 at 11:46 AM, Elvis Stansvik wrote: > 2016-04-15 16:36 GMT+02:00 Elvis Stansvik : >> >> 2016-04-15 16:09 GMT+02:00 Cory Quammen : >>> >>> Hi Elvis, >>> >>> Have a look at >>> >>> >>> http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Charts/Core/Testing/Cxx/TestScalarsToColors.cxx >>> >>> for an example of how to set up the transfer function editors used in >>> ParaView. >>> >>> You can eliminate the check at the end for vtkOpenGL2ContextDevice2D - >>> make sure to initialize and start the interactor, though. >>> >>> I don't see anything in this example that won't work in Python - if >>> there is, please report back any problems you encounter. >> >> >> Excellent, thanks a lot. I'll report back how it went. > > > Worked like a charm :) It's not quite the same as the editors in ParaView > though. In ParaView, the opacity and color transfer functions are edited > separately, like this: > > https://blog.kitware.com/blog/files/48_1536770536.png > > Do you know if it's possible to get that kind of editing through VTK > classes, with the color transfer function edited using a gradient editor > below and the X/Y editor only for the the opacity transfer function, or is > ParaView doing something custom here? Yes. You can use a vtkPiecewiseFunctionItem and vtkPiecewiseControlePointsItem to edit the opacity function and a vtkColorTransferFunctionItem and a vtkColorTransferControlPointsItem to edit the color transfer function. These can be displayed in two separate widgets, much like ParaView does. In each widget, you can have a vtkContextView. This is probably the easiest implementation for what you are after. Cory > (I the class vtkCompositeTransferFunctionItem has "composite" in its name > precisely because it provides editing of both color/opacity in the same > editor, while I would like the separated approach that ParaView has.) > > Elvis > >> >> Elvis >> >>> >>> >>> HTH, >>> Cory >>> >>> On Fri, Apr 15, 2016 at 8:54 AM, Elvis Stansvik >>> wrote: >>> > Hi all, >>> > >>> > I'd like to use the transfer function editors that VTK seems to provide >>> > (used by e.g. Paraview) from Python. Is it possible? >>> > >>> > Looking at >>> > >>> > http://www.vtk.org/pipermail/vtkusers/2013-December/082410.html >>> > >>> > I read the slightly worrying: >>> > >>> > "[...] Save/restore state and python interface are not working as >>> > expected. [...]" >>> > >>> > Though that was an old message when the new editors were first >>> > introduced in >>> > 2013. Is it still the case that the Python interface for the editor >>> > classes >>> > is not working as expected? >>> > >>> > Does anyone know of a Python application/example that makes use of the >>> > editors? (I'm using VTK 6.2 and PyQt 5.5.1). >>> > >>> > Thanks, >>> > Elvis >>> > >>> > _______________________________________________ >>> > Powered by www.kitware.com >>> > >>> > Visit other Kitware open-source projects at >>> > http://www.kitware.com/opensource/opensource.html >>> > >>> > Please keep messages on-topic and check the VTK FAQ at: >>> > http://www.vtk.org/Wiki/VTK_FAQ >>> > >>> > Search the list archives at: http://markmail.org/search/?q=vtkusers >>> > >>> > Follow this link to subscribe/unsubscribe: >>> > http://public.kitware.com/mailman/listinfo/vtkusers >>> > >>> >>> >>> >>> -- >>> Cory Quammen >>> R&D Engineer >>> Kitware, Inc. >> >> > -- Cory Quammen R&D Engineer Kitware, Inc. From elvis.stansvik at orexplore.com Fri Apr 15 12:54:58 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 15 Apr 2016 18:54:58 +0200 Subject: [vtkusers] Use transfer function editors from Python? In-Reply-To: References: Message-ID: 2016-04-15 18:51 GMT+02:00 Cory Quammen : > On Fri, Apr 15, 2016 at 11:46 AM, Elvis Stansvik > wrote: > > 2016-04-15 16:36 GMT+02:00 Elvis Stansvik >: > >> > >> 2016-04-15 16:09 GMT+02:00 Cory Quammen : > >>> > >>> Hi Elvis, > >>> > >>> Have a look at > >>> > >>> > >>> > http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Charts/Core/Testing/Cxx/TestScalarsToColors.cxx > >>> > >>> for an example of how to set up the transfer function editors used in > >>> ParaView. > >>> > >>> You can eliminate the check at the end for vtkOpenGL2ContextDevice2D - > >>> make sure to initialize and start the interactor, though. > >>> > >>> I don't see anything in this example that won't work in Python - if > >>> there is, please report back any problems you encounter. > >> > >> > >> Excellent, thanks a lot. I'll report back how it went. > > > > > > Worked like a charm :) It's not quite the same as the editors in ParaView > > though. In ParaView, the opacity and color transfer functions are edited > > separately, like this: > > > > https://blog.kitware.com/blog/files/48_1536770536.png > > > > Do you know if it's possible to get that kind of editing through VTK > > classes, with the color transfer function edited using a gradient editor > > below and the X/Y editor only for the the opacity transfer function, or > is > > ParaView doing something custom here? > > Yes. You can use a vtkPiecewiseFunctionItem and > vtkPiecewiseControlePointsItem to edit the opacity function and a > vtkColorTransferFunctionItem and a vtkColorTransferControlPointsItem > to edit the color transfer function. These can be displayed in two > separate widgets, much like ParaView does. In each widget, you can > have a vtkContextView. This is probably the easiest implementation for > what you are after. > Ah, excellent. Thanks. It was the vtkPiecewiseFunctionItem I was missing. Was searching for something called "opacity" or somesuch, but makes sense it's just a general piecewise function editor class. Elvis > Cory > > > (I the class vtkCompositeTransferFunctionItem has "composite" in its name > > precisely because it provides editing of both color/opacity in the same > > editor, while I would like the separated approach that ParaView has.) > > > > Elvis > > > >> > >> Elvis > >> > >>> > >>> > >>> HTH, > >>> Cory > >>> > >>> On Fri, Apr 15, 2016 at 8:54 AM, Elvis Stansvik > >>> wrote: > >>> > Hi all, > >>> > > >>> > I'd like to use the transfer function editors that VTK seems to > provide > >>> > (used by e.g. Paraview) from Python. Is it possible? > >>> > > >>> > Looking at > >>> > > >>> > http://www.vtk.org/pipermail/vtkusers/2013-December/082410.html > >>> > > >>> > I read the slightly worrying: > >>> > > >>> > "[...] Save/restore state and python interface are not working as > >>> > expected. [...]" > >>> > > >>> > Though that was an old message when the new editors were first > >>> > introduced in > >>> > 2013. Is it still the case that the Python interface for the editor > >>> > classes > >>> > is not working as expected? > >>> > > >>> > Does anyone know of a Python application/example that makes use of > the > >>> > editors? (I'm using VTK 6.2 and PyQt 5.5.1). > >>> > > >>> > Thanks, > >>> > Elvis > >>> > > >>> > _______________________________________________ > >>> > Powered by www.kitware.com > >>> > > >>> > Visit other Kitware open-source projects at > >>> > http://www.kitware.com/opensource/opensource.html > >>> > > >>> > Please keep messages on-topic and check the VTK FAQ at: > >>> > http://www.vtk.org/Wiki/VTK_FAQ > >>> > > >>> > Search the list archives at: http://markmail.org/search/?q=vtkusers > >>> > > >>> > Follow this link to subscribe/unsubscribe: > >>> > http://public.kitware.com/mailman/listinfo/vtkusers > >>> > > >>> > >>> > >>> > >>> -- > >>> Cory Quammen > >>> R&D Engineer > >>> Kitware, Inc. > >> > >> > > > > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Ilene.Cohen at bsci.com Fri Apr 15 12:55:43 2016 From: Ilene.Cohen at bsci.com (Cohen, Ilene) Date: Fri, 15 Apr 2016 16:55:43 +0000 Subject: [vtkusers] VTK and Cmake Message-ID: <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE21A@STPEXDAGPG05N2.bsci.bossci.com> Hi, We are building our application using CMake v2.8.4 and are not able to upgrade at this time. We have built a tool that links to VTK 7.0.0 using CMake v2.8.8. This tool is called by our application. We want to be able to build our application on machines that have only CMakev 2.8.4. Is this possible? If so, how can we do it? Or do we need to use an older version of VTK - if so, which version? Thanks for any assistance you can provide. Ilene Ilene Cohen, MD Principal Engineer Software Boston Scientific Rhythm Management Ilene.Cohen at bsci.com 617-218-3895 C: 781-439-2784 125 Cambridge Park Drive, Cambridge MA www.bostonscientific.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Fri Apr 15 13:17:11 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Fri, 15 Apr 2016 13:17:11 -0400 Subject: [vtkusers] VTK and Cmake In-Reply-To: <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE21A@STPEXDAGPG05N2.bsci.bossci.com> References: <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE21A@STPEXDAGPG05N2.bsci.bossci.com> Message-ID: Ilene, It looks like you need to go back to VTK 5.8 to build with 2.8.4. > git show v5.8.0:CMakeLists.txt CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) > git show v6.0.0:CMakeLists.txt cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR) HTH, Cory On Fri, Apr 15, 2016 at 12:55 PM, Cohen, Ilene wrote: > Hi, > > We are building our application using CMake v2.8.4 and are not able to > upgrade at this time. We have built a tool that links to VTK 7.0.0 using > CMake v2.8.8. This tool is called by our application. We want to be able to > build our application on machines that have only CMakev 2.8.4. Is this > possible? If so, how can we do it? Or do we need to use an older version of > VTK - if so, which version? Thanks for any assistance you can provide. > > Ilene > > Ilene Cohen, MD > Principal Engineer Software > Boston Scientific > Rhythm Management > Ilene.Cohen at bsci.com > 617-218-3895 C: 781-439-2784 > 125 Cambridge Park Drive, Cambridge MA > www.bostonscientific.com > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen R&D Engineer Kitware, Inc. From david.gobbi at gmail.com Fri Apr 15 13:23:22 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 15 Apr 2016 11:23:22 -0600 Subject: [vtkusers] VTK and Cmake In-Reply-To: References: <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE21A@STPEXDAGPG05N2.bsci.bossci.com> Message-ID: Not quite that far back, VTK 5.10.1 should work. Modifying VTK 7 to make it work with CMake 2.8.4 would be a lot of work, even for a cmake guru. - David On Fri, Apr 15, 2016 at 11:17 AM, Cory Quammen wrote: > Ilene, > > It looks like you need to go back to VTK 5.8 to build with 2.8.4. > > > git show v5.8.0:CMakeLists.txt > > CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) > > > git show v6.0.0:CMakeLists.txt > > cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR) > > HTH, > Cory > > On Fri, Apr 15, 2016 at 12:55 PM, Cohen, Ilene > wrote: > > Hi, > > > > We are building our application using CMake v2.8.4 and are not able to > > upgrade at this time. We have built a tool that links to VTK 7.0.0 using > > CMake v2.8.8. This tool is called by our application. We want to be able > to > > build our application on machines that have only CMakev 2.8.4. Is this > > possible? If so, how can we do it? Or do we need to use an older version > of > > VTK - if so, which version? Thanks for any assistance you can provide. > > > > Ilene > > > > Ilene Cohen, MD > > Principal Engineer Software > > Boston Scientific > > Rhythm Management > > Ilene.Cohen at bsci.com > > 617-218-3895 C: 781-439-2784 > > 125 Cambridge Park Drive, Cambridge MA > > www.bostonscientific.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Fri Apr 15 13:35:27 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 15 Apr 2016 13:35:27 -0400 Subject: [vtkusers] VTK and Cmake In-Reply-To: References: <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE21A@STPEXDAGPG05N2.bsci.bossci.com> Message-ID: Ilene could probably build VTK and here project separately right? Once you have VTK built, you don't necessarily need CMake to build your own project that links into and uses VTK. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Apr 15, 2016 at 1:23 PM, David Gobbi wrote: > Not quite that far back, VTK 5.10.1 should work. > > Modifying VTK 7 to make it work with CMake 2.8.4 would be a lot > of work, even for a cmake guru. > > - David > > > On Fri, Apr 15, 2016 at 11:17 AM, Cory Quammen > wrote: > >> Ilene, >> >> It looks like you need to go back to VTK 5.8 to build with 2.8.4. >> >> > git show v5.8.0:CMakeLists.txt >> >> CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) >> >> > git show v6.0.0:CMakeLists.txt >> >> cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR) >> >> HTH, >> Cory >> >> On Fri, Apr 15, 2016 at 12:55 PM, Cohen, Ilene >> wrote: >> > Hi, >> > >> > We are building our application using CMake v2.8.4 and are not able to >> > upgrade at this time. We have built a tool that links to VTK 7.0.0 using >> > CMake v2.8.8. This tool is called by our application. We want to be >> able to >> > build our application on machines that have only CMakev 2.8.4. Is this >> > possible? If so, how can we do it? Or do we need to use an older >> version of >> > VTK - if so, which version? Thanks for any assistance you can provide. >> > >> > Ilene >> > >> > Ilene Cohen, MD >> > Principal Engineer Software >> > Boston Scientific >> > Rhythm Management >> > Ilene.Cohen at bsci.com >> > 617-218-3895 C: 781-439-2784 >> > 125 Cambridge Park Drive, Cambridge MA >> > www.bostonscientific.com >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.ei at novodynamics.com Fri Apr 15 13:40:57 2016 From: david.ei at novodynamics.com (dei) Date: Fri, 15 Apr 2016 10:40:57 -0700 (MST) Subject: [vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper Message-ID: <1460742057180-5737734.post@n5.nabble.com> I'm attempting to add a VTK 3D mesh viewer to our java app which builds a triangular mesh from a CAT scan image series. I'm using the VTK-Java vtkRenderWindowPanel class to embed the VTK viewer into a JTabbedPane of our app. It works some of the time, but occasionally crashes with an Access Violation in the unmanaged vtkShaderProgram->FindUniform() function. I was able to break on a crash in a C++ debugger. It crashes attempting to dereference a null vtkShaderProgram 'this' pointer. I'm not sure how FindUniform() could be invoked with a null 'this' pointer? Maybe because FindUniform() is an inline function? Anyway, I've been able to crawl the call stack and find out that vtkOpenGLPolyDataMapper contains a "Tris" object, which has a null 'Program', which eventually ends up as the null 'this' pointer. I haven't yet figured out what a 'Tris' is or how it is initialized. I researched the vtkShaderProgram and it seems that it should be managed by vtkOpenGLPolyDataMapper. I tried updating my NVIDIA video driver but it made no difference. I am very new to VTK and don't yet have a grasp of the 'big picture'. I apologize if these are very newbie questions: Is there a way to force the initialization of the default vtkShaderProgram? Is there a way to check to see that it has been initialized? What has to occur to initialize it? Any other suggestions would be welcome. I should mention that a very simple java app that (no dicom, or CAT image processing) that uses the same VTK initialization logic seems to be 100% reliable. The call stack looks like: > vtkRenderingOpenGL2-7.0.dll!vtkShaderProgram::FindUniform(const char * name=0x000007fedd9d4dd8) Line 772 C++ vtkRenderingOpenGL2-7.0.dll!vtkShaderProgram::SetUniformi(const char * name=0x000007fedd9d4dd8, int i=0) Line 498 C++ vtkRenderingOpenGL2-7.0.dll!vtkOpenGLPolyDataMapper::SetMapperShaderParameters(vtkOpenGLHelper & cellBO={...}, vtkRenderer * ren=0x00000000538a5980, vtkActor * actor=0x0000000053975d40) Line 1451 C++ vtkRenderingOpenGL2-7.0.dll!vtkOpenGLPolyDataMapper::UpdateShaders(vtkOpenGLHelper & cellBO={...}, vtkRenderer * ren=0x00000000538a5980, vtkActor * actor=0x0000000053975d40) Line 1433 C++ vtkRenderingOpenGL2-7.0.dll!vtkOpenGLPolyDataMapper::RenderPieceDraw(vtkRenderer * ren=0x00000000538a5980, vtkActor * actor=0x0000000053975d40) Line 2087 C++ vtkRenderingOpenGL2-7.0.dll!vtkOpenGLPolyDataMapper::RenderPiece(vtkRenderer * ren=0x00000000538a5980, vtkActor * actor=0x0000000053975d40) Line 2240 C++ vtkRenderingCore-7.0.dll!vtkPolyDataMapper::Render(vtkRenderer * ren=0x00000000538a5980, vtkActor * act=0x0000000053975d40) Line 64 C++ vtkRenderingOpenGL2-7.0.dll!vtkOpenGLActor::Render(vtkRenderer * ren=0x00000000538a5980, vtkMapper * mapper=0x000000005398a930) Line 86 C++ vtkRenderingCore-7.0.dll!vtkActor::RenderOpaqueGeometry(vtkViewport * vp=0x00000000538a5980) Line 196 C++ vtkRenderingOpenGL2-7.0.dll!vtkOpenGLRenderer::UpdateGeometry() Line 211 C++ vtkRenderingOpenGL2-7.0.dll!vtkOpenGLRenderer::DeviceRender() Line 159 C++ vtkRenderingCore-7.0.dll!vtkRenderer::Render() Line 317 C++ vtkRenderingCore-7.0.dll!vtkRendererCollection::Render() Line 53 C++ vtkRenderingCore-7.0.dll!vtkRenderWindow::DoStereoRender() Line 775 C++ vtkRenderingCore-7.0.dll!vtkRenderWindow::DoFDRender() Line 743 C++ vtkRenderingCore-7.0.dll!vtkRenderWindow::DoAARender() Line 622 C++ vtkRenderingCore-7.0.dll!vtkRenderWindow::Render() Line 438 C++ vtkRenderingOpenGL2-7.0.dll!vtkOpenGLRenderWindow::Render() Line 600 C++ vtkRenderingCoreJava.dll!Java_vtk_vtkRenderWindow_Render_19(JNIEnv_ * env=0x000000004d7e79f8, _jobject * obj=0x000000021b00c790) Line 123 C++ 0000000021bca86c() Unknown ... Best Regards, David Ei -- View this message in context: http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734.html Sent from the VTK - Users mailing list archive at Nabble.com. From dave.demarle at kitware.com Fri Apr 15 13:45:29 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 15 Apr 2016 13:45:29 -0400 Subject: [vtkusers] VTK and Cmake In-Reply-To: <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE2CA@STPEXDAGPG05N2.bsci.bossci.com> References: <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE21A@STPEXDAGPG05N2.bsci.bossci.com> <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE2CA@STPEXDAGPG05N2.bsci.bossci.com> Message-ID: That is tougher. I am pretty sure that CMake's ExternalProject's (aka superbuilds) don't support that. I imaging you might have a custom external project stage fire off a process that builds VTK independently with a different CMake. You might want to ask on the CMake list to see how feasible that is as I am certainly no expert with this. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Apr 15, 2016 at 1:40 PM, Cohen, Ilene wrote: > That would be great but we are building the tool (that links to VTK) from > a top-level cmake for the whole project. How would we do that? > > *Ilene Cohen, MD* > Principal Engineer Software > Boston Scientific > Rhythm Management > Ilene.Cohen at bsci.com > 617-218-3895 C: 781-439-2784 > 125 Cambridge Park Drive, Cambridge MA > www.bostonscientific.com > > ------------------------------ > *From:* David E DeMarle [dave.demarle at kitware.com] > *Sent:* Friday, April 15, 2016 1:35 PM > *To:* David Gobbi > *Cc:* Cohen, Ilene; Cory Quammen; vtkusers at vtk.org > *Subject:* Re: [vtkusers] VTK and Cmake > > Ilene could probably build VTK and here project separately right? Once you > have VTK built, you don't necessarily need CMake to build your own project > that links into and uses VTK. > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > On Fri, Apr 15, 2016 at 1:23 PM, David Gobbi > wrote: > >> Not quite that far back, VTK 5.10.1 should work. >> >> Modifying VTK 7 to make it work with CMake 2.8.4 would be a lot >> of work, even for a cmake guru. >> >> - David >> >> >> On Fri, Apr 15, 2016 at 11:17 AM, Cory Quammen >> wrote: >> >>> Ilene, >>> >>> It looks like you need to go back to VTK 5.8 to build with 2.8.4. >>> >>> > git show v5.8.0:CMakeLists.txt >>> >>> CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) >>> >>> > git show v6.0.0:CMakeLists.txt >>> >>> cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR) >>> >>> HTH, >>> Cory >>> >>> On Fri, Apr 15, 2016 at 12:55 PM, Cohen, Ilene >>> wrote: >>> > Hi, >>> > >>> > We are building our application using CMake v2.8.4 and are not able to >>> > upgrade at this time. We have built a tool that links to VTK 7.0.0 >>> using >>> > CMake v2.8.8. This tool is called by our application. We want to be >>> able to >>> > build our application on machines that have only CMakev 2.8.4. Is this >>> > possible? If so, how can we do it? Or do we need to use an older >>> version of >>> > VTK - if so, which version? Thanks for any assistance you can provide. >>> > >>> > Ilene >>> > >>> > Ilene Cohen, MD >>> > Principal Engineer Software >>> > Boston Scientific >>> > Rhythm Management >>> > Ilene.Cohen at bsci.com >>> > 617-218-3895 C: 781-439-2784 >>> > 125 Cambridge Park Drive, Cambridge MA >>> > www.bostonscientific.com >>> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Fri Apr 15 14:07:57 2016 From: ken.martin at kitware.com (Ken Martin) Date: Fri, 15 Apr 2016 14:07:57 -0400 Subject: [vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper In-Reply-To: <1460742057180-5737734.post@n5.nabble.com> References: <1460742057180-5737734.post@n5.nabble.com> Message-ID: Usually that crash means something failing in initializing OpenGL (or the shader program hit something the local system could not handle) and it crashes later on when it first dereferences the shader program. Usually VTK is good about displaying an error message in those cases (and usually it fails 100% of the time for a given system, not sometimes) If you have built VTK with testing on you can run ctest -R VBOPLY or ctest -R Apple both do a sanity check to see if the hardware has reasonable OpenGL support. Assuming those work OK I would suspect the issue it related to a multi window or multithreading issue where VTK is doing something when OpenGL is set to a different context or thread. Ken On Fri, Apr 15, 2016 at 1:40 PM, dei wrote: > I'm attempting to add a VTK 3D mesh viewer to our java app which builds a > triangular mesh from a CAT scan image series. I'm using the VTK-Java > vtkRenderWindowPanel class to embed the VTK viewer into a JTabbedPane of > our > app. It works some of the time, but occasionally crashes with an Access > Violation in the unmanaged vtkShaderProgram->FindUniform() function. > > I was able to break on a crash in a C++ debugger. It crashes attempting to > dereference a null vtkShaderProgram 'this' pointer. I'm not sure how > FindUniform() could be invoked with a null 'this' pointer? Maybe because > FindUniform() is an inline function? Anyway, I've been able to crawl the > call stack and find out that vtkOpenGLPolyDataMapper contains a "Tris" > object, which has a null 'Program', which eventually ends up as the null > 'this' pointer. I haven't yet figured out what a 'Tris' is or how it is > initialized. > > I researched the vtkShaderProgram and it seems that it should be managed by > vtkOpenGLPolyDataMapper. I tried updating my NVIDIA video driver but it > made > no difference. > > I am very new to VTK and don't yet have a grasp of the 'big picture'. I > apologize if these are very newbie questions: > Is there a way to force the initialization of the default > vtkShaderProgram? > Is there a way to check to see that it has been initialized? > What has to occur to initialize it? > Any other suggestions would be welcome. > > I should mention that a very simple java app that (no dicom, or CAT image > processing) that uses the same VTK initialization logic seems to be 100% > reliable. > > The call stack looks like: > > > vtkRenderingOpenGL2-7.0.dll!vtkShaderProgram::FindUniform(const > char * > name=0x000007fedd9d4dd8) Line 772 C++ > vtkRenderingOpenGL2-7.0.dll!vtkShaderProgram::SetUniformi(const > char * > name=0x000007fedd9d4dd8, int i=0) Line 498 C++ > > > vtkRenderingOpenGL2-7.0.dll!vtkOpenGLPolyDataMapper::SetMapperShaderParameters(vtkOpenGLHelper > & cellBO={...}, vtkRenderer * ren=0x00000000538a5980, vtkActor * > actor=0x0000000053975d40) Line 1451 C++ > > > vtkRenderingOpenGL2-7.0.dll!vtkOpenGLPolyDataMapper::UpdateShaders(vtkOpenGLHelper > & cellBO={...}, vtkRenderer * ren=0x00000000538a5980, vtkActor * > actor=0x0000000053975d40) Line 1433 C++ > > > vtkRenderingOpenGL2-7.0.dll!vtkOpenGLPolyDataMapper::RenderPieceDraw(vtkRenderer > * ren=0x00000000538a5980, vtkActor * actor=0x0000000053975d40) Line 2087 > C++ > > > vtkRenderingOpenGL2-7.0.dll!vtkOpenGLPolyDataMapper::RenderPiece(vtkRenderer > * ren=0x00000000538a5980, vtkActor * actor=0x0000000053975d40) Line 2240 > C++ > vtkRenderingCore-7.0.dll!vtkPolyDataMapper::Render(vtkRenderer * > ren=0x00000000538a5980, vtkActor * act=0x0000000053975d40) Line 64 C++ > vtkRenderingOpenGL2-7.0.dll!vtkOpenGLActor::Render(vtkRenderer * > ren=0x00000000538a5980, vtkMapper * mapper=0x000000005398a930) Line 86 C++ > > vtkRenderingCore-7.0.dll!vtkActor::RenderOpaqueGeometry(vtkViewport * > vp=0x00000000538a5980) Line 196 C++ > vtkRenderingOpenGL2-7.0.dll!vtkOpenGLRenderer::UpdateGeometry() > Line 211 > C++ > vtkRenderingOpenGL2-7.0.dll!vtkOpenGLRenderer::DeviceRender() Line > 159 C++ > vtkRenderingCore-7.0.dll!vtkRenderer::Render() Line 317 C++ > vtkRenderingCore-7.0.dll!vtkRendererCollection::Render() Line 53 > C++ > vtkRenderingCore-7.0.dll!vtkRenderWindow::DoStereoRender() Line > 775 C++ > vtkRenderingCore-7.0.dll!vtkRenderWindow::DoFDRender() Line 743 C++ > vtkRenderingCore-7.0.dll!vtkRenderWindow::DoAARender() Line 622 C++ > vtkRenderingCore-7.0.dll!vtkRenderWindow::Render() Line 438 C++ > vtkRenderingOpenGL2-7.0.dll!vtkOpenGLRenderWindow::Render() Line > 600 C++ > > vtkRenderingCoreJava.dll!Java_vtk_vtkRenderWindow_Render_19(JNIEnv_ * > env=0x000000004d7e79f8, _jobject * obj=0x000000021b00c790) Line 123 C++ > 0000000021bca86c() Unknown > ... > > Best Regards, > David Ei > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Ilene.Cohen at bsci.com Fri Apr 15 15:34:35 2016 From: Ilene.Cohen at bsci.com (Cohen, Ilene) Date: Fri, 15 Apr 2016 19:34:35 +0000 Subject: [vtkusers] VTK and Cmake In-Reply-To: References: <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE21A@STPEXDAGPG05N2.bsci.bossci.com> <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE2CA@STPEXDAGPG05N2.bsci.bossci.com>, Message-ID: <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE2DF@STPEXDAGPG05N2.bsci.bossci.com> Thank you all for your help. Do you know if anything in the following modules has changed since v5.10.1? Ilene Cohen, MD Principal Engineer Software Boston Scientific Rhythm Management Ilene.Cohen at bsci.com 617-218-3895 C: 781-439-2784 125 Cambridge Park Drive, Cambridge MA www.bostonscientific.com ________________________________ From: David E DeMarle [dave.demarle at kitware.com] Sent: Friday, April 15, 2016 1:45 PM To: Cohen, Ilene; vtkusers at vtk.org Subject: Re: [vtkusers] VTK and Cmake That is tougher. I am pretty sure that CMake's ExternalProject's (aka superbuilds) don't support that. I imaging you might have a custom external project stage fire off a process that builds VTK independently with a different CMake. You might want to ask on the CMake list to see how feasible that is as I am certainly no expert with this. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Apr 15, 2016 at 1:40 PM, Cohen, Ilene > wrote: That would be great but we are building the tool (that links to VTK) from a top-level cmake for the whole project. How would we do that? Ilene Cohen, MD Principal Engineer Software Boston Scientific Rhythm Management Ilene.Cohen at bsci.com 617-218-3895 C: 781-439-2784 125 Cambridge Park Drive, Cambridge MA www.bostonscientific.com ________________________________ From: David E DeMarle [dave.demarle at kitware.com] Sent: Friday, April 15, 2016 1:35 PM To: David Gobbi Cc: Cohen, Ilene; Cory Quammen; vtkusers at vtk.org Subject: Re: [vtkusers] VTK and Cmake Ilene could probably build VTK and here project separately right? Once you have VTK built, you don't necessarily need CMake to build your own project that links into and uses VTK. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Apr 15, 2016 at 1:23 PM, David Gobbi > wrote: Not quite that far back, VTK 5.10.1 should work. Modifying VTK 7 to make it work with CMake 2.8.4 would be a lot of work, even for a cmake guru. - David On Fri, Apr 15, 2016 at 11:17 AM, Cory Quammen > wrote: Ilene, It looks like you need to go back to VTK 5.8 to build with 2.8.4. > git show v5.8.0:CMakeLists.txt CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) > git show v6.0.0:CMakeLists.txt cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR) HTH, Cory On Fri, Apr 15, 2016 at 12:55 PM, Cohen, Ilene > wrote: > Hi, > > We are building our application using CMake v2.8.4 and are not able to > upgrade at this time. We have built a tool that links to VTK 7.0.0 using > CMake v2.8.8. This tool is called by our application. We want to be able to > build our application on machines that have only CMakev 2.8.4. Is this > possible? If so, how can we do it? Or do we need to use an older version of > VTK - if so, which version? Thanks for any assistance you can provide. > > Ilene > > Ilene Cohen, MD > Principal Engineer Software > Boston Scientific > Rhythm Management > Ilene.Cohen at bsci.com > 617-218-3895 C: 781-439-2784 > 125 Cambridge Park Drive, Cambridge MA > www.bostonscientific.com _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Fri Apr 15 15:40:59 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 15 Apr 2016 15:40:59 -0400 Subject: [vtkusers] VTK and Cmake In-Reply-To: <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE2DF@STPEXDAGPG05N2.bsci.bossci.com> References: <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE21A@STPEXDAGPG05N2.bsci.bossci.com> <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE2CA@STPEXDAGPG05N2.bsci.bossci.com> <68D5682F8EBFAF4FB6ADC06A0984ED1308FDE2DF@STPEXDAGPG05N2.bsci.bossci.com> Message-ID: Very likely. This biggest change happened in the 6.0 transition where the cmake structure of VTK and the pipeline connectivity changed. Search for vtk migration guide to learn about each. Also, peruse the API change summary pages on the roadmap page of the wiki a broad summary of changes since 5.10.1. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Apr 15, 2016 at 3:34 PM, Cohen, Ilene wrote: > Thank you all for your help. Do you know if anything in the following > modules has changed since v5.10.1? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > *Ilene Cohen, MD* > Principal Engineer Software > Boston Scientific > Rhythm Management > Ilene.Cohen at bsci.com > 617-218-3895 C: 781-439-2784 > 125 Cambridge Park Drive, Cambridge MA > www.bostonscientific.com > > ------------------------------ > *From:* David E DeMarle [dave.demarle at kitware.com] > *Sent:* Friday, April 15, 2016 1:45 PM > *To:* Cohen, Ilene; vtkusers at vtk.org > > *Subject:* Re: [vtkusers] VTK and Cmake > > That is tougher. > > I am pretty sure that CMake's ExternalProject's (aka superbuilds) don't > support that. I imaging you might have a custom external project stage fire > off a process that builds VTK independently with a different CMake. > > You might want to ask on the CMake list to see how feasible that is as I > am certainly no expert with this. > > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > On Fri, Apr 15, 2016 at 1:40 PM, Cohen, Ilene > wrote: > >> That would be great but we are building the tool (that links to VTK) from >> a top-level cmake for the whole project. How would we do that? >> >> *Ilene Cohen, MD* >> Principal Engineer Software >> Boston Scientific >> Rhythm Management >> Ilene.Cohen at bsci.com >> 617-218-3895 C: 781-439-2784 >> 125 Cambridge Park Drive, Cambridge MA >> www.bostonscientific.com >> >> ------------------------------ >> *From:* David E DeMarle [dave.demarle at kitware.com] >> *Sent:* Friday, April 15, 2016 1:35 PM >> *To:* David Gobbi >> *Cc:* Cohen, Ilene; Cory Quammen; vtkusers at vtk.org >> *Subject:* Re: [vtkusers] VTK and Cmake >> >> Ilene could probably build VTK and here project separately right? Once >> you have VTK built, you don't necessarily need CMake to build your own >> project that links into and uses VTK. >> >> David E DeMarle >> Kitware, Inc. >> R&D Engineer >> 21 Corporate Drive >> Clifton Park, NY 12065-8662 >> Phone: 518-881-4909 >> >> On Fri, Apr 15, 2016 at 1:23 PM, David Gobbi >> wrote: >> >>> Not quite that far back, VTK 5.10.1 should work. >>> >>> Modifying VTK 7 to make it work with CMake 2.8.4 would be a lot >>> of work, even for a cmake guru. >>> >>> - David >>> >>> >>> On Fri, Apr 15, 2016 at 11:17 AM, Cory Quammen >> > wrote: >>> >>>> Ilene, >>>> >>>> It looks like you need to go back to VTK 5.8 to build with 2.8.4. >>>> >>>> > git show v5.8.0:CMakeLists.txt >>>> >>>> CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) >>>> >>>> > git show v6.0.0:CMakeLists.txt >>>> >>>> cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR) >>>> >>>> HTH, >>>> Cory >>>> >>>> On Fri, Apr 15, 2016 at 12:55 PM, Cohen, Ilene >>>> wrote: >>>> > Hi, >>>> > >>>> > We are building our application using CMake v2.8.4 and are not able to >>>> > upgrade at this time. We have built a tool that links to VTK 7.0.0 >>>> using >>>> > CMake v2.8.8. This tool is called by our application. We want to be >>>> able to >>>> > build our application on machines that have only CMakev 2.8.4. Is this >>>> > possible? If so, how can we do it? Or do we need to use an older >>>> version of >>>> > VTK - if so, which version? Thanks for any assistance you can provide. >>>> > >>>> > Ilene >>>> > >>>> > Ilene Cohen, MD >>>> > Principal Engineer Software >>>> > Boston Scientific >>>> > Rhythm Management >>>> > Ilene.Cohen at bsci.com >>>> > 617-218-3895 C: 781-439-2784 >>>> > 125 Cambridge Park Drive, Cambridge MA >>>> > www.bostonscientific.com >>>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kai.wolf at gmail.com Sat Apr 16 06:21:49 2016 From: kai.wolf at gmail.com (Kai Wolf) Date: Sat, 16 Apr 2016 12:21:49 +0200 Subject: [vtkusers] Building only subset of VTK with modules Message-ID: <438211E8-8ACE-4A0F-80F8-F1A5DC9A3839@gmail.com> Hi all, for a current project I only need a subset of VTK modules. Since there is no binary installer for Windows using VTK C++ (it seems installer for Python bindings are the only ones available) I need to build VTK from source. Furthermore as I?m using CI (appveyor and travis) I need to build VTK everytime I?m pushing to my repo, therefore I?d like to keep the build times to a minimum. These are the headers I?m using in my project: I already tried to determine all needed modules with the script: Utilities/Maintenance/WhatModulesVTK.py, but still get some linker errors when compiling my project. It seems that QVTKWidget doesn?t get included correctly, but I might be wrong here. WhatModulesVTK gives me: All modules referenced in the files: find_package(VTK COMPONENTS vtkCommonCore vtkCommonDataModel vtkFiltersCore vtkRenderingCore vtkRenderingOpenGL ) which is already not quite right, as I use VTK 7.0.0 and there is no vtkRenderingOpenGL, but only vtkRenderingOpenGL2. My CMakeLists.txt for my project currenty looks like: ? find_package(OpenCV REQUIRED core imgproc calib3d highgui) find_package(Boost COMPONENTS filesystem system REQUIRED) find_package(VTK 7.0 COMPONENTS vtkCommonCore vtkCommonDataModel vtkFiltersCore vtkRenderingCore vtkRenderingOpenGL2 REQUIRED) find_package(Qt5Widgets REQUIRED QUIET) ? Using VTK as a dependency, I?m building it beforehand like this: $ git clone https://github.com/Kitware/VTK $ cd VTK && git checkout tags/v7.0.0 $ mkdir build && cd build $ cmake -DVTK_QT_VERSION:STRING=5 -DQT_QMAKE_EXECUTABLE:PATH=c:/Qt/5.6/msvc2015_64/bin/qmake.exe -DVTK_Group_Qt:BOOL=ON # Here should be all needed modules, e.g. -DModule_vtkXXXXX:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON .. $ cmake --build . Is this approach correct in general? What module am I missing in order. Any help is appreciated. -- Kai Wolf http://kai-wolf.me/ kai.wolf at gmail.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail URL: From zaherabdulazeez at gmail.com Sat Apr 16 09:51:34 2016 From: zaherabdulazeez at gmail.com (Zaher Abdul Azeez) Date: Sat, 16 Apr 2016 19:21:34 +0530 Subject: [vtkusers] dumping png images from the offscreen renderer- python Message-ID: I want rapid dumping of images from the off-screen renderer with camera style interaction. The way I plan to do it is : 1. set up an offscreen render window 2. renWin.Render() 3. define a function that can be called with an angle to change the camera angles for camera style interaction . For this I need to Intantiate vtkWindowToImageFilter and vtkPNGWriter every time I call the function. Otherwise the dumped images dont change as I call the function with different angles. this is not fast and robust, I guess What is the right way to do this. Is it possible to do something with vtkRenderWindowInteractor on the offscreen render window. Ingeneral how can we interact with the off-screen render window. Any help on this will be greatly acknowledged Regards Zaher -------------- next part -------------- An HTML attachment was scrubbed... URL: From snehajha199 at gmail.com Sat Apr 16 10:57:55 2016 From: snehajha199 at gmail.com (catnip123) Date: Sat, 16 Apr 2016 07:57:55 -0700 (MST) Subject: [vtkusers] Cuda with VTK Message-ID: <1460818675291-5737743.post@n5.nabble.com> Hey there, I am new to VTK . I am trying to visualize visual human body large dataset(3.15 GB) using VTK and GPU. I have the dataset in 1878 slices of resolution 1760*1024 , each slice is of 1760 kbs. Can someone please help me in how to visulaize these slices usig GPU in vtk? -- View this message in context: http://vtk.1045678.n5.nabble.com/Cuda-with-VTK-tp5737743.html Sent from the VTK - Users mailing list archive at Nabble.com. From elvis.chen at gmail.com Sat Apr 16 20:06:25 2016 From: elvis.chen at gmail.com (Elvis Chen) Date: Sat, 16 Apr 2016 20:06:25 -0400 Subject: [vtkusers] hardware acceleratec OpenGL on Raspberry pi 3/Raspbian? Message-ID: Greetings, I've recently acquired a Raspberry Pi 3. To my surprise, the latest raspbian (Jessie) comes with a complete development environment, including gcc (4.9), cmake, and vtk (both vtk5 and vtk6). I wrote a small program that reads a polydata and display it as a test bed. The pipeline is: vtkpolydatareader->vtkpolydatamapper->vtkactor nothing fancy. However, the rendering is surprisingly SLOW. It looks if the graphics is not hardware accelerated. My questions are: 1) How do I check if the video (which I assume to be OpenGL) is hardware accelerated? 2) any suggestion on how to optimize the performance? My next step is to comple vtk myself to see if it makes any difference. any help is very much appreciated, -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sat Apr 16 20:36:06 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Sat, 16 Apr 2016 18:36:06 -0600 Subject: [vtkusers] hardware acceleratec OpenGL on Raspberry pi 3/Raspbian? In-Reply-To: References: Message-ID: Hi Elvis, One way of checking the OpenGL driver is the "glxinfo" command. The "OpenGL renderer" is usually Mesa if it is a software renderer, but if it gives the name of a specific card or chip, then you probably have hardware rendering, e.g. here's what my laptop reports: OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: NVIDIA GeForce 9400M OpenGL Engine OpenGL version string: 2.1 NVIDIA-8.24.17 310.90.9.05f01 OpenGL shading language version string: 1.20 I don't know much about the Raspberry Pi, but google found this page that describes how to enable hardware OpenGL: https://www.raspberrypi.org/blog/another-new-raspbian-release/ - David On Sat, Apr 16, 2016 at 6:06 PM, Elvis Chen wrote: > Greetings, > > I've recently acquired a Raspberry Pi 3. To my surprise, the latest > raspbian (Jessie) comes with a complete development environment, including > gcc (4.9), cmake, and vtk (both vtk5 and vtk6). > > I wrote a small program that reads a polydata and display it as a test > bed. The pipeline is: > > vtkpolydatareader->vtkpolydatamapper->vtkactor > > nothing fancy. > > However, the rendering is surprisingly SLOW. It looks if the graphics is > not hardware accelerated. > > My questions are: > > 1) How do I check if the video (which I assume to be OpenGL) is hardware > accelerated? > 2) any suggestion on how to optimize the performance? > > My next step is to comple vtk myself to see if it makes any difference. > > any help is very much appreciated, > -------------- next part -------------- An HTML attachment was scrubbed... URL: From javij1 at gmail.com Sun Apr 17 05:12:36 2016 From: javij1 at gmail.com (=?iso-8859-1?Q?Javier_Juan_Albarrac=EDn?=) Date: Sun, 17 Apr 2016 11:12:36 +0200 Subject: [vtkusers] QVTKWidget with VTK 7.0 and Qt 5.6 (QtCreator/Designer 3.6.1) Message-ID: <002d01d19889$49117f40$db347dc0$@gmail.com> Hello, has anyone been able to install QVTKWidget (VTK 7) in Qt Creator/Designer 3.6.1 (Qt 5.6)?? I have followed the instructions of VTK webpage but the widget does not appear in the Designer widget?s list. I have also noticed that the folder installation structure of Qt 5.6 is not equal than the proposed in the VTK?s web. I think that the QVTKWidgetPlugin.dll should go on the path (Windows platform): \Tools\QtCreator\bin\plugins\designer When I put the .dll in that folder, in Qt Designer -> Tools -> Form Editor -> About Qt Designer plugins , the plugin appears in the folder of ?Failed plugins? with the message: ?Cannot load library \QTVKWidgetPluging.dll: Process not found?. Any idea of how the plugin should be installed?? Thank you very much. -------------- next part -------------- An HTML attachment was scrubbed... URL: From madaramh at gmail.com Mon Apr 18 02:11:33 2016 From: madaramh at gmail.com (madz) Date: Sun, 17 Apr 2016 23:11:33 -0700 (MST) Subject: [vtkusers] Projecting a point on a surface Message-ID: <1460959893726-5737747.post@n5.nabble.com> I have a curved surface which is one cell layer thick. I have a point which is close to the surface but not on it, I want to project it on to the immediate surface. What method should I use for this? I would appreciate any help. Thanks. -- View this message in context: http://vtk.1045678.n5.nabble.com/Projecting-a-point-on-a-surface-tp5737747.html Sent from the VTK - Users mailing list archive at Nabble.com. From jothybasu at gmail.com Mon Apr 18 02:42:03 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Mon, 18 Apr 2016 16:42:03 +1000 Subject: [vtkusers] Disable mouse interaction on overlaid image In-Reply-To: References: Message-ID: Hi David Yup, it works on my system. Thanks a lot! Jothy On Fri, Apr 15, 2016 at 11:46 PM, David Gobbi wrote: > Hi Jothy, > > Have you had a chance to test the changes yet? > > - David > > On Wed, Apr 13, 2016 at 5:53 PM, Jothybasu Selvaraj > wrote: > >> Great! >> >> Thanks very much! >> >> Jothy >> >> On Thu, Apr 14, 2016 at 9:08 AM, David Gobbi >> wrote: >> >>> Hi Jothy, >>> >>> I've added a change so that SetCurrentImageToNthImage is public: >>> https://gitlab.kitware.com/vtk/vtk/merge_requests/1421/diffs >>> >>> If you're not sure about how to get the changes with git, then you can >>> download the files here: >>> >>> https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.h >>> >>> https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.cxx >>> >>> Please test to see if this solves the issue. >>> >>> - David >>> >>> >>> >>> >>> On Tue, Apr 12, 2016 at 6:18 PM, Jothybasu Selvaraj >> > wrote: >>> >>>> I would rather like to have this SetCurrentImageToNthImage to be >>>> public and user definable. >>>> >>>> >>>> Jothy >>>> >>>> On Wed, Apr 13, 2016 at 10:15 AM, Jothybasu Selvaraj < >>>> jothybasu at gmail.com> wrote: >>>> >>>>> Hi David >>>>> >>>>> I am not familiar with using Gitlab. So, I subclassed >>>>> vtkInteractorStyleImage and override SetCurrentImageToNthImage(). >>>>> >>>>> Still it didn't work, because the layer number is hardcoded into StartWindowLevel() >>>>> with this->SetCurrentImageToNthImage(-1); So the mouse only interacts with >>>>> the last image. I changed it to "0" so that it pick the first image. >>>>> >>>>> It solves my problem. I only want to interact with the first image :). >>>>> >>>>> >>>>> Thank a lot for your inputs. >>>>> >>>>> >>>>> Cheers >>>>> >>>>> Jothy >>>>> >>>>> On Wed, Apr 13, 2016 at 8:42 AM, David Gobbi >>>>> wrote: >>>>> >>>>>> Hi Jothy, >>>>>> >>>>>> Can you try the code change in the following merge request to >>>>>> see if it fixes the problem? >>>>>> >>>>>> https://gitlab.kitware.com/vtk/vtk/merge_requests/1421 >>>>>> >>>>>> - David >>>>>> >>>>>> >>>>>> On Tue, Apr 12, 2016 at 4:05 PM, Jothybasu Selvaraj < >>>>>> jothybasu at gmail.com> wrote: >>>>>> >>>>>>> Yes, I use vtkInteractorStyleImage. >>>>>>> >>>>>>> Cheers >>>>>>> >>>>>>> Jothy >>>>>>> >>>>>>> On Tue, Apr 12, 2016 at 10:16 PM, David Gobbi >>>>>> > wrote: >>>>>>> >>>>>>>> Hi Jothy, >>>>>>>> >>>>>>>> Are you using vtkInteractionStyleImage? I checked the code, and it >>>>>>>> doesn't >>>>>>>> seem to check the pickability of the image. Specifically, I mean >>>>>>>> the code in >>>>>>>> SetCurrentImageToNthImage(), which is called by StartWindowLevel(). >>>>>>>> >>>>>>>> - David >>>>>>>> >>>>>>>> On Tue, Apr 12, 2016 at 12:44 AM, Jothybasu Selvaraj < >>>>>>>> jothybasu at gmail.com> wrote: >>>>>>>> >>>>>>>>> Dear All >>>>>>>>> >>>>>>>>> I an image overlaid on another image. I only want mouse >>>>>>>>> interaction such as window level change on only one image. How do I do that? >>>>>>>>> >>>>>>>>> I tried pickable off,on the second image but it doesn't work. >>>>>>>>> >>>>>>>>> Any help is highly appreciated! >>>>>>>>> >>>>>>>>> >>>>>>>>> Regards >>>>>>>>> >>>>>>>>> Jothy >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.v.ankudinov at mail.ru Mon Apr 18 02:45:41 2016 From: i.v.ankudinov at mail.ru (IlinkaGrap) Date: Sun, 17 Apr 2016 23:45:41 -0700 (MST) Subject: [vtkusers] Powercrust weird behaviour. In-Reply-To: <1460631856282-5737685.post@n5.nabble.com> References: <1460624686011-5737680.post@n5.nabble.com> <1460631604490-5737682.post@n5.nabble.com> <1460631856282-5737685.post@n5.nabble.com> Message-ID: <1460961941737-5737749.post@n5.nabble.com> I tried filtering using decimate pro but when I filter it to the number of polygons of the original (Stanford Bunny) mesh I get a quite poorly-formed surface. In the reconstructed by powercrust surface I could spot a lot of tiny triangles which do not add a lot to topology but to the size of the file only. So my guess is when using decimate pro these triangles are not of the first priority, thus to reduce the size decimatepro will erase both significant and non-significant triangles. So I had one more question: Is there a way to reconstruct a surface using VTK buy properly joining the vertices without adding extra vertices. I tried Delaunay 3D but it obviously didnt obtain decent results since it's not a surface reconstruction method by itself. -- View this message in context: http://vtk.1045678.n5.nabble.com/Powercrust-weird-behaviour-tp5737680p5737749.html Sent from the VTK - Users mailing list archive at Nabble.com. From abenchaaben at histalim.com Mon Apr 18 02:59:15 2016 From: abenchaaben at histalim.com (abenchaaben) Date: Sun, 17 Apr 2016 23:59:15 -0700 (MST) Subject: [vtkusers] VTK RGB rendering Volume In-Reply-To: <1460645659464-5737694.post@n5.nabble.com> References: <1460474794002-5737641.post@n5.nabble.com> <1460645659464-5737694.post@n5.nabble.com> Message-ID: <1460962755909-5737750.post@n5.nabble.com> Any help? -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-RGB-rendering-Volume-tp5737641p5737750.html Sent from the VTK - Users mailing list archive at Nabble.com. From jeff.baumes at kitware.com Mon Apr 18 07:54:47 2016 From: jeff.baumes at kitware.com (Jeff Baumes) Date: Mon, 18 Apr 2016 11:54:47 +0000 Subject: [vtkusers] vtkChartXY picking In-Reply-To: <1460726004464-5737711.post@n5.nabble.com> References: <1460726004464-5737711.post@n5.nabble.com> Message-ID: I think you want SetActionToButton() on vtkChart to change mouse bindings. You should be able to listen for a selection event once that is set up. http://www.vtk.org/doc/nightly/html/classvtkChart.html#ac4162187f5f3ad97f0163a079e06f13d On Fri, Apr 15, 2016 at 9:13 AM mbcx9rb9 wrote: > Hi all, > > I'd like to create a custom interactor for vtkChartXY (inherited from > vtkContextInteractorStyle), but I can't figure out how to select single > points with the left click of the mouse. Once I manage to that, I would > need > to return the index of the selected point. > > This seems very straightforward to me, but I haven't seen any concrete > examples. > > Any pointers would be greatly appreciated. > > Regards, > Richard > > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp5737711.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xabivtk at gmail.com Mon Apr 18 07:57:34 2016 From: xabivtk at gmail.com (Xabi Riobe) Date: Mon, 18 Apr 2016 13:57:34 +0200 Subject: [vtkusers] Projecting a point on a surface In-Reply-To: <1460959893726-5737747.post@n5.nabble.com> References: <1460959893726-5737747.post@n5.nabble.com> Message-ID: Hi, Have a look at vtkCellLocator::FindClosestPoint 2016-04-18 8:11 GMT+02:00 madz : > I have a curved surface which is one cell layer thick. I have a point which > is close to the surface but not on it, I want to project it on to the > immediate surface. > > > > What method should I use for this? I would appreciate any help. > Thanks. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Projecting-a-point-on-a-surface-tp5737747.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Mon Apr 18 09:41:49 2016 From: lasso at queensu.ca (Andras Lasso) Date: Mon, 18 Apr 2016 13:41:49 +0000 Subject: [vtkusers] Projecting a point on a surface In-Reply-To: References: <1460959893726-5737747.post@n5.nabble.com> Message-ID: You need to compute projection line intersection with surface. See this example: http://www.vtk.org/Wiki/VTK/Examples/Python/DataManipulation/LineOnMesh Andras 2016-04-18 8:11 GMT+02:00 madz >: I have a curved surface which is one cell layer thick. I have a point which is close to the surface but not on it, I want to project it on to the immediate surface. What method should I use for this? I would appreciate any help. Thanks. -- View this message in context: http://vtk.1045678.n5.nabble.com/Projecting-a-point-on-a-surface-tp5737747.html Sent from the VTK - Users mailing list archive at Nabble.com. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike.jackson at bluequartz.net Mon Apr 18 12:11:30 2016 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Mon, 18 Apr 2016 12:11:30 -0400 Subject: [vtkusers] Trying to Compile Qt examples Message-ID: <57150732.1080005@bluequartz.net> Just getting back into VTK after a long hiatus and I was wanting to compile the Qt examples inside of VTK 7.0.0. This is what I did: Downloaded the VTK 7.0.0 sources and setup my build directories in the following location: /Users/Shared/OpenSource/VTK-7.0.0 /Users/Shared/OpenSource/VTK-7.0.0-Build I ran the following cmake command (CMake 3.5.1): [XXX] $ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/Users/Shared/DREAM3D_SDK/VTK-7.0.0 -DVTK_Group_Qt=ON -DVTK_USE_CXX11_FEATURES=ON -DModule_vtkRenderingQt=ON -DQT_QMAKE_EXECUTABLE=/Users/Shared/DREAM3D_SDK/Qt5.6.0/5.6/clang_64/bin/qmake -DVTK_QT_VERSION:STRING=5 -DCMAKE_PREFIX_PATH:PATH="/Users/Shared/DREAM3D_SDK/Qt5.6.0/5.6/clang_64/lib/cmake/Qt5;/Users/Shared/DREAM3D_SDK/hdf5-1.8.16-Release/share/cmake" -DBUILD_TESTING=ON ../VTK-7.0.0 [XXX] $ ninja [XXX] $ ninja install All of that worked great. I then did the following: [XXX] $ cd /Users/Shared/OpenSource/VTK-7.0.0/Examples/GUI/Qt/ [XXX] $ mkdir Build [XXX] $ cd Build [XXX] $ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/Users/Shared/DREAM3D_SDK/Qt5.6.0/5.6/clang_64/lib/cmake;/Users/Shared/DREAM3D_SDK/VTK-7.0.0/lib/cmake/vtk-7.0" ../ but I get the following CMake error: CMake Error at /Users/Shared/DREAM3D_SDK/VTK-7.0.0/lib/cmake/vtk-7.0/vtkModuleAPI.cmake:120 (message): Requested modules not available: vtkRendering Call Stack (most recent call first): /Users/Shared/DREAM3D_SDK/VTK-7.0.0/lib/cmake/vtk-7.0/VTKConfig.cmake:88 (vtk_module_config) ImageViewer/CMakeLists.txt:16 (find_package) Hmm. I am pretty sure I ran through everything correctly. The install looks correct. A cursory glances shows dylibs for VtkRendering.dylib? This is on OS X 10.10.5 with Xcode 7.2 and CMake 3.5.1 Thanks for any help or pointers -- Mike Jackson -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Apr 18 12:40:17 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 18 Apr 2016 10:40:17 -0600 Subject: [vtkusers] Disable mouse interaction on overlaid image In-Reply-To: References: Message-ID: Great. I've made one more minor change, I renamed SetCurrentImageToNthImage() to SetCurrentImageNumber(). https://gitlab.kitware.com/vtk/vtk/merge_requests/1421/diffs I'll try to get this change merged into VTK. Cheers, - David On Mon, Apr 18, 2016 at 12:42 AM, Jothybasu Selvaraj wrote: > Hi David > > Yup, it works on my system. > > Thanks a lot! > > Jothy > > On Fri, Apr 15, 2016 at 11:46 PM, David Gobbi > wrote: > >> Hi Jothy, >> >> Have you had a chance to test the changes yet? >> >> - David >> >> On Wed, Apr 13, 2016 at 5:53 PM, Jothybasu Selvaraj >> wrote: >> >>> Great! >>> >>> Thanks very much! >>> >>> Jothy >>> >>> On Thu, Apr 14, 2016 at 9:08 AM, David Gobbi >>> wrote: >>> >>>> Hi Jothy, >>>> >>>> I've added a change so that SetCurrentImageToNthImage is public: >>>> https://gitlab.kitware.com/vtk/vtk/merge_requests/1421/diffs >>>> >>>> If you're not sure about how to get the changes with git, then you can >>>> download the files here: >>>> >>>> https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.h >>>> >>>> https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.cxx >>>> >>>> Please test to see if this solves the issue. >>>> >>>> - David >>>> >>>> >>>> >>>> >>>> On Tue, Apr 12, 2016 at 6:18 PM, Jothybasu Selvaraj < >>>> jothybasu at gmail.com> wrote: >>>> >>>>> I would rather like to have this SetCurrentImageToNthImage to be >>>>> public and user definable. >>>>> >>>>> >>>>> Jothy >>>>> >>>>> On Wed, Apr 13, 2016 at 10:15 AM, Jothybasu Selvaraj < >>>>> jothybasu at gmail.com> wrote: >>>>> >>>>>> Hi David >>>>>> >>>>>> I am not familiar with using Gitlab. So, I subclassed >>>>>> vtkInteractorStyleImage and override SetCurrentImageToNthImage(). >>>>>> >>>>>> Still it didn't work, because the layer number is hardcoded into StartWindowLevel() >>>>>> with this->SetCurrentImageToNthImage(-1); So the mouse only interacts with >>>>>> the last image. I changed it to "0" so that it pick the first image. >>>>>> >>>>>> It solves my problem. I only want to interact with the first image :). >>>>>> >>>>>> >>>>>> Thank a lot for your inputs. >>>>>> >>>>>> >>>>>> Cheers >>>>>> >>>>>> Jothy >>>>>> >>>>>> On Wed, Apr 13, 2016 at 8:42 AM, David Gobbi >>>>>> wrote: >>>>>> >>>>>>> Hi Jothy, >>>>>>> >>>>>>> Can you try the code change in the following merge request to >>>>>>> see if it fixes the problem? >>>>>>> >>>>>>> https://gitlab.kitware.com/vtk/vtk/merge_requests/1421 >>>>>>> >>>>>>> - David >>>>>>> >>>>>>> >>>>>>> On Tue, Apr 12, 2016 at 4:05 PM, Jothybasu Selvaraj < >>>>>>> jothybasu at gmail.com> wrote: >>>>>>> >>>>>>>> Yes, I use vtkInteractorStyleImage. >>>>>>>> >>>>>>>> Cheers >>>>>>>> >>>>>>>> Jothy >>>>>>>> >>>>>>>> On Tue, Apr 12, 2016 at 10:16 PM, David Gobbi < >>>>>>>> david.gobbi at gmail.com> wrote: >>>>>>>> >>>>>>>>> Hi Jothy, >>>>>>>>> >>>>>>>>> Are you using vtkInteractionStyleImage? I checked the code, and >>>>>>>>> it doesn't >>>>>>>>> seem to check the pickability of the image. Specifically, I mean >>>>>>>>> the code in >>>>>>>>> SetCurrentImageToNthImage(), which is called by StartWindowLevel(). >>>>>>>>> >>>>>>>>> - David >>>>>>>>> >>>>>>>>> On Tue, Apr 12, 2016 at 12:44 AM, Jothybasu Selvaraj < >>>>>>>>> jothybasu at gmail.com> wrote: >>>>>>>>> >>>>>>>>>> Dear All >>>>>>>>>> >>>>>>>>>> I an image overlaid on another image. I only want mouse >>>>>>>>>> interaction such as window level change on only one image. How do I do that? >>>>>>>>>> >>>>>>>>>> I tried pickable off,on the second image but it doesn't work. >>>>>>>>>> >>>>>>>>>> Any help is highly appreciated! >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Regards >>>>>>>>>> >>>>>>>>>> Jothy >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.j.brown at live.co.uk Mon Apr 18 12:53:45 2016 From: richard.j.brown at live.co.uk (mbcx9rb9) Date: Mon, 18 Apr 2016 09:53:45 -0700 (MST) Subject: [vtkusers] surface expansion Message-ID: <1460998425837-5737758.post@n5.nabble.com> I've seen this asked a few times, but I haven't seen an answer for what seems like a relatively simple task. How do I go about expanding a surface by a given value (adding the value as opposed to multiplying a scaling factor). Is there a class for this? The logic seems pretty straightforward: for each point new point = point + distance*normal end for Thanks in advance for any help, Richard -- View this message in context: http://vtk.1045678.n5.nabble.com/surface-expansion-tp5737758.html Sent from the VTK - Users mailing list archive at Nabble.com. From bill.lorensen at gmail.com Mon Apr 18 13:57:23 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 18 Apr 2016 13:57:23 -0400 Subject: [vtkusers] surface expansion In-Reply-To: <1460998425837-5737758.post@n5.nabble.com> References: <1460998425837-5737758.post@n5.nabble.com> Message-ID: vtkWarpVector On Mon, Apr 18, 2016 at 12:53 PM, mbcx9rb9 wrote: > I've seen this asked a few times, but I haven't seen an answer for what seems > like a relatively simple task. > > How do I go about expanding a surface by a given value (adding the value as > opposed to multiplying a scaling factor). > > Is there a class for this? > > The logic seems pretty straightforward: > for each point > new point = point + distance*normal > end for > > Thanks in advance for any help, > Richard > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/surface-expansion-tp5737758.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com From david.gobbi at gmail.com Mon Apr 18 14:11:28 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 18 Apr 2016 12:11:28 -0600 Subject: [vtkusers] surface expansion In-Reply-To: References: <1460998425837-5737758.post@n5.nabble.com> Message-ID: In order to get vtkWarpVector to use the normals, it might need this: warpvector->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, vtkDataSetAttributes::NORMALS); On Mon, Apr 18, 2016 at 11:57 AM, Bill Lorensen wrote: > vtkWarpVector > > > On Mon, Apr 18, 2016 at 12:53 PM, mbcx9rb9 > wrote: > > I've seen this asked a few times, but I haven't seen an answer for what > seems > > like a relatively simple task. > > > > How do I go about expanding a surface by a given value (adding the value > as > > opposed to multiplying a scaling factor). > > > > Is there a class for this? > > > > The logic seems pretty straightforward: > > for each point > > new point = point + distance*normal > > end for > > > > Thanks in advance for any help, > > Richard > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Mon Apr 18 14:41:52 2016 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 18 Apr 2016 14:41:52 -0400 Subject: [vtkusers] 30 million points and Render In-Reply-To: <1460645328211-5737692.post@n5.nabble.com> References: <1460645328211-5737692.post@n5.nabble.com> Message-ID: 30 million points typically takes around 600 MB of memory for one copy in VTK. Using one cell is typically the way to go. I have loaded/processed 200 million point datasets on my laptop and it seems OK with 16GB of RAM. But if you are creating many copies or have a long pipeline or have lots of attributes on each point (such as normal, scalar values, etc) then the memory cost will climb. Thanks Ken On Thu, Apr 14, 2016 at 10:48 AM, alihadim wrote: > Hi All, > I have to 30 million points file data and I want to render. Do you have > suggestions; > > * Use one cell and million point add > * Use many cell ana dividing points. > * use filtering method. (which) > > Because When I created data I took error messages. "System out-off memory." > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/30-million-points-and-Render-tp5737692.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Mon Apr 18 14:47:41 2016 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 18 Apr 2016 14:47:41 -0400 Subject: [vtkusers] gpu_shader4 is not supported In-Reply-To: References: Message-ID: That error typically indicates your graphics card is missing the required opengl support. I would guess your server node lacks a graphics card (as opposed to the tesla compute card). You can try running ctest -R VBOPLY -VV that test starts by checking for your OpenGL support and outputs some useful information when it runs. ctest -R Apple -VV also can be useful output Thanks Ken On Tue, Apr 12, 2016 at 1:01 PM, Fabian Torres wrote: > Hi all > > I'm trying to use vtk in a server with: > > windows server 2012 > VS 2013 > VTK 7.0.0 > NVIDIA Tesla K40c > > VTK compiles in VS without any errors, but when I try to run the examples > cone.exe or any other I get the next error > > Error: In > C:/Libraries/VTK-7.0.0/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 545 > vtkWin32OpenGLRenderWindow [0059BF18]: GL version 2.1 with gpu_shader4 > extension is not supported by your graphics driver. > > Im not an OpenGL expert so I do not know how to fix this problem. > > Can anybody help me? > > Thanks a lot. > > -- > Fabi?n Torres Robles > Maestria en Ciencias en Ingenier?a Electr?nica > Ingenier?a en Sistemas Electr?nicos > tel. 58081280, 0445534661338 > e-mail fabian.trobles at gmail.com, dae.wong at gmail.com > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji.tsumura at neosoftmedical.com Mon Apr 18 16:30:28 2016 From: kenji.tsumura at neosoftmedical.com (Kenji Tsumura) Date: Mon, 18 Apr 2016 20:30:28 +0000 Subject: [vtkusers] Java vtkPanel Message-ID: <10285631702C4D4CB5C4921DC14337954EEFD77E@neocoilexch01> Hi, I have a Java application that use vtkPanel. Precisely, I made a class that extends vtkRenderWindowPanel. When an object of the class is no more used, I would like to dispose the object. But I couldn't dispose it no matter how. Java VisualVM indicates the object is JNI global reference. So how can I dispose it? I used the Delete method and called vtkObject.JAVA_OBJECT_MANAGER.gc(false), but it didn't work (it works for other VTK objects). The attached file is a simple test code that demonstrates vtkRenderWindowPanel is never disposed. I have seen similar post in the past, but never be answered in the way I hope. So I decided to post. I would appreciate any advice. Thank you, Kenji "The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: JFrameRenderer.java Type: application/octet-stream Size: 3478 bytes Desc: JFrameRenderer.java URL: From sebastien.jourdain at kitware.com Mon Apr 18 17:32:00 2016 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 18 Apr 2016 15:32:00 -0600 Subject: [vtkusers] Java vtkPanel In-Reply-To: <10285631702C4D4CB5C4921DC14337954EEFD77E@neocoilexch01> References: <10285631702C4D4CB5C4921DC14337954EEFD77E@neocoilexch01> Message-ID: Hi Kenji, You can look at what we are doing with the delete() method of vtkPanel (knowing that we leak on Linux instead of crashing). But I'm guessing I see 3 possible issue in your code. 1) You should try to detach your renderWindowPanel instance from the parent JFrame. 2) Then you should set it to null before calling vtkObject.JAVA_OBJECT_MANAGER.gc(false); 3) And in any case, you should not call Delete() on it. I'm thinking your code may cleanup its memory but not the first time you do it. After 3 times, you only cleared the first allocated memory. Hope that helps, Seb PS: If ever you want to contribute your native library loader, please feel free to do so, I can facilitate the process. ;-) On Mon, Apr 18, 2016 at 2:30 PM, Kenji Tsumura < kenji.tsumura at neosoftmedical.com> wrote: > Hi, > > > > I have a Java application that use vtkPanel. Precisely, I made a class > that extends vtkRenderWindowPanel. When an object of the class is no more > used, I would like to dispose the object. But I couldn?t dispose it no > matter how. Java VisualVM indicates the object is JNI global reference. > So how can I dispose it? I used the Delete method and called > vtkObject.JAVA_OBJECT_MANAGER.gc(false), but it didn?t work (it works for > other VTK objects). The attached file is a simple test code that > demonstrates vtkRenderWindowPanel is never disposed. > > > > I have seen similar post in the past, but never be answered in the way I > hope. So I decided to post. I would appreciate any advice. > > Thank you, > > > > Kenji > > > > ?The information contained in this communication may be confidential, is > intended only for the use of the recipient(s) named above, and may be > legally privileged. If the reader of this message is not the intended > recipient, you are hereby notified that any dissemination, distribution, or > copying of this communication, or any of its contents, is strictly > prohibited. If you have received this communication in error, please return > it to the sender immediately and delete the original message and any copy > of it from your computer system. If you have any questions concerning this > message, please contact the sender. > > > Disclaimer: The information contained in this communication may be > confidential, is intended only for the use of the recipient(s) named above, > and may be legally privileged. If the reader of this message is not the > intended recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication, or any of its contents, is > strictly prohibited. If you have received this communication in error, > please return it to the sender immediately and delete the original message > and any copy of it from your computer system. If you have any questions > concerning this message, please contact the sender. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Mon Apr 18 18:18:46 2016 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 18 Apr 2016 16:18:46 -0600 Subject: [vtkusers] Java vtkPanel In-Reply-To: <10285631702C4D4CB5C4921DC14337954EEFD7B6@neocoilexch01> References: <10285631702C4D4CB5C4921DC14337954EEFD77E@neocoilexch01> <10285631702C4D4CB5C4921DC14337954EEFD7B6@neocoilexch01> Message-ID: Hum, Out of curiosity can you try using vtkPanel instead and calling its Java implementation of the delete() function and see if you can see it disappear or not within you tool (NetBean?)? I'm wondering which piece keep a ref on it... Seb On Mon, Apr 18, 2016 at 4:06 PM, Kenji Tsumura < kenji.tsumura at neosoftmedical.com> wrote: > Hi Seb, > > > > Thank you for the advice. > > So I change my test code as you suggested, but the problem still persists. > > > > JFrameRenderer.*this*.remove(renderWindowPanel); > > // renderWindowPanel.Delete(); > > renderWindowPanel = *null*; > > vtkObject.*JAVA_OBJECT_MANAGER*.gc(*false*); > > > > The attached shows the renderWindowPanel has not been released after 6 > times of button click that triggers replacing the renderWindowPanel object. > > Do I miss something? > > > > Thank you, > > > > Kenji > > > > *From:* Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] > *Sent:* Monday, April 18, 2016 4:32 PM > *To:* Kenji Tsumura > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Java vtkPanel > > > > Hi Kenji, > > > > You can look at what we are doing with the delete() method of vtkPanel > (knowing that we leak on Linux instead of crashing). > > But I'm guessing I see 3 possible issue in your code. > > > > 1) You should try to detach your renderWindowPanel instance from the > parent JFrame. > > 2) Then you should set it to null before > calling vtkObject.JAVA_OBJECT_MANAGER.gc(false); > > 3) And in any case, you should not call Delete() on it. > > > > I'm thinking your code may cleanup its memory but not the first time you > do it. After 3 times, you only cleared the first allocated memory. > > > > Hope that helps, > > > > Seb > > > > PS: If ever you want to contribute your native library loader, please feel > free to do so, I can facilitate the process. ;-) > > > > On Mon, Apr 18, 2016 at 2:30 PM, Kenji Tsumura < > kenji.tsumura at neosoftmedical.com> wrote: > > Hi, > > > > I have a Java application that use vtkPanel. Precisely, I made a class > that extends vtkRenderWindowPanel. When an object of the class is no more > used, I would like to dispose the object. But I couldn?t dispose it no > matter how. Java VisualVM indicates the object is JNI global reference. > So how can I dispose it? I used the Delete method and called > vtkObject.JAVA_OBJECT_MANAGER.gc(false), but it didn?t work (it works for > other VTK objects). The attached file is a simple test code that > demonstrates vtkRenderWindowPanel is never disposed. > > > > I have seen similar post in the past, but never be answered in the way I > hope. So I decided to post. I would appreciate any advice. > > Thank you, > > > > Kenji > > > > ?The information contained in this communication may be confidential, is > intended only for the use of the recipient(s) named above, and may be > legally privileged. If the reader of this message is not the intended > recipient, you are hereby notified that any dissemination, distribution, or > copying of this communication, or any of its contents, is strictly > prohibited. If you have received this communication in error, please return > it to the sender immediately and delete the original message and any copy > of it from your computer system. If you have any questions concerning this > message, please contact the sender. > > > > Disclaimer: The information contained in this communication may be > confidential, is intended only for the use of the recipient(s) named above, > and may be legally privileged. If the reader of this message is not the > intended recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication, or any of its contents, is > strictly prohibited. If you have received this communication in error, > please return it to the sender immediately and delete the original message > and any copy of it from your computer system. If you have any questions > concerning this message, please contact the sender. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > Disclaimer: The information contained in this communication may be > confidential, is intended only for the use of the recipient(s) named above, > and may be legally privileged. If the reader of this message is not the > intended recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication, or any of its contents, is > strictly prohibited. If you have received this communication in error, > please return it to the sender immediately and delete the original message > and any copy of it from your computer system. If you have any questions > concerning this message, please contact the sender. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Mon Apr 18 18:18:55 2016 From: matimontg at gmail.com (Matias Montroull) Date: Mon, 18 Apr 2016 22:18:55 +0000 Subject: [vtkusers] Building Activiz 6.3 In-Reply-To: <8c1fac40a61848fe853fba1e922f49af@cascadeacoustic.com> References: <8c1fac40a61848fe853fba1e922f49af@cascadeacoustic.com> Message-ID: I've patched the ActiViz source code and I'm building it at this right moment, if it goes ok, I'll share what I did. El lun., 18 de abr. de 2016 a la(s) 19:15, Mark DeArman < mark at cascadeacoustic.com> escribi?: > My project got canned but I'll look at the last version I built. Where I > left off, I was stuck trying to build against the boost library also. I > had the rest of the build working and I made some more modifications to > mummy to fix enum naming, which was a really big issue. I also finished > the WPF integration package. > > > Mark DeArman > Cascade Acoustic Research > http://www.cascadeacoustic.com > (253) 200-5353 > > ------------------------------ > *From*: "Matias Montroull" > *Sent*: Monday, April 18, 2016 9:02 AM > *To*: "mark at cascadeacoustic.com" > *Subject*: Building Activiz 6.3 > > Mark, > > Did you try building ActiViz 6.3? > > > I was trying to build ActiViz 6.3 and I received the following error: > > LINK : fatal error LNK1104: cannot open file > 'vtkRenderingFreeTypeOpenGL.lib' > > ActiViz 6.2 compiled just fine so it seems that the > RenderingFreeTypeOpenGL module no longer exists.. > > Regards, > > Matias. > -- > Matias > -- Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at cascadeacoustic.com Mon Apr 18 18:14:23 2016 From: mark at cascadeacoustic.com (Mark DeArman) Date: Mon, 18 Apr 2016 17:14:23 -0500 Subject: [vtkusers] Building Activiz 6.3 In-Reply-To: References: Message-ID: <8c1fac40a61848fe853fba1e922f49af@cascadeacoustic.com> My project got canned but I'll look at the last version I built. Where I left off, I was stuck trying to build against the boost library also. I had the rest of the build working and I made some more modifications to mummy to fix enum naming, which was a really big issue. I also finished the WPF integration package. Mark DeArman Cascade Acoustic Research http://www.cascadeacoustic.com (253) 200-5353 ---------------------------------------- From: "Matias Montroull" Sent: Monday, April 18, 2016 9:02 AM To: "mark at cascadeacoustic.com" Subject: Building Activiz 6.3 Mark, Did you try building ActiViz 6.3? I was trying to build ActiViz 6.3 and I received the following error: LINK : fatal error LNK1104: cannot open file 'vtkRenderingFreeTypeOpenGL.lib' ActiViz 6.2 compiled just fine so it seems that the RenderingFreeTypeOpenGL module no longer exists.. Regards, Matias. -- Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Mon Apr 18 20:27:02 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Tue, 19 Apr 2016 10:27:02 +1000 Subject: [vtkusers] Disable mouse interaction on overlaid image In-Reply-To: References: Message-ID: Sounds good! Cheers Jothy On Tue, Apr 19, 2016 at 2:40 AM, David Gobbi wrote: > Great. I've made one more minor change, I renamed > SetCurrentImageToNthImage() to SetCurrentImageNumber(). > https://gitlab.kitware.com/vtk/vtk/merge_requests/1421/diffs > > I'll try to get this change merged into VTK. > > Cheers, > - David > > > > On Mon, Apr 18, 2016 at 12:42 AM, Jothybasu Selvaraj > wrote: > >> Hi David >> >> Yup, it works on my system. >> >> Thanks a lot! >> >> Jothy >> >> On Fri, Apr 15, 2016 at 11:46 PM, David Gobbi >> wrote: >> >>> Hi Jothy, >>> >>> Have you had a chance to test the changes yet? >>> >>> - David >>> >>> On Wed, Apr 13, 2016 at 5:53 PM, Jothybasu Selvaraj >> > wrote: >>> >>>> Great! >>>> >>>> Thanks very much! >>>> >>>> Jothy >>>> >>>> On Thu, Apr 14, 2016 at 9:08 AM, David Gobbi >>>> wrote: >>>> >>>>> Hi Jothy, >>>>> >>>>> I've added a change so that SetCurrentImageToNthImage is public: >>>>> https://gitlab.kitware.com/vtk/vtk/merge_requests/1421/diffs >>>>> >>>>> If you're not sure about how to get the changes with git, then you can >>>>> download the files here: >>>>> >>>>> https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.h >>>>> >>>>> https://gitlab.kitware.com/vtk/vtk/raw/81d49118/Interaction/Style/vtkInteractorStyleImage.cxx >>>>> >>>>> Please test to see if this solves the issue. >>>>> >>>>> - David >>>>> >>>>> >>>>> >>>>> >>>>> On Tue, Apr 12, 2016 at 6:18 PM, Jothybasu Selvaraj < >>>>> jothybasu at gmail.com> wrote: >>>>> >>>>>> I would rather like to have this SetCurrentImageToNthImage to be >>>>>> public and user definable. >>>>>> >>>>>> >>>>>> Jothy >>>>>> >>>>>> On Wed, Apr 13, 2016 at 10:15 AM, Jothybasu Selvaraj < >>>>>> jothybasu at gmail.com> wrote: >>>>>> >>>>>>> Hi David >>>>>>> >>>>>>> I am not familiar with using Gitlab. So, I subclassed >>>>>>> vtkInteractorStyleImage and override SetCurrentImageToNthImage(). >>>>>>> >>>>>>> Still it didn't work, because the layer number is hardcoded into StartWindowLevel() >>>>>>> with this->SetCurrentImageToNthImage(-1); So the mouse only interacts with >>>>>>> the last image. I changed it to "0" so that it pick the first image. >>>>>>> >>>>>>> It solves my problem. I only want to interact with the first image >>>>>>> :). >>>>>>> >>>>>>> >>>>>>> Thank a lot for your inputs. >>>>>>> >>>>>>> >>>>>>> Cheers >>>>>>> >>>>>>> Jothy >>>>>>> >>>>>>> On Wed, Apr 13, 2016 at 8:42 AM, David Gobbi >>>>>>> wrote: >>>>>>> >>>>>>>> Hi Jothy, >>>>>>>> >>>>>>>> Can you try the code change in the following merge request to >>>>>>>> see if it fixes the problem? >>>>>>>> >>>>>>>> https://gitlab.kitware.com/vtk/vtk/merge_requests/1421 >>>>>>>> >>>>>>>> - David >>>>>>>> >>>>>>>> >>>>>>>> On Tue, Apr 12, 2016 at 4:05 PM, Jothybasu Selvaraj < >>>>>>>> jothybasu at gmail.com> wrote: >>>>>>>> >>>>>>>>> Yes, I use vtkInteractorStyleImage. >>>>>>>>> >>>>>>>>> Cheers >>>>>>>>> >>>>>>>>> Jothy >>>>>>>>> >>>>>>>>> On Tue, Apr 12, 2016 at 10:16 PM, David Gobbi < >>>>>>>>> david.gobbi at gmail.com> wrote: >>>>>>>>> >>>>>>>>>> Hi Jothy, >>>>>>>>>> >>>>>>>>>> Are you using vtkInteractionStyleImage? I checked the code, and >>>>>>>>>> it doesn't >>>>>>>>>> seem to check the pickability of the image. Specifically, I mean >>>>>>>>>> the code in >>>>>>>>>> SetCurrentImageToNthImage(), which is called by >>>>>>>>>> StartWindowLevel(). >>>>>>>>>> >>>>>>>>>> - David >>>>>>>>>> >>>>>>>>>> On Tue, Apr 12, 2016 at 12:44 AM, Jothybasu Selvaraj < >>>>>>>>>> jothybasu at gmail.com> wrote: >>>>>>>>>> >>>>>>>>>>> Dear All >>>>>>>>>>> >>>>>>>>>>> I an image overlaid on another image. I only want mouse >>>>>>>>>>> interaction such as window level change on only one image. How do I do that? >>>>>>>>>>> >>>>>>>>>>> I tried pickable off,on the second image but it doesn't work. >>>>>>>>>>> >>>>>>>>>>> Any help is highly appreciated! >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Regards >>>>>>>>>>> >>>>>>>>>>> Jothy >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From koujima at pronotec.co.jp Mon Apr 18 23:01:57 2016 From: koujima at pronotec.co.jp (Chiyoko Koujima) Date: Mon, 18 Apr 2016 20:01:57 -0700 (MST) Subject: [vtkusers] Save the image on resliced viewer as DICOM data Message-ID: <1461034917791-5737769.post@n5.nabble.com> Hi, I'm trying to save the image data on resliced viewer as DICOM data in order to change WW,WL. Position and angle also in the same as look. In a way that I used it takes 20 seconds per sheet. And it is an error to be processed in the background. Made data seem to have the wrong part... Do anyone knows better way? in my way: var polyData = cutter.GetOutput(); var pointData = polyData.GetPointData(); var scalars = (vtkShortArray)pointData.GetScalars(); var point = polyData.FindPoint(x, y, 0); // this step takes a long time var value = scalars.GetValue(point); in this way I don't use data on reslice viewer. But actually I want to use data on resliced viewer. Regards, Chiyoko -- View this message in context: http://vtk.1045678.n5.nabble.com/Save-the-image-on-resliced-viewer-as-DICOM-data-tp5737769.html Sent from the VTK - Users mailing list archive at Nabble.com. From richard.j.brown at live.co.uk Tue Apr 19 08:49:17 2016 From: richard.j.brown at live.co.uk (Richard Brown) Date: Tue, 19 Apr 2016 14:49:17 +0200 Subject: [vtkusers] surface expansion In-Reply-To: References: <1460998425837-5737758.post@n5.nabble.com> Message-ID: Thanks for the help. I?m looking at vtkWarpVector examples, however, and both of them are simply: warp = vtk.vtkWarpVector() warp.SetInputConnection(p2c.GetOutputPort()) and: warp = vtk.vtkWarpVector() warp.SetInputConnection(castToUnstructuredGrid.GetOutputPort()) I can?t figure out how to apply this class to my needs. Is there an example anywhere that I can use? Regards, Richard > On 18 Apr 2016, at 20:11, David Gobbi wrote: > > In order to get vtkWarpVector to use the normals, it might need this: > > warpvector->SetInputArrayToProcess(0, 0, 0, > vtkDataObject::FIELD_ASSOCIATION_POINTS, > vtkDataSetAttributes::NORMALS); > > > On Mon, Apr 18, 2016 at 11:57 AM, Bill Lorensen > wrote: > vtkWarpVector > > > On Mon, Apr 18, 2016 at 12:53 PM, mbcx9rb9 > wrote: > > I've seen this asked a few times, but I haven't seen an answer for what seems > > like a relatively simple task. > > > > How do I go about expanding a surface by a given value (adding the value as > > opposed to multiplying a scaling factor). > > > > Is there a class for this? > > > > The logic seems pretty straightforward: > > for each point > > new point = point + distance*normal > > end for > > > > Thanks in advance for any help, > > Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Apr 19 09:12:28 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 19 Apr 2016 07:12:28 -0600 Subject: [vtkusers] surface expansion In-Reply-To: References: <1460998425837-5737758.post@n5.nabble.com> Message-ID: I don't know of any example that does specifically what you want. But the pipeline would go something like this: 1) use vtkPolyDataNormals to compute normals at each point. 2) feed the output of vtkPolyDataNormals into vtkWarpVector. 3) tell vtkWarpVector to use the normals, and give it a scale factor: warp.SetInputConnection(norms.GetOutputPort()) warp.SetInputArrayToProcess(0, 0, 0, vtkDataObject.FIELD_ASSOCIATION_POINTS, vtkDataSetAttributes.NORMALS) warp.SetScaleFactor(5.0) I've never actually tried this, but in theory, it should work. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From ali.hadimogullari at netcad.com.tr Tue Apr 19 10:47:43 2016 From: ali.hadimogullari at netcad.com.tr (alihadim) Date: Tue, 19 Apr 2016 07:47:43 -0700 (MST) Subject: [vtkusers] 30 million points and Render In-Reply-To: References: <1460645328211-5737692.post@n5.nabble.com> Message-ID: <1461077263030-5737773.post@n5.nabble.com> Thank you answer. If you possible can you sent me your code. I would like to compare with my code. Thanks again. -- View this message in context: http://vtk.1045678.n5.nabble.com/30-million-points-and-Render-tp5737692p5737773.html Sent from the VTK - Users mailing list archive at Nabble.com. From kenji.tsumura at neosoftmedical.com Tue Apr 19 10:54:45 2016 From: kenji.tsumura at neosoftmedical.com (Kenji Tsumura) Date: Tue, 19 Apr 2016 14:54:45 +0000 Subject: [vtkusers] Java vtkPanel In-Reply-To: References: <10285631702C4D4CB5C4921DC14337954EEFD77E@neocoilexch01> <10285631702C4D4CB5C4921DC14337954EEFD7B6@neocoilexch01> Message-ID: <10285631702C4D4CB5C4921DC1433795548D1F00@neocoilexch01> Hi Seb, I tried using vtkPanel. The memory leak still persists. Please find the attached source code and captured memory profile. My environtment: VTK 7.0.0 CMake 3.1.1 Visual Studio Professional 2013 Eclipse Luna 4.4.1 (for my java application) As for library loader, the class just called bunch of System.loadLibrary. Are there anything I can try? Thank you, Kenji From: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] Sent: Monday, April 18, 2016 5:19 PM To: Kenji Tsumura Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Java vtkPanel Hum, Out of curiosity can you try using vtkPanel instead and calling its Java implementation of the delete() function and see if you can see it disappear or not within you tool (NetBean?)? I'm wondering which piece keep a ref on it... Seb On Mon, Apr 18, 2016 at 4:06 PM, Kenji Tsumura > wrote: Hi Seb, Thank you for the advice. So I change my test code as you suggested, but the problem still persists. JFrameRenderer.this.remove(renderWindowPanel); // renderWindowPanel.Delete(); renderWindowPanel = null; vtkObject.JAVA_OBJECT_MANAGER.gc(false); The attached shows the renderWindowPanel has not been released after 6 times of button click that triggers replacing the renderWindowPanel object. Do I miss something? Thank you, Kenji From: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] Sent: Monday, April 18, 2016 4:32 PM To: Kenji Tsumura Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Java vtkPanel Hi Kenji, You can look at what we are doing with the delete() method of vtkPanel (knowing that we leak on Linux instead of crashing). But I'm guessing I see 3 possible issue in your code. 1) You should try to detach your renderWindowPanel instance from the parent JFrame. 2) Then you should set it to null before calling vtkObject.JAVA_OBJECT_MANAGER.gc(false); 3) And in any case, you should not call Delete() on it. I'm thinking your code may cleanup its memory but not the first time you do it. After 3 times, you only cleared the first allocated memory. Hope that helps, Seb PS: If ever you want to contribute your native library loader, please feel free to do so, I can facilitate the process. ;-) On Mon, Apr 18, 2016 at 2:30 PM, Kenji Tsumura > wrote: Hi, I have a Java application that use vtkPanel. Precisely, I made a class that extends vtkRenderWindowPanel. When an object of the class is no more used, I would like to dispose the object. But I couldn?t dispose it no matter how. Java VisualVM indicates the object is JNI global reference. So how can I dispose it? I used the Delete method and called vtkObject.JAVA_OBJECT_MANAGER.gc(false), but it didn?t work (it works for other VTK objects). The attached file is a simple test code that demonstrates vtkRenderWindowPanel is never disposed. I have seen similar post in the past, but never be answered in the way I hope. So I decided to post. I would appreciate any advice. Thank you, Kenji ?The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: java_memory2.jpg Type: image/jpeg Size: 118920 bytes Desc: java_memory2.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: JFrameRenderer.java Type: application/octet-stream Size: 3777 bytes Desc: JFrameRenderer.java URL: From ken.martin at kitware.com Tue Apr 19 10:55:28 2016 From: ken.martin at kitware.com (Ken Martin) Date: Tue, 19 Apr 2016 10:55:28 -0400 Subject: [vtkusers] 30 million points and Render In-Reply-To: <1461077263030-5737773.post@n5.nabble.com> References: <1460645328211-5737692.post@n5.nabble.com> <1461077263030-5737773.post@n5.nabble.com> Message-ID: Here is my code as a remote module for VTK master along with some other info... - Ken Hiya folks, I have been playing with rendering point clouds using some LOD and multithreading techniques. One result of this is vtkLODPointCloudMapper and two supporting filters that reorganize the data into a better format for rendering. I have placed these items into a VTK remote module ( http://www.vtk.org/Wiki/VTK/Remote_Modules) and have attached the cmake file to pull it below. This module does rely on Will's vtkPointCloud module so make sure you have that and it is up to date first. This module includes a test which generates a synthetic point cloud. This test can be easily modified to adjust the number of points generated. In the image below I used 100 million points and included the vtkPointFillPass to fill small holes in the cloud, followed by a vtkEDLShadingPass to produce lighting effects based on the depth buffer. Sort of an interesting example of mixing point cloudswith some render passes. The LOD Shader itself only implements a very small subset of VTKs capabilities as it was designed to test out some different approaches to rendering. I have included the description from the header file below to give you some idea of what the class does. [image: Inline image 1] Thanks! Ken // This mapper only implements a very small subset of VTK's features. // Consider it experimental and as a starting point for other uses. This // mapper is designed to take a multiblock point cloud of the form // typically produced by vtkHierachicalBinningFilter and run through // vtkPointCloudToMultiBlock followed by vtkMultiBlockToCompressed. If // the compressed stage is skipped it will be done by the mapper // internally. // // The result of these filters should be a multiblockdataset where the // first block contains a sampling of the points from the entire point // cloud. Additional blocks will contain smaller subdivisions. A common // arrangement is 1 grandparent + 8 parents + 64 children in an octree // arrangement for a total of 73 blocks. // // This mapper uses unsigned shorts to store the XYZ values and uses // either 3 unsigned chars for color or one unsigned short for single // valued scalars. When using single valued scalars the lookup table is // hardcoded. When there is no color or scalars a blue to yellow pseudo // coloring is done based on depth. // // This mapper uses timing and coverage metrics to determine what blocks // to draw and how much of any given block to draw to maintain the // desired render rate. On a laptop with a nvidia 2Gig 960M (midrange // card) I see around one billion points/sec for a dataset of 140 // million points with RGB color // // While this mapper can be fed through a normal VTK pipeline, it also // supports being fed data one piece at a time using the SetDataForPiece // method. The intent is that the file IO can be handled in one thread, a // piece at a time, while the rendering is handled in another thread. // SetDataForPiece is what you would use to pass data from the file IO // thread to the rendering thread. On Tue, Apr 19, 2016 at 10:47 AM, alihadim wrote: > Thank you answer. If you possible can you sent me your code. > I would like to compare with my code. > > Thanks again. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/30-million-points-and-Render-tp5737692p5737773.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.jpg Type: image/jpeg Size: 154273 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtkLODPointCloudMapper.remote.cmake Type: application/octet-stream Size: 249 bytes Desc: not available URL: From heitz.matthieu at gmail.com Tue Apr 19 11:06:21 2016 From: heitz.matthieu at gmail.com (Matthieu Heitz) Date: Tue, 19 Apr 2016 17:06:21 +0200 Subject: [vtkusers] Non-virtual version of vtkDataArrayTemplate In-Reply-To: References: Message-ID: Thank you both for your answers, it was really helpful. Here is how I ended up writing it : int GetVTKType(std::size_t hash_code) { static std::map typeMap; if(typeMap.empty()) { typeMap[typeid(void).hash_code()] = VTK_VOID; typeMap[typeid(char).hash_code()] = VTK_CHAR; typeMap[typeid(signed char).hash_code()] = VTK_SIGNED_CHAR; typeMap[typeid(unsigned char).hash_code()] = VTK_UNSIGNED_CHAR; typeMap[typeid(short).hash_code()] = VTK_SHORT; typeMap[typeid(unsigned short).hash_code()] = VTK_UNSIGNED_SHORT; typeMap[typeid(int).hash_code()] = VTK_INT; typeMap[typeid(unsigned int).hash_code()] = VTK_UNSIGNED_INT; typeMap[typeid(long).hash_code()] = VTK_LONG; typeMap[typeid(unsigned long).hash_code()] = VTK_UNSIGNED_LONG; typeMap[typeid(float).hash_code()] = VTK_FLOAT; typeMap[typeid(double).hash_code()] = VTK_DOUBLE; typeMap[typeid(std::string).hash_code()] = VTK_STRING; typeMap[typeid(long long).hash_code()] = VTK_LONG_LONG; typeMap[typeid(unsigned long long).hash_code()] = VTK_UNSIGNED_LONG_LONG; typeMap[typeid(int64_t).hash_code()] = VTK___INT64; typeMap[typeid(uint64_t).hash_code()] = VTK_UNSIGNED___INT64; } return typeMap[hash_code]; } vtkDataArray * array = vtkDataArray::CreateDataArray(GetVTKType(typeid(T).hash_code())); Thanks again ! Matthieu Heitz 2016-04-07 15:50 GMT+02:00 Shawn Waldon : > Matthieu, > > If you have the VTK type code (VTK_INT, VTK_FLOAT, etc) there is a > function vtkDataArray::CreateDataArray(int type) that takes this type > code. You'll still have to do the first part of the code Cory gave, but > the switch statement is already implemented in VTK. I don't know if there > is anything that takes the template parameter and gives the type code > though. > > HTH, > Shawn > > On Thu, Apr 7, 2016 at 9:35 AM, Cory Quammen > wrote: > >> Hi Matthieu, >> >> I'm not sure if there is a templated array factory in VTK to do this. >> >> You could make specialized templated utility functions specialized for >> each of your types, e.g. (not tested): >> >> template >> int GetVTKType(T *) >> { >> return 0; >> } >> >> template <> >> int GetVTKType(int *) >> { >> return VTK_INT; >> } >> >> template <> >> int GetVTKType(float* ) >> { >> return VTK_FLOAT; >> } >> >> and so on, then use this to create the right type of array in a switch >> statement: >> >> int arrayType = GetVTKType(); >> switch (arrayType) >> { >> case VTK_INT: >> return vtkIntArray::New(); >> break; >> >> case VTK_FLOAT: >> return vtkFloatArray::New(); >> break; >> >> default: >> //... >> } >> >> HTH, >> Cory >> >> On Thu, Apr 7, 2016 at 7:08 AM, Matthieu Heitz >> wrote: >> >>> Hi all ! >>> >>> I have a template class myClass, where T can be a scalar (float, int, >>> double, etc.) >>> I would like to create a vtkFloatArray, vtkIntArray, or vtkDoubleArray, >>> depending on the type T. >>> I thought that vtkDataArrayTemplate would be a good solution. >>> Unfortunately, it is a virtual class, so I can't write this : >>> >>> vtkSmartPointer< vtkDataArrayTemplate > array = >>> vtkSmartPointer >::New(); >>> >>> because when I try to instantiate a myClass, I get the error : >>> >>> error: invalid conversion from ?vtkObject*? to >>> ?vtkDataArrayTemplate*? [-fpermissive] >>> >>> So my question is: Is there an non-virtual version of >>> vtkDataArrayTemplate that would allow me to create a vtkFloatArray when T >>> is float, vtkDoubleArray when T is double, etc. >>> >>> P.S: I use VTK 6.0.0 >>> >>> Thank you ! >>> Matthieu Heitz >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> >> >> -- >> Cory Quammen >> R&D Engineer >> Kitware, Inc. >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ali.hadimogullari at netcad.com.tr Tue Apr 19 11:08:35 2016 From: ali.hadimogullari at netcad.com.tr (alihadim) Date: Tue, 19 Apr 2016 08:08:35 -0700 (MST) Subject: [vtkusers] 30 million points and Render In-Reply-To: References: <1460645328211-5737692.post@n5.nabble.com> <1461077263030-5737773.post@n5.nabble.com> Message-ID: <1461078515367-5737777.post@n5.nabble.com> Ok. Thank you. Last Question, Can you tell me your system 64 bit and VTk version... -- View this message in context: http://vtk.1045678.n5.nabble.com/30-million-points-and-Render-tp5737692p5737777.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.lonie at kitware.com Tue Apr 19 11:29:04 2016 From: david.lonie at kitware.com (David Lonie) Date: Tue, 19 Apr 2016 11:29:04 -0400 Subject: [vtkusers] Building ActiViz 6.3 | vtkRenderingFreeTypeOpenGL Problem In-Reply-To: References: Message-ID: I can confirm that the module was removed, but someone more familiar with activiz will have to propose a fix. Might work just to search through the activiz layer and remove all references to the module. Nothing new replaced it, so just stripping it out might do the trick. HTH, Dave On Fri, Apr 15, 2016 at 9:27 AM, Matias Montroull wrote: > Hi, > > I was trying to build ActiViz 6.3 and I received the following error: > > LINK : fatal error LNK1104: cannot open file > 'vtkRenderingFreeTypeOpenGL.lib' > > ActiViz 6.2 compiled just fine so it seems that the > RenderingFreeTypeOpenGL module no longer exists in version VTK 6.3 and later > > Any way to remove this error? I would think the ActiViz source code will > need to be patched? > > By the way, I'm using a an ActiViz git source I cloned back in September > 2015 > > Thank you, > > Matias. > -- > Matias > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Apr 19 11:29:29 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 19 Apr 2016 11:29:29 -0400 Subject: [vtkusers] surface expansion In-Reply-To: References: <1460998425837-5737758.post@n5.nabble.com> Message-ID: Here is a c++ example. When I get a chance, I'll add it to the wiki examples... Try it with this file and a scale factor of 5 (second argument). https://raw.githubusercontent.com/lorensen/VTKWikiExamples/master/Testing/Data/Torso.vtp On Tue, Apr 19, 2016 at 9:12 AM, David Gobbi wrote: > I don't know of any example that does specifically what you want. > But the pipeline would go something like this: > > 1) use vtkPolyDataNormals to compute normals at each point. > > 2) feed the output of vtkPolyDataNormals into vtkWarpVector. > > 3) tell vtkWarpVector to use the normals, and give it a scale factor: > > warp.SetInputConnection(norms.GetOutputPort()) > > warp.SetInputArrayToProcess(0, 0, 0, > vtkDataObject.FIELD_ASSOCIATION_POINTS, > vtkDataSetAttributes.NORMALS) > > warp.SetScaleFactor(5.0) > > I've never actually tried this, but in theory, it should work. > > - David > > > -- Unpaid intern in BillsBasement at noware dot com -------------- next part -------------- A non-text attachment was scrubbed... Name: WarpSurface.cxx Type: application/octet-stream Size: 3850 bytes Desc: not available URL: From maxheinrich1988 at gmail.com Tue Apr 19 11:37:33 2016 From: maxheinrich1988 at gmail.com (Max-Heinrich Laves) Date: Tue, 19 Apr 2016 17:37:33 +0200 Subject: [vtkusers] vtkVectorText on iOS Message-ID: <2D952600-6D13-426A-8B54-4E0BD20FA985@gmail.com> Hello list, I am porting my android app (using Qt 5.6 and VTK 7.0) to iOS and noticed, that the iOS build of VTK is missing vtkVectorText. I did not change any options in cmake. As my app is using vtkVectorText, I?m wondering how to build and use vtkVectorText for iOS. Any ideas? Cheers, Max From richard.j.brown at live.co.uk Tue Apr 19 11:39:00 2016 From: richard.j.brown at live.co.uk (Richard Brown) Date: Tue, 19 Apr 2016 17:39:00 +0200 Subject: [vtkusers] surface expansion In-Reply-To: References: <1460998425837-5737758.post@n5.nabble.com> Message-ID: Wonderful, thanks a lot guys. Regards, Richard > On 19 Apr 2016, at 17:29, Bill Lorensen wrote: > > Here is a c++ example. When I get a chance, I'll add it to the wiki examples... > Try it with this file and a scale factor of 5 (second argument). > https://raw.githubusercontent.com/lorensen/VTKWikiExamples/master/Testing/Data/Torso.vtp > > On Tue, Apr 19, 2016 at 9:12 AM, David Gobbi wrote: >> I don't know of any example that does specifically what you want. >> But the pipeline would go something like this: >> >> 1) use vtkPolyDataNormals to compute normals at each point. >> >> 2) feed the output of vtkPolyDataNormals into vtkWarpVector. >> >> 3) tell vtkWarpVector to use the normals, and give it a scale factor: >> >> warp.SetInputConnection(norms.GetOutputPort()) >> >> warp.SetInputArrayToProcess(0, 0, 0, >> vtkDataObject.FIELD_ASSOCIATION_POINTS, >> vtkDataSetAttributes.NORMALS) >> >> warp.SetScaleFactor(5.0) >> >> I've never actually tried this, but in theory, it should work. >> >> - David >> >> >> > > > > -- > Unpaid intern in BillsBasement at noware dot com > From ken.martin at kitware.com Tue Apr 19 11:40:51 2016 From: ken.martin at kitware.com (Ken Martin) Date: Tue, 19 Apr 2016 11:40:51 -0400 Subject: [vtkusers] vtkVectorText on iOS In-Reply-To: <2D952600-6D13-426A-8B54-4E0BD20FA985@gmail.com> References: <2D952600-6D13-426A-8B54-4E0BD20FA985@gmail.com> Message-ID: You need to turn on the RenderingFreeType module. In VTK master this option is exposed for iOS builds. In VTK 7.0 I believe you have to manually edit vtk/CMake/vtkiOS.cmake to turn the option on. Thanks Ken On Tue, Apr 19, 2016 at 11:37 AM, Max-Heinrich Laves < maxheinrich1988 at gmail.com> wrote: > Hello list, > > I am porting my android app (using Qt 5.6 and VTK 7.0) to iOS and noticed, > that the iOS build of VTK is missing vtkVectorText. I did not change any > options in cmake. As my app is using vtkVectorText, I?m wondering how to > build and use vtkVectorText for iOS. Any ideas? > > Cheers, > Max > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Tue Apr 19 11:41:58 2016 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Tue, 19 Apr 2016 09:41:58 -0600 Subject: [vtkusers] Java vtkPanel In-Reply-To: <10285631702C4D4CB5C4921DC1433795548D1F00@neocoilexch01> References: <10285631702C4D4CB5C4921DC14337954EEFD77E@neocoilexch01> <10285631702C4D4CB5C4921DC14337954EEFD7B6@neocoilexch01> <10285631702C4D4CB5C4921DC1433795548D1F00@neocoilexch01> Message-ID: You should have kept "vtkObject.JAVA_OBJECT_MANAGER.gc(false);" Moreover, you can try with "true" so it will print out the actual classes that have been released. One thing that I'm not sure of, is that you start the interactor and I'm wondering if a thread is keeping a reference to the full tree in some way which prevent the structure to be cleaned up. Do you need the interactor? Are you using 3D widgets or picking? If so vtkCanvas might be a better fit as vtkPanel implement in the Java World a trackball type of interaction without using the vtkInteractor object. Seb On Tue, Apr 19, 2016 at 8:54 AM, Kenji Tsumura < kenji.tsumura at neosoftmedical.com> wrote: > Hi Seb, > > > > I tried using vtkPanel. The memory leak still persists. > > Please find the attached source code and captured memory profile. > > > > My environtment: > > VTK 7.0.0 > > CMake 3.1.1 > > Visual Studio Professional 2013 > > Eclipse Luna 4.4.1 (for my java application) > > > > As for library loader, the class just called bunch of System.loadLibrary. > > > > Are there anything I can try? > > Thank you, > > > > Kenji > > > > > > *From:* Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] > *Sent:* Monday, April 18, 2016 5:19 PM > > *To:* Kenji Tsumura > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Java vtkPanel > > > > Hum, > > > > Out of curiosity can you try using vtkPanel instead and calling its Java > implementation of the delete() function and see if you can see it disappear > or not within you tool (NetBean?)? > > > > I'm wondering which piece keep a ref on it... > > > > Seb > > > > On Mon, Apr 18, 2016 at 4:06 PM, Kenji Tsumura < > kenji.tsumura at neosoftmedical.com> wrote: > > Hi Seb, > > > > Thank you for the advice. > > So I change my test code as you suggested, but the problem still persists. > > > > JFrameRenderer.*this*.remove(renderWindowPanel); > > // renderWindowPanel.Delete(); > > renderWindowPanel = *null*; > > vtkObject.*JAVA_OBJECT_MANAGER*.gc(*false*); > > > > The attached shows the renderWindowPanel has not been released after 6 > times of button click that triggers replacing the renderWindowPanel object. > > Do I miss something? > > > > Thank you, > > > > Kenji > > > > *From:* Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] > *Sent:* Monday, April 18, 2016 4:32 PM > *To:* Kenji Tsumura > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Java vtkPanel > > > > Hi Kenji, > > > > You can look at what we are doing with the delete() method of vtkPanel > (knowing that we leak on Linux instead of crashing). > > But I'm guessing I see 3 possible issue in your code. > > > > 1) You should try to detach your renderWindowPanel instance from the > parent JFrame. > > 2) Then you should set it to null before > calling vtkObject.JAVA_OBJECT_MANAGER.gc(false); > > 3) And in any case, you should not call Delete() on it. > > > > I'm thinking your code may cleanup its memory but not the first time you > do it. After 3 times, you only cleared the first allocated memory. > > > > Hope that helps, > > > > Seb > > > > PS: If ever you want to contribute your native library loader, please feel > free to do so, I can facilitate the process. ;-) > > > > On Mon, Apr 18, 2016 at 2:30 PM, Kenji Tsumura < > kenji.tsumura at neosoftmedical.com> wrote: > > Hi, > > > > I have a Java application that use vtkPanel. Precisely, I made a class > that extends vtkRenderWindowPanel. When an object of the class is no more > used, I would like to dispose the object. But I couldn?t dispose it no > matter how. Java VisualVM indicates the object is JNI global reference. > So how can I dispose it? I used the Delete method and called > vtkObject.JAVA_OBJECT_MANAGER.gc(false), but it didn?t work (it works for > other VTK objects). The attached file is a simple test code that > demonstrates vtkRenderWindowPanel is never disposed. > > > > I have seen similar post in the past, but never be answered in the way I > hope. So I decided to post. I would appreciate any advice. > > Thank you, > > > > Kenji > > > > ?The information contained in this communication may be confidential, is > intended only for the use of the recipient(s) named above, and may be > legally privileged. If the reader of this message is not the intended > recipient, you are hereby notified that any dissemination, distribution, or > copying of this communication, or any of its contents, is strictly > prohibited. If you have received this communication in error, please return > it to the sender immediately and delete the original message and any copy > of it from your computer system. If you have any questions concerning this > message, please contact the sender. > > > > Disclaimer: The information contained in this communication may be > confidential, is intended only for the use of the recipient(s) named above, > and may be legally privileged. If the reader of this message is not the > intended recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication, or any of its contents, is > strictly prohibited. If you have received this communication in error, > please return it to the sender immediately and delete the original message > and any copy of it from your computer system. If you have any questions > concerning this message, please contact the sender. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > Disclaimer: The information contained in this communication may be > confidential, is intended only for the use of the recipient(s) named above, > and may be legally privileged. If the reader of this message is not the > intended recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication, or any of its contents, is > strictly prohibited. If you have received this communication in error, > please return it to the sender immediately and delete the original message > and any copy of it from your computer system. If you have any questions > concerning this message, please contact the sender. > > > Disclaimer: The information contained in this communication may be > confidential, is intended only for the use of the recipient(s) named above, > and may be legally privileged. If the reader of this message is not the > intended recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication, or any of its contents, is > strictly prohibited. If you have received this communication in error, > please return it to the sender immediately and delete the original message > and any copy of it from your computer system. If you have any questions > concerning this message, please contact the sender. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxheinrich1988 at gmail.com Tue Apr 19 11:46:53 2016 From: maxheinrich1988 at gmail.com (Max-Heinrich Laves) Date: Tue, 19 Apr 2016 17:46:53 +0200 Subject: [vtkusers] vtkVectorText on iOS In-Reply-To: References: <2D952600-6D13-426A-8B54-4E0BD20FA985@gmail.com> Message-ID: Thanks for quick response! I will try it and give feedback. Max > Am 19.04.2016 um 17:40 schrieb Ken Martin : > > You need to turn on the RenderingFreeType module. In VTK master this option is exposed for iOS builds. In VTK 7.0 I believe you have to manually edit vtk/CMake/vtkiOS.cmake to turn the option on. > > Thanks > Ken > > > > > On Tue, Apr 19, 2016 at 11:37 AM, Max-Heinrich Laves > wrote: > Hello list, > > I am porting my android app (using Qt 5.6 and VTK 7.0) to iOS and noticed, that the iOS build of VTK is missing vtkVectorText. I did not change any options in cmake. As my app is using vtkVectorText, I?m wondering how to build and use vtkVectorText for iOS. Any ideas? > > Cheers, > Max > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > -- > Ken Martin PhD > Chairman & CFO > Kitware Inc. > 28 Corporate Drive > Clifton Park NY 12065 > 518 371 3971 > > This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Tue Apr 19 12:20:18 2016 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 19 Apr 2016 16:20:18 +0000 Subject: [vtkusers] Building ActiViz 6.3 | vtkRenderingFreeTypeOpenGL Problem In-Reply-To: References: Message-ID: Hi David, I compiled ActiViz 6.3 successfully, I removed the references from Cmake and "WrappedObject.cs.in" in the ActiViz source code and that seems to have done the trick.. I'm testing on my app and it works well so far. Regards, Matias El mar., 19 de abr. de 2016 a la(s) 12:29, David Lonie < david.lonie at kitware.com> escribi?: > I can confirm that the module was removed, but someone more familiar with > activiz will have to propose a fix. > > Might work just to search through the activiz layer and remove all > references to the module. Nothing new replaced it, so just stripping it out > might do the trick. > > HTH, > Dave > > On Fri, Apr 15, 2016 at 9:27 AM, Matias Montroull > wrote: > >> Hi, >> >> I was trying to build ActiViz 6.3 and I received the following error: >> >> LINK : fatal error LNK1104: cannot open file >> 'vtkRenderingFreeTypeOpenGL.lib' >> >> ActiViz 6.2 compiled just fine so it seems that the >> RenderingFreeTypeOpenGL module no longer exists in version VTK 6.3 and later >> >> Any way to remove this error? I would think the ActiViz source code will >> need to be patched? >> >> By the way, I'm using a an ActiViz git source I cloned back in September >> 2015 >> >> Thank you, >> >> Matias. >> -- >> Matias >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -- Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Tue Apr 19 13:26:20 2016 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 19 Apr 2016 17:26:20 +0000 Subject: [vtkusers] Save the image on resliced viewer as DICOM data In-Reply-To: <1461034917791-5737769.post@n5.nabble.com> References: <1461034917791-5737769.post@n5.nabble.com> Message-ID: I don't think I quite understand your question, can you elaborate a bit more? El mar., 19 de abr. de 2016 a la(s) 00:02, Chiyoko Koujima < koujima at pronotec.co.jp> escribi?: > Hi, > I'm trying to save the image data on resliced viewer as DICOM data in order > to change WW,WL. > Position and angle also in the same as look. > In a way that I used it takes 20 seconds per sheet. > And it is an error to be processed in the background. > Made data seem to have the wrong part... > > Do anyone knows better way? > > in my way: > > var polyData = cutter.GetOutput(); > var pointData = polyData.GetPointData(); > var scalars = (vtkShortArray)pointData.GetScalars(); > var point = polyData.FindPoint(x, y, 0); // this step takes a long time > var value = scalars.GetValue(point); > > in this way I don't use data on reslice viewer. But actually I want to use > data on resliced viewer. > > Regards, > Chiyoko > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Save-the-image-on-resliced-viewer-as-DICOM-data-tp5737769.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji.tsumura at neosoftmedical.com Tue Apr 19 13:52:43 2016 From: kenji.tsumura at neosoftmedical.com (Kenji Tsumura) Date: Tue, 19 Apr 2016 17:52:43 +0000 Subject: [vtkusers] Java vtkPanel In-Reply-To: References: <10285631702C4D4CB5C4921DC14337954EEFD77E@neocoilexch01> <10285631702C4D4CB5C4921DC14337954EEFD7B6@neocoilexch01> <10285631702C4D4CB5C4921DC1433795548D1F00@neocoilexch01> Message-ID: <10285631702C4D4CB5C4921DC1433795548D3FB7@neocoilexch01> Hi Seb, Here is the information I got. vtkOpenGLLight, vtkOpenGLCamera, vtkWin32OpenGLRenderWindow, and vtkOpenGLRenderer are not disposed. When vtkRenderWindowPanel is used, two vktLight objects are instantiated, and only one of them are disposed. Do we have any suggestion on how to dispose these objects? Using vtkPanel List of classes kept in Java layer: - vtkOpenGLLight: 1 - vtkOpenGLCamera: 1 - vtkWin32OpenGLRenderWindow: 1 - vtkOpenGLRenderer: 1 List of classes removed in Java layer: - vtkOpenGLPolyDataMapper: 1 - vtkOpenGLActor: 1 - vtkInteractorStyleTrackballCamera: 1 - vtkGenericRenderWindowInteractor: 1 - vtkSphereSource: 1 - vtkAlgorithmOutput: 1 Using vtkCanvas List of classes kept in Java layer: - vtkOpenGLLight: 1 - vtkOpenGLCamera: 1 - vtkWin32OpenGLRenderWindow: 1 - vtkOpenGLRenderer: 1 List of classes removed in Java layer: - vtkOpenGLPolyDataMapper: 1 - vtkOpenGLActor: 1 - vtkInteractorStyleTrackballCamera: 2 - vtkGenericRenderWindowInteractor: 1 - vtkSphereSource: 1 - vtkBoxWidget: 1 - vtkAlgorithmOutput: 1 - vtkPlaneWidget: 1 Using vtkRenderWindowPanel List of classes kept in Java layer: - vtkOpenGLLight: 1 - vtkOpenGLCamera: 1 - vtkWin32OpenGLRenderWindow: 1 - vtkOpenGLRenderer: 1 List of classes removed in Java layer: - vtkOpenGLLight: 1 - vtkOpenGLPolyDataMapper: 1 - vtkOpenGLActor: 1 - vtkInteractorStyleTrackballCamera: 2 - vtkGenericRenderWindowInteractor: 1 - vtkSphereSource: 1 - vtkBoxWidget: 1 - vtkAlgorithmOutput: 1 - vtkPlaneWidget: 1 BTY, >Do you need the interactor? Yes. We need to interact with users (rotation, pan, WW/WL, etc). > Are you using 3D widgets or picking? No, at the moment. Thank you, Kenji From: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] Sent: Tuesday, April 19, 2016 10:42 AM To: Kenji Tsumura Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Java vtkPanel You should have kept "vtkObject.JAVA_OBJECT_MANAGER.gc(false);" Moreover, you can try with "true" so it will print out the actual classes that have been released. One thing that I'm not sure of, is that you start the interactor and I'm wondering if a thread is keeping a reference to the full tree in some way which prevent the structure to be cleaned up. Do you need the interactor? Are you using 3D widgets or picking? If so vtkCanvas might be a better fit as vtkPanel implement in the Java World a trackball type of interaction without using the vtkInteractor object. Seb On Tue, Apr 19, 2016 at 8:54 AM, Kenji Tsumura > wrote: Hi Seb, I tried using vtkPanel. The memory leak still persists. Please find the attached source code and captured memory profile. My environtment: VTK 7.0.0 CMake 3.1.1 Visual Studio Professional 2013 Eclipse Luna 4.4.1 (for my java application) As for library loader, the class just called bunch of System.loadLibrary. Are there anything I can try? Thank you, Kenji From: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] Sent: Monday, April 18, 2016 5:19 PM To: Kenji Tsumura Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Java vtkPanel Hum, Out of curiosity can you try using vtkPanel instead and calling its Java implementation of the delete() function and see if you can see it disappear or not within you tool (NetBean?)? I'm wondering which piece keep a ref on it... Seb On Mon, Apr 18, 2016 at 4:06 PM, Kenji Tsumura > wrote: Hi Seb, Thank you for the advice. So I change my test code as you suggested, but the problem still persists. JFrameRenderer.this.remove(renderWindowPanel); // renderWindowPanel.Delete(); renderWindowPanel = null; vtkObject.JAVA_OBJECT_MANAGER.gc(false); The attached shows the renderWindowPanel has not been released after 6 times of button click that triggers replacing the renderWindowPanel object. Do I miss something? Thank you, Kenji From: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] Sent: Monday, April 18, 2016 4:32 PM To: Kenji Tsumura Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Java vtkPanel Hi Kenji, You can look at what we are doing with the delete() method of vtkPanel (knowing that we leak on Linux instead of crashing). But I'm guessing I see 3 possible issue in your code. 1) You should try to detach your renderWindowPanel instance from the parent JFrame. 2) Then you should set it to null before calling vtkObject.JAVA_OBJECT_MANAGER.gc(false); 3) And in any case, you should not call Delete() on it. I'm thinking your code may cleanup its memory but not the first time you do it. After 3 times, you only cleared the first allocated memory. Hope that helps, Seb PS: If ever you want to contribute your native library loader, please feel free to do so, I can facilitate the process. ;-) On Mon, Apr 18, 2016 at 2:30 PM, Kenji Tsumura > wrote: Hi, I have a Java application that use vtkPanel. Precisely, I made a class that extends vtkRenderWindowPanel. When an object of the class is no more used, I would like to dispose the object. But I couldn?t dispose it no matter how. Java VisualVM indicates the object is JNI global reference. So how can I dispose it? I used the Delete method and called vtkObject.JAVA_OBJECT_MANAGER.gc(false), but it didn?t work (it works for other VTK objects). The attached file is a simple test code that demonstrates vtkRenderWindowPanel is never disposed. I have seen similar post in the past, but never be answered in the way I hope. So I decided to post. I would appreciate any advice. Thank you, Kenji ?The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Tue Apr 19 14:29:54 2016 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Tue, 19 Apr 2016 12:29:54 -0600 Subject: [vtkusers] Java vtkPanel In-Reply-To: <10285631702C4D4CB5C4921DC1433795548D3FB7@neocoilexch01> References: <10285631702C4D4CB5C4921DC14337954EEFD77E@neocoilexch01> <10285631702C4D4CB5C4921DC14337954EEFD7B6@neocoilexch01> <10285631702C4D4CB5C4921DC1433795548D1F00@neocoilexch01> <10285631702C4D4CB5C4921DC1433795548D3FB7@neocoilexch01> Message-ID: Hi Kenji, Nothing comes to my mind on what could keep a reference to those classes. Having them listing somehow reduce the search area. Regarding the interactor. It seems you don't need it as you don't have 3D widgets or picking. That interactor can be managed on the Java side like vtkPanel is doing. I'm not saying you must go that route, but that was one of a suggestion to see if for some reason a thread was keeping a reference to that interactor. Although based on the latest output, it does not seems to be the case as it get properly cleaned up. I don't have any clue on how to figure it out without spending some time looking at that issue myself. Good luck with your investigation, Seb On Tue, Apr 19, 2016 at 11:52 AM, Kenji Tsumura < kenji.tsumura at neosoftmedical.com> wrote: > Hi Seb, > > > > Here is the information I got. vtkOpenGLLight, vtkOpenGLCamera, > vtkWin32OpenGLRenderWindow, and vtkOpenGLRenderer are not disposed. When > vtkRenderWindowPanel is used, two vktLight objects are instantiated, and > only one of them are disposed. > > Do we have any suggestion on how to dispose these objects? > > > > Using vtkPanel > > List of classes kept in Java layer: > > - vtkOpenGLLight: 1 > > - vtkOpenGLCamera: 1 > > - vtkWin32OpenGLRenderWindow: 1 > > - vtkOpenGLRenderer: 1 > > > > List of classes removed in Java layer: > > - vtkOpenGLPolyDataMapper: 1 > > - vtkOpenGLActor: 1 > > - vtkInteractorStyleTrackballCamera: 1 > > - vtkGenericRenderWindowInteractor: 1 > > - vtkSphereSource: 1 > > - vtkAlgorithmOutput: 1 > > > > > > Using vtkCanvas > > List of classes kept in Java layer: > > - vtkOpenGLLight: 1 > > - vtkOpenGLCamera: 1 > > - vtkWin32OpenGLRenderWindow: 1 > > - vtkOpenGLRenderer: 1 > > > > List of classes removed in Java layer: > > - vtkOpenGLPolyDataMapper: 1 > > - vtkOpenGLActor: 1 > > - vtkInteractorStyleTrackballCamera: 2 > > - vtkGenericRenderWindowInteractor: 1 > > - vtkSphereSource: 1 > > - vtkBoxWidget: 1 > > - vtkAlgorithmOutput: 1 > > - vtkPlaneWidget: 1 > > > > > > Using vtkRenderWindowPanel > > List of classes kept in Java layer: > > - vtkOpenGLLight: 1 > > - vtkOpenGLCamera: 1 > > - vtkWin32OpenGLRenderWindow: 1 > > - vtkOpenGLRenderer: 1 > > > > List of classes removed in Java layer: > > - vtkOpenGLLight: 1 > > - vtkOpenGLPolyDataMapper: 1 > > - vtkOpenGLActor: 1 > > - vtkInteractorStyleTrackballCamera: 2 > > - vtkGenericRenderWindowInteractor: 1 > > - vtkSphereSource: 1 > > - vtkBoxWidget: 1 > > - vtkAlgorithmOutput: 1 > > - vtkPlaneWidget: 1 > > > > BTY, > > >Do you need the interactor? > > Yes. We need to interact with users (rotation, pan, WW/WL, etc). > > > Are you using 3D widgets or picking? > > No, at the moment. > > > > Thank you, > > > > Kenji > > *From:* Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] > *Sent:* Tuesday, April 19, 2016 10:42 AM > > *To:* Kenji Tsumura > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Java vtkPanel > > > > You should have kept "vtkObject.JAVA_OBJECT_MANAGER.gc(false);" > > Moreover, you can try with "true" so it will print out the actual classes > that have been released. > > > > One thing that I'm not sure of, is that you start the interactor and I'm > wondering if a thread is keeping a reference to the full tree in some way > which prevent the structure to be cleaned up. Do you need the interactor? > Are you using 3D widgets or picking? If so vtkCanvas might be a better fit > as vtkPanel implement in the Java World a trackball type of interaction > without using the vtkInteractor object. > > > > Seb > > > > On Tue, Apr 19, 2016 at 8:54 AM, Kenji Tsumura < > kenji.tsumura at neosoftmedical.com> wrote: > > Hi Seb, > > > > I tried using vtkPanel. The memory leak still persists. > > Please find the attached source code and captured memory profile. > > > > My environtment: > > VTK 7.0.0 > > CMake 3.1.1 > > Visual Studio Professional 2013 > > Eclipse Luna 4.4.1 (for my java application) > > > > As for library loader, the class just called bunch of System.loadLibrary. > > > > Are there anything I can try? > > Thank you, > > > > Kenji > > > > > > *From:* Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] > *Sent:* Monday, April 18, 2016 5:19 PM > > > *To:* Kenji Tsumura > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Java vtkPanel > > > > Hum, > > > > Out of curiosity can you try using vtkPanel instead and calling its Java > implementation of the delete() function and see if you can see it disappear > or not within you tool (NetBean?)? > > > > I'm wondering which piece keep a ref on it... > > > > Seb > > > > On Mon, Apr 18, 2016 at 4:06 PM, Kenji Tsumura < > kenji.tsumura at neosoftmedical.com> wrote: > > Hi Seb, > > > > Thank you for the advice. > > So I change my test code as you suggested, but the problem still persists. > > > > JFrameRenderer.*this*.remove(renderWindowPanel); > > // renderWindowPanel.Delete(); > > renderWindowPanel = *null*; > > vtkObject.*JAVA_OBJECT_MANAGER*.gc(*false*); > > > > The attached shows the renderWindowPanel has not been released after 6 > times of button click that triggers replacing the renderWindowPanel object. > > Do I miss something? > > > > Thank you, > > > > Kenji > > > > *From:* Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] > *Sent:* Monday, April 18, 2016 4:32 PM > *To:* Kenji Tsumura > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Java vtkPanel > > > > Hi Kenji, > > > > You can look at what we are doing with the delete() method of vtkPanel > (knowing that we leak on Linux instead of crashing). > > But I'm guessing I see 3 possible issue in your code. > > > > 1) You should try to detach your renderWindowPanel instance from the > parent JFrame. > > 2) Then you should set it to null before > calling vtkObject.JAVA_OBJECT_MANAGER.gc(false); > > 3) And in any case, you should not call Delete() on it. > > > > I'm thinking your code may cleanup its memory but not the first time you > do it. After 3 times, you only cleared the first allocated memory. > > > > Hope that helps, > > > > Seb > > > > PS: If ever you want to contribute your native library loader, please feel > free to do so, I can facilitate the process. ;-) > > > > On Mon, Apr 18, 2016 at 2:30 PM, Kenji Tsumura < > kenji.tsumura at neosoftmedical.com> wrote: > > Hi, > > > > I have a Java application that use vtkPanel. Precisely, I made a class > that extends vtkRenderWindowPanel. When an object of the class is no more > used, I would like to dispose the object. But I couldn?t dispose it no > matter how. Java VisualVM indicates the object is JNI global reference. > So how can I dispose it? I used the Delete method and called > vtkObject.JAVA_OBJECT_MANAGER.gc(false), but it didn?t work (it works for > other VTK objects). The attached file is a simple test code that > demonstrates vtkRenderWindowPanel is never disposed. > > > > I have seen similar post in the past, but never be answered in the way I > hope. So I decided to post. I would appreciate any advice. > > Thank you, > > > > Kenji > > > > ?The information contained in this communication may be confidential, is > intended only for the use of the recipient(s) named above, and may be > legally privileged. If the reader of this message is not the intended > recipient, you are hereby notified that any dissemination, distribution, or > copying of this communication, or any of its contents, is strictly > prohibited. If you have received this communication in error, please return > it to the sender immediately and delete the original message and any copy > of it from your computer system. If you have any questions concerning this > message, please contact the sender. > > > > Disclaimer: The information contained in this communication may be > confidential, is intended only for the use of the recipient(s) named above, > and may be legally privileged. If the reader of this message is not the > intended recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication, or any of its contents, is > strictly prohibited. If you have received this communication in error, > please return it to the sender immediately and delete the original message > and any copy of it from your computer system. If you have any questions > concerning this message, please contact the sender. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > Disclaimer: The information contained in this communication may be > confidential, is intended only for the use of the recipient(s) named above, > and may be legally privileged. If the reader of this message is not the > intended recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication, or any of its contents, is > strictly prohibited. If you have received this communication in error, > please return it to the sender immediately and delete the original message > and any copy of it from your computer system. If you have any questions > concerning this message, please contact the sender. > > > > Disclaimer: The information contained in this communication may be > confidential, is intended only for the use of the recipient(s) named above, > and may be legally privileged. If the reader of this message is not the > intended recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication, or any of its contents, is > strictly prohibited. If you have received this communication in error, > please return it to the sender immediately and delete the original message > and any copy of it from your computer system. If you have any questions > concerning this message, please contact the sender. > > > Disclaimer: The information contained in this communication may be > confidential, is intended only for the use of the recipient(s) named above, > and may be legally privileged. If the reader of this message is not the > intended recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication, or any of its contents, is > strictly prohibited. If you have received this communication in error, > please return it to the sender immediately and delete the original message > and any copy of it from your computer system. If you have any questions > concerning this message, please contact the sender. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji.tsumura at neosoftmedical.com Tue Apr 19 15:00:51 2016 From: kenji.tsumura at neosoftmedical.com (Kenji Tsumura) Date: Tue, 19 Apr 2016 19:00:51 +0000 Subject: [vtkusers] Java vtkPanel In-Reply-To: References: <10285631702C4D4CB5C4921DC14337954EEFD77E@neocoilexch01> <10285631702C4D4CB5C4921DC14337954EEFD7B6@neocoilexch01> <10285631702C4D4CB5C4921DC1433795548D1F00@neocoilexch01> <10285631702C4D4CB5C4921DC1433795548D3FB7@neocoilexch01> Message-ID: <10285631702C4D4CB5C4921DC1433795548D5005@neocoilexch01> Hi Seb, Thank you for your advice anyway. Kenji From: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] Sent: Tuesday, April 19, 2016 1:30 PM To: Kenji Tsumura Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Java vtkPanel Hi Kenji, Nothing comes to my mind on what could keep a reference to those classes. Having them listing somehow reduce the search area. Regarding the interactor. It seems you don't need it as you don't have 3D widgets or picking. That interactor can be managed on the Java side like vtkPanel is doing. I'm not saying you must go that route, but that was one of a suggestion to see if for some reason a thread was keeping a reference to that interactor. Although based on the latest output, it does not seems to be the case as it get properly cleaned up. I don't have any clue on how to figure it out without spending some time looking at that issue myself. Good luck with your investigation, Seb On Tue, Apr 19, 2016 at 11:52 AM, Kenji Tsumura > wrote: Hi Seb, Here is the information I got. vtkOpenGLLight, vtkOpenGLCamera, vtkWin32OpenGLRenderWindow, and vtkOpenGLRenderer are not disposed. When vtkRenderWindowPanel is used, two vktLight objects are instantiated, and only one of them are disposed. Do we have any suggestion on how to dispose these objects? Using vtkPanel List of classes kept in Java layer: - vtkOpenGLLight: 1 - vtkOpenGLCamera: 1 - vtkWin32OpenGLRenderWindow: 1 - vtkOpenGLRenderer: 1 List of classes removed in Java layer: - vtkOpenGLPolyDataMapper: 1 - vtkOpenGLActor: 1 - vtkInteractorStyleTrackballCamera: 1 - vtkGenericRenderWindowInteractor: 1 - vtkSphereSource: 1 - vtkAlgorithmOutput: 1 Using vtkCanvas List of classes kept in Java layer: - vtkOpenGLLight: 1 - vtkOpenGLCamera: 1 - vtkWin32OpenGLRenderWindow: 1 - vtkOpenGLRenderer: 1 List of classes removed in Java layer: - vtkOpenGLPolyDataMapper: 1 - vtkOpenGLActor: 1 - vtkInteractorStyleTrackballCamera: 2 - vtkGenericRenderWindowInteractor: 1 - vtkSphereSource: 1 - vtkBoxWidget: 1 - vtkAlgorithmOutput: 1 - vtkPlaneWidget: 1 Using vtkRenderWindowPanel List of classes kept in Java layer: - vtkOpenGLLight: 1 - vtkOpenGLCamera: 1 - vtkWin32OpenGLRenderWindow: 1 - vtkOpenGLRenderer: 1 List of classes removed in Java layer: - vtkOpenGLLight: 1 - vtkOpenGLPolyDataMapper: 1 - vtkOpenGLActor: 1 - vtkInteractorStyleTrackballCamera: 2 - vtkGenericRenderWindowInteractor: 1 - vtkSphereSource: 1 - vtkBoxWidget: 1 - vtkAlgorithmOutput: 1 - vtkPlaneWidget: 1 BTY, >Do you need the interactor? Yes. We need to interact with users (rotation, pan, WW/WL, etc). > Are you using 3D widgets or picking? No, at the moment. Thank you, Kenji From: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] Sent: Tuesday, April 19, 2016 10:42 AM To: Kenji Tsumura Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Java vtkPanel You should have kept "vtkObject.JAVA_OBJECT_MANAGER.gc(false);" Moreover, you can try with "true" so it will print out the actual classes that have been released. One thing that I'm not sure of, is that you start the interactor and I'm wondering if a thread is keeping a reference to the full tree in some way which prevent the structure to be cleaned up. Do you need the interactor? Are you using 3D widgets or picking? If so vtkCanvas might be a better fit as vtkPanel implement in the Java World a trackball type of interaction without using the vtkInteractor object. Seb On Tue, Apr 19, 2016 at 8:54 AM, Kenji Tsumura > wrote: Hi Seb, I tried using vtkPanel. The memory leak still persists. Please find the attached source code and captured memory profile. My environtment: VTK 7.0.0 CMake 3.1.1 Visual Studio Professional 2013 Eclipse Luna 4.4.1 (for my java application) As for library loader, the class just called bunch of System.loadLibrary. Are there anything I can try? Thank you, Kenji From: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] Sent: Monday, April 18, 2016 5:19 PM To: Kenji Tsumura Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Java vtkPanel Hum, Out of curiosity can you try using vtkPanel instead and calling its Java implementation of the delete() function and see if you can see it disappear or not within you tool (NetBean?)? I'm wondering which piece keep a ref on it... Seb On Mon, Apr 18, 2016 at 4:06 PM, Kenji Tsumura > wrote: Hi Seb, Thank you for the advice. So I change my test code as you suggested, but the problem still persists. JFrameRenderer.this.remove(renderWindowPanel); // renderWindowPanel.Delete(); renderWindowPanel = null; vtkObject.JAVA_OBJECT_MANAGER.gc(false); The attached shows the renderWindowPanel has not been released after 6 times of button click that triggers replacing the renderWindowPanel object. Do I miss something? Thank you, Kenji From: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] Sent: Monday, April 18, 2016 4:32 PM To: Kenji Tsumura Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Java vtkPanel Hi Kenji, You can look at what we are doing with the delete() method of vtkPanel (knowing that we leak on Linux instead of crashing). But I'm guessing I see 3 possible issue in your code. 1) You should try to detach your renderWindowPanel instance from the parent JFrame. 2) Then you should set it to null before calling vtkObject.JAVA_OBJECT_MANAGER.gc(false); 3) And in any case, you should not call Delete() on it. I'm thinking your code may cleanup its memory but not the first time you do it. After 3 times, you only cleared the first allocated memory. Hope that helps, Seb PS: If ever you want to contribute your native library loader, please feel free to do so, I can facilitate the process. ;-) On Mon, Apr 18, 2016 at 2:30 PM, Kenji Tsumura > wrote: Hi, I have a Java application that use vtkPanel. Precisely, I made a class that extends vtkRenderWindowPanel. When an object of the class is no more used, I would like to dispose the object. But I couldn?t dispose it no matter how. Java VisualVM indicates the object is JNI global reference. So how can I dispose it? I used the Delete method and called vtkObject.JAVA_OBJECT_MANAGER.gc(false), but it didn?t work (it works for other VTK objects). The attached file is a simple test code that demonstrates vtkRenderWindowPanel is never disposed. I have seen similar post in the past, but never be answered in the way I hope. So I decided to post. I would appreciate any advice. Thank you, Kenji ?The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Apr 19 15:31:58 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 19 Apr 2016 15:31:58 -0400 Subject: [vtkusers] surface expansion In-Reply-To: References: <1460998425837-5737758.post@n5.nabble.com> Message-ID: There is now a wiki example. http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/WarpSurface On Tue, Apr 19, 2016 at 11:39 AM, Richard Brown wrote: > Wonderful, thanks a lot guys. > > Regards, > Richard > >> On 19 Apr 2016, at 17:29, Bill Lorensen wrote: >> >> Here is a c++ example. When I get a chance, I'll add it to the wiki examples... >> Try it with this file and a scale factor of 5 (second argument). >> https://raw.githubusercontent.com/lorensen/VTKWikiExamples/master/Testing/Data/Torso.vtp >> >> On Tue, Apr 19, 2016 at 9:12 AM, David Gobbi wrote: >>> I don't know of any example that does specifically what you want. >>> But the pipeline would go something like this: >>> >>> 1) use vtkPolyDataNormals to compute normals at each point. >>> >>> 2) feed the output of vtkPolyDataNormals into vtkWarpVector. >>> >>> 3) tell vtkWarpVector to use the normals, and give it a scale factor: >>> >>> warp.SetInputConnection(norms.GetOutputPort()) >>> >>> warp.SetInputArrayToProcess(0, 0, 0, >>> vtkDataObject.FIELD_ASSOCIATION_POINTS, >>> vtkDataSetAttributes.NORMALS) >>> >>> warp.SetScaleFactor(5.0) >>> >>> I've never actually tried this, but in theory, it should work. >>> >>> - David >>> >>> >>> >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com >> > -- Unpaid intern in BillsBasement at noware dot com From erich.bremer at stonybrook.edu Tue Apr 19 15:58:42 2016 From: erich.bremer at stonybrook.edu (Erich Bremer) Date: Tue, 19 Apr 2016 15:58:42 -0400 Subject: [vtkusers] extracting a subtile from vtkimage Message-ID: I am trying to extract a subtile from a vtkimage using the following code: def GetTile(self,image,x1,y1,x2,y2): i = vtk.vtkImageData().NewInstance() i.SetDimensions(x2-x1+1,y2-y1+1,1) i.AllocateScalars(vtk.VTK_UNSIGNED_CHAR,3) for x in range(x1,x2+1): for y in range(y1,y2+1): i.SetScalarComponentFromDouble(x-x1,y-y1,0,0,image.GetScalarComponentAsDouble(x,y,0,0)) return i x1,y1 being the upper left corner of the subimage x2,y2 being the lower right corner of the subimage and it appears to work when I view the subtile using: data = self.GetTile(myvtkimage,0,0,256,256).GetPointData() data = numpy_support.vtk_to_numpy(data.GetArray(0)) d = data[:,0] dd = d.reshape(256,256) iii = sitk.GetImageFromArray(dd) sitk.WriteImage(iii,"/home/erich/subtile.jpg") But, they don't appear the same because a segmentation program that works fine on the original image doesn't work on the subtiled image (even using the same original dimensions) Any thoughts? -- ========================================================== Erich Bremer, M.Sc. Director for Cyberinfrastructure Department of Biomedical Informatics Stony Brook Medicine Tel. : 1-631-444-3560 Fax : 1-631-444-8873 Cell : 1-631-681-6228 erich.bremer at stonybrook.edu Office Location/Mailing Address HSC, L3: Room 119 Stony Brook, NY 11794-8330 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eduardo.ecamargo at gmail.com Tue Apr 19 15:59:40 2016 From: eduardo.ecamargo at gmail.com (Eduardo - Gmail) Date: Tue, 19 Apr 2016 12:59:40 -0700 Subject: [vtkusers] OFF_TOPIC:Job position, Vancouver - Canada Message-ID: Hi!! Does anybody know about any job position (for work with vtk) in Vancouver, Canada?? Kind Regards, Camargo, Eduardo, M.Sc. Skype: camargo_rh "Work hard toward your goals, no matter what obstacles get in your way. Even if you think you can?t do it, just be disciplined, put your mind to it, and then do your best." - Jean Chiar - SETI Institute -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.ei at novodynamics.com Tue Apr 19 16:27:45 2016 From: david.ei at novodynamics.com (dei) Date: Tue, 19 Apr 2016 13:27:45 -0700 (MST) Subject: [vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper In-Reply-To: References: <1460742057180-5737734.post@n5.nabble.com> Message-ID: <1461097665105-5737793.post@n5.nabble.com> After some headaches, I think I have VTK built with testing. I switched on BUILD_TESTING and BUILD_ALL_MODULES_FOR_TESTS and, after some headaches, got it configured and generated in cmake-gui and built in Visual Studio. I don't have any VBOPLY tests, however. I do have vtkRenderingOpenGL2CxxTests.exe and it passes (along with 1000 other tests). vtkRenderingOpenGL2CxxTests project has a TestVBOPLYMapper.cxx file in it. Is this the test you were recommending I run? I'm building and running in Visual Studio 2012 on Windows 7 Professional-x64. If so, it passes when run by the RUN_TESTS project. -- View this message in context: http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734p5737793.html Sent from the VTK - Users mailing list archive at Nabble.com. From elvis.chen at gmail.com Tue Apr 19 23:01:43 2016 From: elvis.chen at gmail.com (Elvis Chen) Date: Tue, 19 Apr 2016 23:01:43 -0400 Subject: [vtkusers] hardware acceleratec OpenGL on Raspberry pi 3/Raspbian? In-Reply-To: References: Message-ID: hi all, This is a status update on vtk on Raspberry pi, with hardware accelerated OpenGL. After a few days of trial and error, I managed to get VTK working on Raspberry Pi 3. I hope my experience can save others some time, as information on the web can be misleading. First of, I am using Raspberry Pi 3. The DOs and DONTs DO: - make sure you use the official PSU (rated at 2.5A), as there are reports that an under-powered PI causes OpenGL driver to fail, DONTs: - don't use the official 7" touch screen. The OpenGL driver apparently is very picky on the output format. It won't work with the 7" touch screen - don't follow the instruction on https://www.raspberrypi.org/blog/another-new-raspbian-release/, in particular DO NOT UPGRADE Raspbian. Here is what I had to do to get hardware accelerated OpenGL to work: - create a new raspbian/Jessie bootdisk using 2016-03-18 image - upon first boot, which boots into X by default, expand the file system using Menu->Preference->Raspberry Pi Configuration. Reboot - upon 2nd boot, change keyboard/time-zone as desired. Using the same configuration utility as the previous step, change the boot option to "To CLI" instead of "To Desktop". Reboot. - now raspbian will boot into commandline instead of X. Issue the following command: sudo raspi-config - under Advanced Options, Enable OpenGL driver, reboot - once rebooted, issue "startx" - open a terminal, issue the following command sudo apt-get update sudo apt-get install libvtk5-qt4-dev cmake cmake-curses-gui mesa-utils I choose vtk5 but vtk6 is also available as a pre-compiled package. - with mesa-utils installed, you can run glxgears to test opengl. I am getting 59FPS on RPi3 pi at raspberrypi:~/research/bin/vtkViewPolyDataMesh $ glxgears Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. 293 frames in 5.0 seconds = 58.548 FPS 301 frames in 5.0 seconds = 59.994 FPS 299 frames in 5.0 seconds = 59.613 FPS 290 frames in 5.0 seconds = 57.999 FPS 300 frames in 5.0 seconds = 59.807 FPS 300 frames in 5.0 seconds = 59.995 FPS - I have compiled my own VTK program that displays a vtkpolydata and it runs well. I'll be making a video and post it online in a few days. Again, please not that while I "updated" the apt packages, I NEVER "upgraded" any. I needed to "update" in order to install additional programs, but an "upgrade" will brake the OpenGL driver. Hope this helps -- Elvis C.S. Chen, PhD Imaging, Robarts Research Institute Department of Electrical & Computer Engineering Biomedical Engineering Medical Biophysics, Western University London, Ontario, Canada On Sat, Apr 16, 2016 at 8:36 PM, David Gobbi wrote: > Hi Elvis, > > One way of checking the OpenGL driver is the "glxinfo" command. > The "OpenGL renderer" is usually Mesa if it is a software renderer, > but if it gives the name of a specific card or chip, then you probably > have hardware rendering, e.g. here's what my laptop reports: > > OpenGL vendor string: NVIDIA Corporation > OpenGL renderer string: NVIDIA GeForce 9400M OpenGL Engine > OpenGL version string: 2.1 NVIDIA-8.24.17 310.90.9.05f01 > OpenGL shading language version string: 1.20 > > I don't know much about the Raspberry Pi, but google found this > page that describes how to enable hardware OpenGL: > https://www.raspberrypi.org/blog/another-new-raspbian-release/ > > - David > > > On Sat, Apr 16, 2016 at 6:06 PM, Elvis Chen wrote: > >> Greetings, >> >> I've recently acquired a Raspberry Pi 3. To my surprise, the latest >> raspbian (Jessie) comes with a complete development environment, including >> gcc (4.9), cmake, and vtk (both vtk5 and vtk6). >> >> I wrote a small program that reads a polydata and display it as a test >> bed. The pipeline is: >> >> vtkpolydatareader->vtkpolydatamapper->vtkactor >> >> nothing fancy. >> >> However, the rendering is surprisingly SLOW. It looks if the graphics is >> not hardware accelerated. >> >> My questions are: >> >> 1) How do I check if the video (which I assume to be OpenGL) is hardware >> accelerated? >> 2) any suggestion on how to optimize the performance? >> >> My next step is to comple vtk myself to see if it makes any difference. >> >> any help is very much appreciated, >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From madaramh at gmail.com Wed Apr 20 00:00:49 2016 From: madaramh at gmail.com (madz) Date: Tue, 19 Apr 2016 21:00:49 -0700 (MST) Subject: [vtkusers] Projecting a point on a surface In-Reply-To: References: <1460959893726-5737747.post@n5.nabble.com> Message-ID: <1461124849806-5737795.post@n5.nabble.com> Thanks for the reply Andras and xabivtk. I took a look at the example you provided Andras. But don't I need two points for this method to create a line? I only have points which are slightly above the surface, I need to get the x,y,z locations when the point is projected perpendicularly on to the surface. And I 'm not sure if cell locator will work well with my requirements since it only gives the nearest cell which might not have the correctly projected x,y,z point values. Thanks. -- View this message in context: http://vtk.1045678.n5.nabble.com/Projecting-a-point-on-a-surface-tp5737747p5737795.html Sent from the VTK - Users mailing list archive at Nabble.com. From jothybasu at gmail.com Wed Apr 20 01:43:12 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Wed, 20 Apr 2016 15:43:12 +1000 Subject: [vtkusers] Complementary color LUTs Message-ID: Hi All I am trying to overlay 2 registered images using complementary LUTs (magenta & green), so that the images will appear white where they match perfectly. However, I couldn't get the desired results. The image appears magenta where they match. Can anyone find any mistakes in this? Below are the LUTs I use: // Create a GREEN lookup table vtkSmartPointer table = vtkSmartPointer::New(); table->SetHueRange(0.33333,0.33333); table->SetSaturationRange(1.0,1.0); table->SetValueRange(0.0,1.0); table->SetAlpha(0.5); table->SetRampToLinear(); table->Build(); // Create a MAGENTA lookup table vtkSmartPointertable2 = vtkSmartPointer::New(); table2 ->SetHueRange(0.8333,0.8333); table2 ->SetSaturationRange(1.0,1.0); table2 ->SetValueRange(0.0,1.0); table2 ->SetAlpha(0.5); table2 ->SetRampToLinear(); table2 ->Build(); Any help is highly appreciated! Cheers Jothy -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Apr 20 03:15:33 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 20 Apr 2016 01:15:33 -0600 Subject: [vtkusers] Complementary color LUTs In-Reply-To: References: Message-ID: Hi Jothy, I see this mistake a lot... people try to blend images by setting the alpha of both images to 0.5. That's wrong. If you want to blend images, then the first image should be opaque, and the second image should have an alpha of 0.5. C = C1*(1 - alpha2) + C2*alpha2 The second mistake is that, if you want to blend complimentary colors, then you don't want the Value of the second image to be the ramp. Instead, you want the Alpha of the second image to be the ramp. // Create a GREEN lookup table vtkSmartPointer table = vtkSmartPointer::New(); table->SetHueRange(0.33333,0.33333); table->SetSaturationRange(1.0,1.0); table->SetValueRange(0.0,1.0); table->SetAlphaRange(1.0,1.0); // make the bottom image opaque table->SetRampToLinear(); table->Build(); // Create a MAGENTA lookup table vtkSmartPointertable2 = vtkSmartPointer::New(); table2 ->SetHueRange(0.8333,0.8333); table2 ->SetSaturationRange(1.0,1.0); table2 ->SetValueRange(1.0,1.0); // use pure magenta, don't mix with black table2 ->SetAlphaRange(0.0,1.0); // use an alpha ramp to blend the images table2 ->SetRampToLinear(); table2 ->Build(); - David On Tue, Apr 19, 2016 at 11:43 PM, Jothybasu Selvaraj wrote: > Hi All > > I am trying to overlay 2 registered images using complementary LUTs > (magenta & green), so that the images will appear white where they match > perfectly. However, I couldn't get the desired results. The image appears > magenta where they match. > > Can anyone find any mistakes in this? > > Below are the LUTs I use: > > // Create a GREEN lookup table > > vtkSmartPointer table = > > vtkSmartPointer::New(); > > table->SetHueRange(0.33333,0.33333); > > table->SetSaturationRange(1.0,1.0); > > table->SetValueRange(0.0,1.0); > > table->SetAlpha(0.5); > > table->SetRampToLinear(); > > table->Build(); > > > // Create a MAGENTA lookup table > > vtkSmartPointertable2 = > > vtkSmartPointer::New(); > > table2 ->SetHueRange(0.8333,0.8333); > > table2 ->SetSaturationRange(1.0,1.0); > > table2 ->SetValueRange(0.0,1.0); > > table2 ->SetAlpha(0.5); > > table2 ->SetRampToLinear(); > > table2 ->Build(); > > > Any help is highly appreciated! > > > > Cheers > > > Jothy > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.wormser at gmx.de Wed Apr 20 06:22:23 2016 From: max.wormser at gmx.de (mwormser) Date: Wed, 20 Apr 2016 03:22:23 -0700 (MST) Subject: [vtkusers] Clipping a set of lines from vtkAppendPolyDataFilter Message-ID: <1461147743954-5737798.post@n5.nabble.com> I am looking for a way using Python to clip lines and continue with a line object, so that I can apply a tube filter afterwards. What my script does: 1. loop that creates 12 lineSources 2. convert each to PolyData in the loop 3. add it to an AppendPolyDataFilter 4. create a box (vtkBox, implicit function) 5. use vtkClipPolyData with the box as clip function and the appended PolyData lines as Input. what I end up with is, of course, a PolyData object. But to be able to apply a TubeFilter I need a Line object of some kind. Does anybody know a way of converting the PolyData to a line or changing the algorithm so the TubeFilter works? Thanks in advance. -- View this message in context: http://vtk.1045678.n5.nabble.com/Clipping-a-set-of-lines-from-vtkAppendPolyDataFilter-tp5737798.html Sent from the VTK - Users mailing list archive at Nabble.com. From ken.martin at kitware.com Wed Apr 20 08:34:15 2016 From: ken.martin at kitware.com (Ken Martin) Date: Wed, 20 Apr 2016 08:34:15 -0400 Subject: [vtkusers] hardware acceleratec OpenGL on Raspberry pi 3/Raspbian? In-Reply-To: References: Message-ID: Very cool Elvis! Amazing what these tiny systems can do. On Tue, Apr 19, 2016 at 11:01 PM, Elvis Chen wrote: > hi all, > > This is a status update on vtk on Raspberry pi, with hardware accelerated > OpenGL. > > After a few days of trial and error, I managed to get VTK working on > Raspberry Pi 3. I hope my experience can save others some time, as > information on the web can be misleading. > > First of, I am using Raspberry Pi 3. The DOs and DONTs > > DO: > - make sure you use the official PSU (rated at 2.5A), as there are reports > that an under-powered PI causes OpenGL driver to fail, > > DONTs: > - don't use the official 7" touch screen. The OpenGL driver apparently is > very picky on the output format. It won't work with the 7" touch screen > - don't follow the instruction on > https://www.raspberrypi.org/blog/another-new-raspbian-release/, in > particular DO NOT UPGRADE Raspbian. > > Here is what I had to do to get hardware accelerated OpenGL to work: > > - create a new raspbian/Jessie bootdisk using 2016-03-18 image > - upon first boot, which boots into X by default, expand the file system > using Menu->Preference->Raspberry Pi Configuration. Reboot > - upon 2nd boot, change keyboard/time-zone as desired. Using the same > configuration utility as the previous step, change the boot option to "To > CLI" instead of "To Desktop". Reboot. > - now raspbian will boot into commandline instead of X. Issue the > following command: > sudo raspi-config > - under Advanced Options, Enable OpenGL driver, reboot > - once rebooted, issue "startx" > - open a terminal, issue the following command > sudo apt-get update > sudo apt-get install libvtk5-qt4-dev cmake cmake-curses-gui mesa-utils > > I choose vtk5 but vtk6 is also available as a pre-compiled package. > > - with mesa-utils installed, you can run glxgears to test opengl. I am > getting 59FPS on RPi3 > > pi at raspberrypi:~/research/bin/vtkViewPolyDataMesh $ glxgears > Running synchronized to the vertical refresh. The framerate should be > approximately the same as the monitor refresh rate. > 293 frames in 5.0 seconds = 58.548 FPS > 301 frames in 5.0 seconds = 59.994 FPS > 299 frames in 5.0 seconds = 59.613 FPS > 290 frames in 5.0 seconds = 57.999 FPS > 300 frames in 5.0 seconds = 59.807 FPS > 300 frames in 5.0 seconds = 59.995 FPS > > > - I have compiled my own VTK program that displays a vtkpolydata and it > runs well. I'll be making a video and post it online in a few days. > > Again, please not that while I "updated" the apt packages, I NEVER > "upgraded" any. I needed to "update" in order to install additional > programs, but an "upgrade" will brake the OpenGL driver. > > Hope this helps > > -- > Elvis C.S. Chen, PhD > > Imaging, Robarts Research Institute > Department of Electrical & Computer Engineering > Biomedical Engineering > Medical Biophysics, Western University > London, Ontario, Canada > > > > On Sat, Apr 16, 2016 at 8:36 PM, David Gobbi > wrote: > >> Hi Elvis, >> >> One way of checking the OpenGL driver is the "glxinfo" command. >> The "OpenGL renderer" is usually Mesa if it is a software renderer, >> but if it gives the name of a specific card or chip, then you probably >> have hardware rendering, e.g. here's what my laptop reports: >> >> OpenGL vendor string: NVIDIA Corporation >> OpenGL renderer string: NVIDIA GeForce 9400M OpenGL Engine >> OpenGL version string: 2.1 NVIDIA-8.24.17 310.90.9.05f01 >> OpenGL shading language version string: 1.20 >> >> I don't know much about the Raspberry Pi, but google found this >> page that describes how to enable hardware OpenGL: >> https://www.raspberrypi.org/blog/another-new-raspbian-release/ >> >> - David >> >> >> On Sat, Apr 16, 2016 at 6:06 PM, Elvis Chen wrote: >> >>> Greetings, >>> >>> I've recently acquired a Raspberry Pi 3. To my surprise, the latest >>> raspbian (Jessie) comes with a complete development environment, including >>> gcc (4.9), cmake, and vtk (both vtk5 and vtk6). >>> >>> I wrote a small program that reads a polydata and display it as a test >>> bed. The pipeline is: >>> >>> vtkpolydatareader->vtkpolydatamapper->vtkactor >>> >>> nothing fancy. >>> >>> However, the rendering is surprisingly SLOW. It looks if the graphics is >>> not hardware accelerated. >>> >>> My questions are: >>> >>> 1) How do I check if the video (which I assume to be OpenGL) is hardware >>> accelerated? >>> 2) any suggestion on how to optimize the performance? >>> >>> My next step is to comple vtk myself to see if it makes any difference. >>> >>> any help is very much appreciated, >>> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From moitinho at civil.ist.utl.pt Wed Apr 20 08:50:44 2016 From: moitinho at civil.ist.utl.pt (Jose Paulo Moitinho de Almeida) Date: Wed, 20 Apr 2016 13:50:44 +0100 Subject: [vtkusers] hardware acceleratec OpenGL on Raspberry pi 3/Raspbian? In-Reply-To: References: Message-ID: <2085468.AX0HlUuvDi@lmoit.civil.ist.utl.pt> Can you please post the "FPS" that you obtain without limiting the framerate? Using bash the command is "vblank_mode=0 glxgears" Thanks ZP On Tuesday 19 April 2016 23:01:43 Elvis Chen wrote: > hi all, > > This is a status update on vtk on Raspberry pi, with hardware accelerated > OpenGL. > > After a few days of trial and error, I managed to get VTK working on > Raspberry Pi 3. I hope my experience can save others some time, as > information on the web can be misleading. > > First of, I am using Raspberry Pi 3. The DOs and DONTs > > DO: > - make sure you use the official PSU (rated at 2.5A), as there are reports > that an under-powered PI causes OpenGL driver to fail, > > DONTs: > - don't use the official 7" touch screen. The OpenGL driver apparently is > very picky on the output format. It won't work with the 7" touch screen > - don't follow the instruction on > https://www.raspberrypi.org/blog/another-new-raspbian-release/, in > particular DO NOT UPGRADE Raspbian. > > Here is what I had to do to get hardware accelerated OpenGL to work: > > - create a new raspbian/Jessie bootdisk using 2016-03-18 image > - upon first boot, which boots into X by default, expand the file system > using Menu->Preference->Raspberry Pi Configuration. Reboot > - upon 2nd boot, change keyboard/time-zone as desired. Using the same > configuration utility as the previous step, change the boot option to "To > CLI" instead of "To Desktop". Reboot. > - now raspbian will boot into commandline instead of X. Issue the following > command: > sudo raspi-config > - under Advanced Options, Enable OpenGL driver, reboot > - once rebooted, issue "startx" > - open a terminal, issue the following command > sudo apt-get update > sudo apt-get install libvtk5-qt4-dev cmake cmake-curses-gui mesa-utils > > I choose vtk5 but vtk6 is also available as a pre-compiled package. > > - with mesa-utils installed, you can run glxgears to test opengl. I am > getting 59FPS on RPi3 > > pi at raspberrypi:~/research/bin/vtkViewPolyDataMesh $ glxgears > Running synchronized to the vertical refresh. The framerate should be > approximately the same as the monitor refresh rate. > 293 frames in 5.0 seconds = 58.548 FPS > 301 frames in 5.0 seconds = 59.994 FPS > 299 frames in 5.0 seconds = 59.613 FPS > 290 frames in 5.0 seconds = 57.999 FPS > 300 frames in 5.0 seconds = 59.807 FPS > 300 frames in 5.0 seconds = 59.995 FPS > > > - I have compiled my own VTK program that displays a vtkpolydata and it > runs well. I'll be making a video and post it online in a few days. > > Again, please not that while I "updated" the apt packages, I NEVER > "upgraded" any. I needed to "update" in order to install additional > programs, but an "upgrade" will brake the OpenGL driver. > > Hope this helps > > -- > Elvis C.S. Chen, PhD > > Imaging, Robarts Research Institute > Department of Electrical & Computer Engineering > Biomedical Engineering > Medical Biophysics, Western University > London, Ontario, Canada > > On Sat, Apr 16, 2016 at 8:36 PM, David Gobbi wrote: > > Hi Elvis, > > > > One way of checking the OpenGL driver is the "glxinfo" command. > > The "OpenGL renderer" is usually Mesa if it is a software renderer, > > but if it gives the name of a specific card or chip, then you probably > > have hardware rendering, e.g. here's what my laptop reports: > > > > OpenGL vendor string: NVIDIA Corporation > > OpenGL renderer string: NVIDIA GeForce 9400M OpenGL Engine > > OpenGL version string: 2.1 NVIDIA-8.24.17 310.90.9.05f01 > > OpenGL shading language version string: 1.20 > > > > I don't know much about the Raspberry Pi, but google found this > > page that describes how to enable hardware OpenGL: > > https://www.raspberrypi.org/blog/another-new-raspbian-release/ > > > > - David > > > > On Sat, Apr 16, 2016 at 6:06 PM, Elvis Chen wrote: > >> Greetings, > >> > >> I've recently acquired a Raspberry Pi 3. To my surprise, the latest > >> raspbian (Jessie) comes with a complete development environment, > >> including > >> gcc (4.9), cmake, and vtk (both vtk5 and vtk6). > >> > >> I wrote a small program that reads a polydata and display it as a test > >> bed. The pipeline is: > >> > >> vtkpolydatareader->vtkpolydatamapper->vtkactor > >> > >> nothing fancy. > >> > >> However, the rendering is surprisingly SLOW. It looks if the graphics is > >> not hardware accelerated. > >> > >> My questions are: > >> > >> 1) How do I check if the video (which I assume to be OpenGL) is hardware > >> accelerated? > >> 2) any suggestion on how to optimize the performance? > >> > >> My next step is to comple vtk myself to see if it makes any difference. > >> > >> any help is very much appreciated, From elvis.stansvik at orexplore.com Wed Apr 20 09:02:10 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Wed, 20 Apr 2016 15:02:10 +0200 Subject: [vtkusers] Requirements for multiple volumes in one render window In-Reply-To: References: Message-ID: 2016-03-04 19:37 GMT+01:00 Jaime Campos : > Hi David, > > Thanks for the answer. I read the publication you proposed but it seems > the solution does not entirely > fulfill our needs. As far as I understood, the authors claim to have > created a concrete volume mapper class that handles multiple dataset inputs > instead of one - which they called vtkOpenGLGPUMultiVolumeMapper. However, > they are limited to only two datasets, meaning it is not a generalized > approach to have 2 or more volumes in the scene. > > " (...) the generalization to any number of input datasets would require > sending several arrays of 3D and 2D textures to the graphic card for the > input datasets and their associated transfer functions (...)" > > Moreover, since each mapper only maps to one vtkVolume, we also lose the > possiblity to have several vtkVolume props in the scene (corresponding to > the different datasets), thus rendering impossible the individual > interaction for each prop (pick, move, etc...). > I'd just like to add that I don't think this solution will quite fulfill our needs either, much for the same reasons Jaime brings up. Elvis > > Best Regards, > Jaime Campos > > 2016-03-04 13:41 GMT+00:00 David Gobbi : > >> There is a VTK journal publication that claims to render multiple volumes: >> http://www.vtkjournal.org/browse/publication/856 >> Is there anything of significance there? >> >> - David >> >> >> On Fri, Mar 4, 2016 at 6:27 AM, Jaime Campos wrote: >> >>> Hello everyone, >>> >>> I'm a new subscriber to this mailing list and I was reading this thread, >>> and I'm also interested in this functionality. >>> Currently I am using vtkOpenGLVolumeTextureMapper3D for two different >>> volumes that intersect in 3D space, and it happens to render the volumes >>> correctly by blending opacities and doing the correct compositioning >>> (because of the slicing it does internally, I believe, though not being >>> perfect). This also allows me to pick and interact with the vtkVolume props >>> independently, which is a must have for the functionality I am developing. >>> >>> The problem, as far as I know, is that with VTK 7.0 new rendering >>> backend (OpenGL 2), this mapper is no longer supported and the new GPU >>> mappers available, unfortunately, are not solving this issue yet. This >>> feature could also be applied to the iOS GPU volume mapper example. I wish >>> I could help you adding this functionality, but unfortunately I'm not >>> familiar with the internals of VTK in these modules, but I'm eager to >>> learn. I hope I can bump up the priority of this request ! >>> >>> Thank you, >>> >>> Best Regards, >>> >>> Jaime Campos >>> >>> 2016-03-04 11:00 GMT+00:00 Elvis Stansvik >>> : >>> >>>> 2016-03-02 21:16 GMT+01:00 Aashish Chaudhary < >>>> aashish.chaudhary at kitware.com>: >>>> >>>>> Elvis, >>>>> >>>>> thanks for the detailed information. I thought about a way of doing >>>>> this. Basically, I think the mapper has to take multiple inputs and if >>>>> multiple inputs are present, then we will construct a BBox around it >>>>> and used that for traversing. Now, internally, we would have to >>>>> transform the data position to each volume so that we can perform the >>>>> lookup and set some rules on how to perform compositing (replace, >>>>> modulate etc.). I will talk to the team here and will add in our todo >>>>> but we would have check on the priority of it. >>>>> >>>> >>>> Thanks a lot for looking into this and bringing it up with the team. It >>>> would be a very welcome addition for us, and surely to some others as well. >>>> >>>> The approach you outline seems sound to me, but I am a layman in >>>> visualization :) >>>> >>>> >>>>> >>>>> If you want to help us with this then I am more happy to guide you >>>>> with the process. It won't be very difficult but will require some >>>>> careful changes to the existing mapper. >>>>> >>>> >>>> I'm afraid we're in the middle of a product launch here at work, so I'm >>>> quite swamped. This is only a small part of the application I'm building. >>>> I'm also completely new to VTK and visualization in general, so I'm also >>>> afraid it would be more difficult and time consuming for me than you might >>>> think (as opposed to a seasoned VTK dev). >>>> >>>> I'm of course prepared to try out any changes you do on our data sets, >>>> should you decide to work on this. >>>> >>>> Thanks again, >>>> Elvis >>>> >>>> >>>>> Thanks, >>>>> >>>>> >>>>> On Mon, Feb 29, 2016 at 11:46 AM, Elvis Stansvik >>>>> wrote: >>>>> > 2016-02-29 16:32 GMT+01:00 Aashish Chaudhary >>>>> > : >>>>> >> >>>>> >> Hi Elvis, >>>>> >> >>>>> >> On Sat, Feb 27, 2016 at 12:06 PM, Elvis Stansvik >>>>> >> wrote: >>>>> >> > 2016-02-25 17:10 GMT+01:00 Elvis Stansvik >>>>> >> > : >>>>> >> >> >>>>> >> >> Hi, >>>>> >> >> >>>>> >> >> From searching around, I think I've gathered that to render >>>>> multiple >>>>> >> >> volumes in a single window, each volume must have its own mapper >>>>> and >>>>> >> >> volume >>>>> >> >> property. They can't share mapper or property. >>>>> >> >> >>>>> >> >> My question is whether I must use separate renderers for each >>>>> volume as >>>>> >> >> well, or if I can use the same renderer for them all? >>>>> >> >> >>>>> >> >> Also, I did read something in an old post about problems with >>>>> rendering >>>>> >> >> multiple volumes that intersect (share a voxel). Is this still a >>>>> >> >> problem? >>>>> >> >> I'm using VTK 6.2 and the vtkVolumeRayCastMapper. >>>>> >> >> >>>>> >> >> Thanks in advance! >>>>> >> > >>>>> >> > >>>>> >> > Including Donny's answer here, to keep the thread intact: >>>>> >> > >>>>> >> >> See this thread: >>>>> >> >> >>>>> >> >> >>>>> >> >> >>>>> >> >> >>>>> http://vtk.1045678.n5.nabble.com/Rendering-multiple-volumes-td5734685.html#a5734971 >>>>> >> > >>>>> >> > Thanks, that clears some things up, and brings up some >>>>> workarounds. That >>>>> >> > thread was from oct/nov last year, so I guess it is still the >>>>> case that >>>>> >> > proper rendering of multiple volumes that share voxels in 3D >>>>> space is >>>>> >> > not >>>>> >> > possible? (even with 7.0?). >>>>> >> >>>>> >> It depends what you define proper. If you have two volumes and they >>>>> >> share the exact same space, you can combine them into one volume. >>>>> When >>>>> >> they share the same space but do not overlap that's when things get >>>>> >> tricky since then the outcome depends on how do you want to handle >>>>> >> this disparity. There could be some other ways such as you combine >>>>> the >>>>> >> volume into one. At the rendering level it could get tricky. >>>>> >> >>>>> >> What exactly you are trying to do. >>>>> > >>>>> > >>>>> > I see, what I would expect I think is composite rendering of the >>>>> voxels >>>>> > using some composite rendering function / blending mode (perhaps >>>>> > configurable?). >>>>> > >>>>> > Sorry if my use case wasn't clear, I'm attaching a rough sketch I >>>>> did just >>>>> > now which should explain it better. >>>>> > >>>>> > Each of our volumes is a piece of a drill core (see my photo >>>>> previously in >>>>> > this thread). The pieces were scanned stacked on top of each other >>>>> in a >>>>> > plastic tube inside our machine. During scanning, they are not >>>>> necessarily >>>>> > aligned properly (as shown in the sketch, and also in the photo). >>>>> > >>>>> > We will do some algorithmic alignment of the volumes, but we must >>>>> also allow >>>>> > the user to override / supplement the automatic alignment when it >>>>> fails. >>>>> > This means the user should be able to rotate and move (along Z axis) >>>>> the >>>>> > pieces until they align. It's like a pussle with pieces of a drill >>>>> core :) >>>>> > >>>>> > While the user is doing this, the volumes may intersect (noone is >>>>> perfect on >>>>> > the first try). This is why I'm asking about rendering multiple >>>>> volumes that >>>>> > partially intersect in 3D space. >>>>> > >>>>> > It's very desirable that the user can see inside the volumes while >>>>> doing >>>>> > this manual alignment, since the features (cracks, density >>>>> variations, ...) >>>>> > inside the rocks may be what guides the user in aligning the pieces >>>>> > properly. That's why I don't like the idea of letting the user work >>>>> with >>>>> > extracted isosurfaces or similar instead. >>>>> > >>>>> > Hope this clears things up a little! >>>>> > >>>>> > Elvis >>>>> >>>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Wed Apr 20 09:04:32 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Wed, 20 Apr 2016 15:04:32 +0200 Subject: [vtkusers] Requirements for multiple volumes in one render window In-Reply-To: References: Message-ID: 2016-03-04 12:00 GMT+01:00 Elvis Stansvik : > 2016-03-02 21:16 GMT+01:00 Aashish Chaudhary < > aashish.chaudhary at kitware.com>: > >> Elvis, >> >> thanks for the detailed information. I thought about a way of doing >> this. Basically, I think the mapper has to take multiple inputs and if >> multiple inputs are present, then we will construct a BBox around it >> and used that for traversing. Now, internally, we would have to >> transform the data position to each volume so that we can perform the >> lookup and set some rules on how to perform compositing (replace, >> modulate etc.). I will talk to the team here and will add in our todo >> but we would have check on the priority of it. >> > Any news on how you chose to prioritize this? Is it possible there will be something in a 7.x point release, or is it further off? Elvis > > Thanks a lot for looking into this and bringing it up with the team. It > would be a very welcome addition for us, and surely to some others as well. > > The approach you outline seems sound to me, but I am a layman in > visualization :) > > >> >> If you want to help us with this then I am more happy to guide you >> with the process. It won't be very difficult but will require some >> careful changes to the existing mapper. >> > > I'm afraid we're in the middle of a product launch here at work, so I'm > quite swamped. This is only a small part of the application I'm building. > I'm also completely new to VTK and visualization in general, so I'm also > afraid it would be more difficult and time consuming for me than you might > think (as opposed to a seasoned VTK dev). > > I'm of course prepared to try out any changes you do on our data sets, > should you decide to work on this. > > Thanks again, > Elvis > > >> Thanks, >> >> >> On Mon, Feb 29, 2016 at 11:46 AM, Elvis Stansvik >> wrote: >> > 2016-02-29 16:32 GMT+01:00 Aashish Chaudhary >> > : >> >> >> >> Hi Elvis, >> >> >> >> On Sat, Feb 27, 2016 at 12:06 PM, Elvis Stansvik >> >> wrote: >> >> > 2016-02-25 17:10 GMT+01:00 Elvis Stansvik >> >> > : >> >> >> >> >> >> Hi, >> >> >> >> >> >> From searching around, I think I've gathered that to render multiple >> >> >> volumes in a single window, each volume must have its own mapper and >> >> >> volume >> >> >> property. They can't share mapper or property. >> >> >> >> >> >> My question is whether I must use separate renderers for each >> volume as >> >> >> well, or if I can use the same renderer for them all? >> >> >> >> >> >> Also, I did read something in an old post about problems with >> rendering >> >> >> multiple volumes that intersect (share a voxel). Is this still a >> >> >> problem? >> >> >> I'm using VTK 6.2 and the vtkVolumeRayCastMapper. >> >> >> >> >> >> Thanks in advance! >> >> > >> >> > >> >> > Including Donny's answer here, to keep the thread intact: >> >> > >> >> >> See this thread: >> >> >> >> >> >> >> >> >> >> >> >> >> http://vtk.1045678.n5.nabble.com/Rendering-multiple-volumes-td5734685.html#a5734971 >> >> > >> >> > Thanks, that clears some things up, and brings up some workarounds. >> That >> >> > thread was from oct/nov last year, so I guess it is still the case >> that >> >> > proper rendering of multiple volumes that share voxels in 3D space is >> >> > not >> >> > possible? (even with 7.0?). >> >> >> >> It depends what you define proper. If you have two volumes and they >> >> share the exact same space, you can combine them into one volume. When >> >> they share the same space but do not overlap that's when things get >> >> tricky since then the outcome depends on how do you want to handle >> >> this disparity. There could be some other ways such as you combine the >> >> volume into one. At the rendering level it could get tricky. >> >> >> >> What exactly you are trying to do. >> > >> > >> > I see, what I would expect I think is composite rendering of the voxels >> > using some composite rendering function / blending mode (perhaps >> > configurable?). >> > >> > Sorry if my use case wasn't clear, I'm attaching a rough sketch I did >> just >> > now which should explain it better. >> > >> > Each of our volumes is a piece of a drill core (see my photo previously >> in >> > this thread). The pieces were scanned stacked on top of each other in a >> > plastic tube inside our machine. During scanning, they are not >> necessarily >> > aligned properly (as shown in the sketch, and also in the photo). >> > >> > We will do some algorithmic alignment of the volumes, but we must also >> allow >> > the user to override / supplement the automatic alignment when it fails. >> > This means the user should be able to rotate and move (along Z axis) the >> > pieces until they align. It's like a pussle with pieces of a drill core >> :) >> > >> > While the user is doing this, the volumes may intersect (noone is >> perfect on >> > the first try). This is why I'm asking about rendering multiple volumes >> that >> > partially intersect in 3D space. >> > >> > It's very desirable that the user can see inside the volumes while doing >> > this manual alignment, since the features (cracks, density variations, >> ...) >> > inside the rocks may be what guides the user in aligning the pieces >> > properly. That's why I don't like the idea of letting the user work with >> > extracted isosurfaces or similar instead. >> > >> > Hope this clears things up a little! >> > >> > Elvis >> > >> >> >> >> - Aashish >> >> >> >> > >> >> > Elvis >> >> > >> >> >> >> >> >> Elvis >> >> > >> >> > >> >> > >> >> > _______________________________________________ >> >> > Powered by www.kitware.com >> >> > >> >> > Visit other Kitware open-source projects at >> >> > http://www.kitware.com/opensource/opensource.html >> >> > >> >> > Please keep messages on-topic and check the VTK FAQ at: >> >> > http://www.vtk.org/Wiki/VTK_FAQ >> >> > >> >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> > >> >> > Follow this link to subscribe/unsubscribe: >> >> > http://public.kitware.com/mailman/listinfo/vtkusers >> >> > >> >> >> >> >> >> >> >> -- >> >> | Aashish Chaudhary >> >> | Technical Leader >> >> | Kitware Inc. >> >> | http://www.kitware.com/company/team/chaudhary.html >> > >> > >> >> >> >> -- >> | Aashish Chaudhary >> | Technical Leader >> | Kitware Inc. >> | http://www.kitware.com/company/team/chaudhary.html >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Wed Apr 20 09:08:09 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Wed, 20 Apr 2016 15:08:09 +0200 Subject: [vtkusers] Requirements for multiple volumes in one render window In-Reply-To: References: <1456418666540-5736853.post@n5.nabble.com> Message-ID: 2016-02-25 20:03 GMT+01:00 Elvis Stansvik : > 2016-02-25 18:04 GMT+01:00 Aashish Chaudhary < > aashish.chaudhary at kitware.com>: > >> On Thu, Feb 25, 2016 at 11:44 AM, longbowzhang >> wrote: >> > Hi, >> > >> > 1 vtkRenderer is like a container, so you can put several volumes (as >> > vtkVolume) into it. No problem. >> >> Yes, >> > > Alright, good to know. > > >> >> > >> > 2 I think (not 100% sure) it would be a problem if those volumes are >> > intersecting with each other. You can test it easily. >> > Just put two vtkVolumes into the scene, and then check the results. >> >> Intersecting volume would a be problem but having multiple volume >> would be fine. You will have to sort them (tell VTK to sort them). >> > > With sort them, you mean set the z order such that they are rendered on > top of each other? > Zhang, do you think you could clarify what you meant by "sort them" above, and what (visual) consequences doing so would have for the rendering of the volumes, assuming the volumes intersect in 3D space. Elvis > This would be a real problem for us. We are doing x-ray tomography of > drill cores. The core breaks into pieces during drilling, so think of each > volume I'm speaking of as one of the pieces in the attached photo. Our > software will do some algorithmic "puzzling" to align the volumes (pieces) > after scanning, but we need to have an interactive way for the user to > manually align the pieces as well, for the cases where automatic alignment > fails (which it will in some hard/hopeless cases). > > If VTK can't properly render intersecting volumes, then I'm afraid it will > be really hard to make such a tool for manual alignment intuitive to use. > The user must be able to see the pieces while rotating them when they are > close together, which invariably means they will intersect now and then as > he/she tries to fit them together. > > Is this limitation of VTK present also in 7.0? I've been thinking of > compiling a custom VTK 7.0, since I saw it has many improvements to volume > rendering, and if it can do composite rendering of intersecting volumes, > then we'll definitely do that. > Elvis > > >> >> - Aashish >> >> > >> > >> > >> > >> > -- >> > View this message in context: >> http://vtk.1045678.n5.nabble.com/Requirements-for-multiple-volumes-in-one-render-window-tp5736847p5736853.html >> > Sent from the VTK - Users mailing list archive at Nabble.com. >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/vtkusers >> >> >> >> -- >> | Aashish Chaudhary >> | Technical Leader >> | Kitware Inc. >> | http://www.kitware.com/company/team/chaudhary.html >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Apr 20 10:45:44 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 20 Apr 2016 08:45:44 -0600 Subject: [vtkusers] Complementary color LUTs In-Reply-To: References: Message-ID: Looks like I was wrong about the second table. It should use this: table2 ->SetValueRange(0.0,1.0); table2 ->SetAlphaRange(0.5,0.5); Ideally, it would be nice if VTK provided a way to simply add the two colors together, but the best you can do is use the alpha to make VTK multiply the images by 0.5 before adding them. As a result, you end up with grey instead of white. - David On Wed, Apr 20, 2016 at 1:15 AM, David Gobbi wrote: > Hi Jothy, > > I see this mistake a lot... people try to blend images by setting the > alpha of both images to 0.5. That's wrong. If you want to blend images, > then the first image should be opaque, and the second image should have an > alpha of 0.5. > > C = C1*(1 - alpha2) + C2*alpha2 > > The second mistake is that, if you want to blend complimentary colors, > then you don't want the Value of the second image to be the ramp. Instead, > you want the Alpha of the second image to be the ramp. > > // Create a GREEN lookup table > vtkSmartPointer table = > vtkSmartPointer::New(); > table->SetHueRange(0.33333,0.33333); > table->SetSaturationRange(1.0,1.0); > table->SetValueRange(0.0,1.0); > table->SetAlphaRange(1.0,1.0); // make the bottom image opaque > table->SetRampToLinear(); > table->Build(); > > // Create a MAGENTA lookup table > vtkSmartPointertable2 = > vtkSmartPointer::New(); > table2 ->SetHueRange(0.8333,0.8333); > table2 ->SetSaturationRange(1.0,1.0); > table2 ->SetValueRange(1.0,1.0); // use pure magenta, don't mix with > black > table2 ->SetAlphaRange(0.0,1.0); // use an alpha ramp to blend the > images > table2 ->SetRampToLinear(); > table2 ->Build(); > > - David > > > On Tue, Apr 19, 2016 at 11:43 PM, Jothybasu Selvaraj > wrote: > >> Hi All >> >> I am trying to overlay 2 registered images using complementary LUTs >> (magenta & green), so that the images will appear white where they match >> perfectly. However, I couldn't get the desired results. The image appears >> magenta where they match. >> >> Can anyone find any mistakes in this? >> >> Below are the LUTs I use: >> >> // Create a GREEN lookup table >> >> vtkSmartPointer table = >> >> vtkSmartPointer::New(); >> >> table->SetHueRange(0.33333,0.33333); >> >> table->SetSaturationRange(1.0,1.0); >> >> table->SetValueRange(0.0,1.0); >> >> table->SetAlpha(0.5); >> >> table->SetRampToLinear(); >> >> table->Build(); >> >> >> // Create a MAGENTA lookup table >> >> vtkSmartPointertable2 = >> >> vtkSmartPointer::New(); >> >> table2 ->SetHueRange(0.8333,0.8333); >> >> table2 ->SetSaturationRange(1.0,1.0); >> >> table2 ->SetValueRange(0.0,1.0); >> >> table2 ->SetAlpha(0.5); >> >> table2 ->SetRampToLinear(); >> >> table2 ->Build(); >> >> >> Any help is highly appreciated! >> >> >> >> Cheers >> >> >> Jothy >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.chen at gmail.com Wed Apr 20 11:56:12 2016 From: elvis.chen at gmail.com (Elvis Chen) Date: Wed, 20 Apr 2016 11:56:12 -0400 Subject: [vtkusers] hardware acceleratec OpenGL on Raspberry pi 3/Raspbian? In-Reply-To: <2085468.AX0HlUuvDi@lmoit.civil.ist.utl.pt> References: <2085468.AX0HlUuvDi@lmoit.civil.ist.utl.pt> Message-ID: of course, sorry for not noticing the sync issue: pi at raspberrypi:/dev $ vblank_mode=0 glxgears ATTENTION: default value of option vblank_mode overridden by environment. 2613 frames in 5.0 seconds = 522.544 FPS 2731 frames in 5.0 seconds = 546.007 FPS 2583 frames in 5.0 seconds = 516.513 FPS 2648 frames in 5.0 seconds = 529.468 FPS 2518 frames in 5.0 seconds = 503.535 FPS 3206 frames in 5.0 seconds = 640.964 FPS 2533 frames in 5.0 seconds = 506.589 FPS 2530 frames in 5.0 seconds = 505.956 FPS 2700 frames in 5.0 seconds = 539.864 FPS On Wed, Apr 20, 2016 at 8:50 AM, Jose Paulo Moitinho de Almeida < moitinho at civil.ist.utl.pt> wrote: > > Can you please post the "FPS" that you obtain without limiting the > framerate? > > Using bash the command is > "vblank_mode=0 glxgears" > > Thanks > > ZP > > On Tuesday 19 April 2016 23:01:43 Elvis Chen wrote: > > hi all, > > > > This is a status update on vtk on Raspberry pi, with hardware accelerated > > OpenGL. > > > > After a few days of trial and error, I managed to get VTK working on > > Raspberry Pi 3. I hope my experience can save others some time, as > > information on the web can be misleading. > > > > First of, I am using Raspberry Pi 3. The DOs and DONTs > > > > DO: > > - make sure you use the official PSU (rated at 2.5A), as there are > reports > > that an under-powered PI causes OpenGL driver to fail, > > > > DONTs: > > - don't use the official 7" touch screen. The OpenGL driver apparently is > > very picky on the output format. It won't work with the 7" touch screen > > - don't follow the instruction on > > https://www.raspberrypi.org/blog/another-new-raspbian-release/, in > > particular DO NOT UPGRADE Raspbian. > > > > Here is what I had to do to get hardware accelerated OpenGL to work: > > > > - create a new raspbian/Jessie bootdisk using 2016-03-18 image > > - upon first boot, which boots into X by default, expand the file system > > using Menu->Preference->Raspberry Pi Configuration. Reboot > > - upon 2nd boot, change keyboard/time-zone as desired. Using the same > > configuration utility as the previous step, change the boot option to "To > > CLI" instead of "To Desktop". Reboot. > > - now raspbian will boot into commandline instead of X. Issue the > following > > command: > > sudo raspi-config > > - under Advanced Options, Enable OpenGL driver, reboot > > - once rebooted, issue "startx" > > - open a terminal, issue the following command > > sudo apt-get update > > sudo apt-get install libvtk5-qt4-dev cmake cmake-curses-gui > mesa-utils > > > > I choose vtk5 but vtk6 is also available as a pre-compiled package. > > > > - with mesa-utils installed, you can run glxgears to test opengl. I am > > getting 59FPS on RPi3 > > > > pi at raspberrypi:~/research/bin/vtkViewPolyDataMesh $ glxgears > > Running synchronized to the vertical refresh. The framerate should be > > approximately the same as the monitor refresh rate. > > 293 frames in 5.0 seconds = 58.548 FPS > > 301 frames in 5.0 seconds = 59.994 FPS > > 299 frames in 5.0 seconds = 59.613 FPS > > 290 frames in 5.0 seconds = 57.999 FPS > > 300 frames in 5.0 seconds = 59.807 FPS > > 300 frames in 5.0 seconds = 59.995 FPS > > > > > > - I have compiled my own VTK program that displays a vtkpolydata and it > > runs well. I'll be making a video and post it online in a few days. > > > > Again, please not that while I "updated" the apt packages, I NEVER > > "upgraded" any. I needed to "update" in order to install additional > > programs, but an "upgrade" will brake the OpenGL driver. > > > > Hope this helps > > > > -- > > Elvis C.S. Chen, PhD > > > > Imaging, Robarts Research Institute > > Department of Electrical & Computer Engineering > > Biomedical Engineering > > Medical Biophysics, Western University > > London, Ontario, Canada > > > > On Sat, Apr 16, 2016 at 8:36 PM, David Gobbi > wrote: > > > Hi Elvis, > > > > > > One way of checking the OpenGL driver is the "glxinfo" command. > > > The "OpenGL renderer" is usually Mesa if it is a software renderer, > > > but if it gives the name of a specific card or chip, then you probably > > > have hardware rendering, e.g. here's what my laptop reports: > > > > > > OpenGL vendor string: NVIDIA Corporation > > > OpenGL renderer string: NVIDIA GeForce 9400M OpenGL Engine > > > OpenGL version string: 2.1 NVIDIA-8.24.17 310.90.9.05f01 > > > OpenGL shading language version string: 1.20 > > > > > > I don't know much about the Raspberry Pi, but google found this > > > page that describes how to enable hardware OpenGL: > > > https://www.raspberrypi.org/blog/another-new-raspbian-release/ > > > > > > - David > > > > > > On Sat, Apr 16, 2016 at 6:06 PM, Elvis Chen > wrote: > > >> Greetings, > > >> > > >> I've recently acquired a Raspberry Pi 3. To my surprise, the latest > > >> raspbian (Jessie) comes with a complete development environment, > > >> including > > >> gcc (4.9), cmake, and vtk (both vtk5 and vtk6). > > >> > > >> I wrote a small program that reads a polydata and display it as a test > > >> bed. The pipeline is: > > >> > > >> vtkpolydatareader->vtkpolydatamapper->vtkactor > > >> > > >> nothing fancy. > > >> > > >> However, the rendering is surprisingly SLOW. It looks if the graphics > is > > >> not hardware accelerated. > > >> > > >> My questions are: > > >> > > >> 1) How do I check if the video (which I assume to be OpenGL) is > hardware > > >> accelerated? > > >> 2) any suggestion on how to optimize the performance? > > >> > > >> My next step is to comple vtk myself to see if it makes any > difference. > > >> > > >> any help is very much appreciated, > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Wed Apr 20 12:43:29 2016 From: tjlp at netease.com (Liu_tj) Date: Thu, 21 Apr 2016 00:43:29 +0800 (CST) Subject: [vtkusers] How to set the vtkBorderWidget initial position for DICOM image on vtkRenderWindow Message-ID: <560ca846.16.154348e1edc.Coremail.tjlp@netease.com> Hi, I use vtkImageViewer2 to display a DICOM series. Now I choose vtkBorderWidget to select area for the DICOM series. My problem is how to set the vtkBorderWidget initial position to a place where can include for example 3/4 of the DICOM image instead of the low bottom position. Possibly it needs to get the left bottom and right top coordinate of the DICOM image on the vtkRenderWindow (I also don't know how to get that). Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Wed Apr 20 19:32:42 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Thu, 21 Apr 2016 09:32:42 +1000 Subject: [vtkusers] Complementary color LUTs In-Reply-To: References: Message-ID: Fantastic David! With the latest modification on table2 you sent, it works well. I agree, it will be great if VTK can add a class to do this where users can choose a set of colors they need to fuse. Thanks a lot! Cheers Jothy On Thu, Apr 21, 2016 at 12:45 AM, David Gobbi wrote: > Looks like I was wrong about the second table. It should use this: > > table2 ->SetValueRange(0.0,1.0); > table2 ->SetAlphaRange(0.5,0.5); > > Ideally, it would be nice if VTK provided a way to simply add the > two colors together, but the best you can do is use the alpha to > make VTK multiply the images by 0.5 before adding them. As a > result, you end up with grey instead of white. > > - David > > On Wed, Apr 20, 2016 at 1:15 AM, David Gobbi > wrote: > >> Hi Jothy, >> >> I see this mistake a lot... people try to blend images by setting the >> alpha of both images to 0.5. That's wrong. If you want to blend images, >> then the first image should be opaque, and the second image should have an >> alpha of 0.5. >> >> C = C1*(1 - alpha2) + C2*alpha2 >> >> The second mistake is that, if you want to blend complimentary colors, >> then you don't want the Value of the second image to be the ramp. Instead, >> you want the Alpha of the second image to be the ramp. >> >> // Create a GREEN lookup table >> vtkSmartPointer table = >> vtkSmartPointer::New(); >> table->SetHueRange(0.33333,0.33333); >> table->SetSaturationRange(1.0,1.0); >> table->SetValueRange(0.0,1.0); >> table->SetAlphaRange(1.0,1.0); // make the bottom image opaque >> table->SetRampToLinear(); >> table->Build(); >> >> // Create a MAGENTA lookup table >> vtkSmartPointertable2 = >> vtkSmartPointer::New(); >> table2 ->SetHueRange(0.8333,0.8333); >> table2 ->SetSaturationRange(1.0,1.0); >> table2 ->SetValueRange(1.0,1.0); // use pure magenta, don't mix with >> black >> table2 ->SetAlphaRange(0.0,1.0); // use an alpha ramp to blend the >> images >> table2 ->SetRampToLinear(); >> table2 ->Build(); >> >> - David >> >> >> On Tue, Apr 19, 2016 at 11:43 PM, Jothybasu Selvaraj > > wrote: >> >>> Hi All >>> >>> I am trying to overlay 2 registered images using complementary LUTs >>> (magenta & green), so that the images will appear white where they match >>> perfectly. However, I couldn't get the desired results. The image appears >>> magenta where they match. >>> >>> Can anyone find any mistakes in this? >>> >>> Below are the LUTs I use: >>> >>> // Create a GREEN lookup table >>> >>> vtkSmartPointer table = >>> >>> vtkSmartPointer::New(); >>> >>> table->SetHueRange(0.33333,0.33333); >>> >>> table->SetSaturationRange(1.0,1.0); >>> >>> table->SetValueRange(0.0,1.0); >>> >>> table->SetAlpha(0.5); >>> >>> table->SetRampToLinear(); >>> >>> table->Build(); >>> >>> >>> // Create a MAGENTA lookup table >>> >>> vtkSmartPointertable2 = >>> >>> vtkSmartPointer::New(); >>> >>> table2 ->SetHueRange(0.8333,0.8333); >>> >>> table2 ->SetSaturationRange(1.0,1.0); >>> >>> table2 ->SetValueRange(0.0,1.0); >>> >>> table2 ->SetAlpha(0.5); >>> >>> table2 ->SetRampToLinear(); >>> >>> table2 ->Build(); >>> >>> >>> Any help is highly appreciated! >>> >>> >>> >>> Cheers >>> >>> >>> Jothy >>> >>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Wed Apr 20 19:55:29 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Thu, 21 Apr 2016 09:55:29 +1000 Subject: [vtkusers] Complementary color LUTs In-Reply-To: References: Message-ID: Hi David Though it works, I would like to have the images rendered like the one shown in Ref.jpg. With the current code it is rendered like the one in the attached Current.jpg. Thanks Jothy On Thu, Apr 21, 2016 at 9:32 AM, Jothybasu Selvaraj wrote: > Fantastic David! > > With the latest modification on table2 you sent, it works well. > > I agree, it will be great if VTK can add a class to do this where users > can choose a set of colors they need to fuse. > > > Thanks a lot! > > > Cheers > > Jothy > > On Thu, Apr 21, 2016 at 12:45 AM, David Gobbi > wrote: > >> Looks like I was wrong about the second table. It should use this: >> >> table2 ->SetValueRange(0.0,1.0); >> table2 ->SetAlphaRange(0.5,0.5); >> >> Ideally, it would be nice if VTK provided a way to simply add the >> two colors together, but the best you can do is use the alpha to >> make VTK multiply the images by 0.5 before adding them. As a >> result, you end up with grey instead of white. >> >> - David >> >> On Wed, Apr 20, 2016 at 1:15 AM, David Gobbi >> wrote: >> >>> Hi Jothy, >>> >>> I see this mistake a lot... people try to blend images by setting the >>> alpha of both images to 0.5. That's wrong. If you want to blend images, >>> then the first image should be opaque, and the second image should have an >>> alpha of 0.5. >>> >>> C = C1*(1 - alpha2) + C2*alpha2 >>> >>> The second mistake is that, if you want to blend complimentary colors, >>> then you don't want the Value of the second image to be the ramp. Instead, >>> you want the Alpha of the second image to be the ramp. >>> >>> // Create a GREEN lookup table >>> vtkSmartPointer table = >>> vtkSmartPointer::New(); >>> table->SetHueRange(0.33333,0.33333); >>> table->SetSaturationRange(1.0,1.0); >>> table->SetValueRange(0.0,1.0); >>> table->SetAlphaRange(1.0,1.0); // make the bottom image opaque >>> table->SetRampToLinear(); >>> table->Build(); >>> >>> // Create a MAGENTA lookup table >>> vtkSmartPointertable2 = >>> vtkSmartPointer::New(); >>> table2 ->SetHueRange(0.8333,0.8333); >>> table2 ->SetSaturationRange(1.0,1.0); >>> table2 ->SetValueRange(1.0,1.0); // use pure magenta, don't mix with >>> black >>> table2 ->SetAlphaRange(0.0,1.0); // use an alpha ramp to blend the >>> images >>> table2 ->SetRampToLinear(); >>> table2 ->Build(); >>> >>> - David >>> >>> >>> On Tue, Apr 19, 2016 at 11:43 PM, Jothybasu Selvaraj < >>> jothybasu at gmail.com> wrote: >>> >>>> Hi All >>>> >>>> I am trying to overlay 2 registered images using complementary LUTs >>>> (magenta & green), so that the images will appear white where they match >>>> perfectly. However, I couldn't get the desired results. The image appears >>>> magenta where they match. >>>> >>>> Can anyone find any mistakes in this? >>>> >>>> Below are the LUTs I use: >>>> >>>> // Create a GREEN lookup table >>>> >>>> vtkSmartPointer table = >>>> >>>> vtkSmartPointer::New(); >>>> >>>> table->SetHueRange(0.33333,0.33333); >>>> >>>> table->SetSaturationRange(1.0,1.0); >>>> >>>> table->SetValueRange(0.0,1.0); >>>> >>>> table->SetAlpha(0.5); >>>> >>>> table->SetRampToLinear(); >>>> >>>> table->Build(); >>>> >>>> >>>> // Create a MAGENTA lookup table >>>> >>>> vtkSmartPointertable2 = >>>> >>>> vtkSmartPointer::New(); >>>> >>>> table2 ->SetHueRange(0.8333,0.8333); >>>> >>>> table2 ->SetSaturationRange(1.0,1.0); >>>> >>>> table2 ->SetValueRange(0.0,1.0); >>>> >>>> table2 ->SetAlpha(0.5); >>>> >>>> table2 ->SetRampToLinear(); >>>> >>>> table2 ->Build(); >>>> >>>> >>>> Any help is highly appreciated! >>>> >>>> >>>> >>>> Cheers >>>> >>>> >>>> Jothy >>>> >>>> >>>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Ref.jpg Type: image/jpeg Size: 38110 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Current.png Type: image/png Size: 46068 bytes Desc: not available URL: From jothybasu at gmail.com Wed Apr 20 20:15:21 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Thu, 21 Apr 2016 10:15:21 +1000 Subject: [vtkusers] Complementary color LUTs In-Reply-To: References: Message-ID: Sorry, with the GreenTable->SetRampToLinear() it looks like the one in the attached figure. But I would like to visualize some anatomical details as in the previous Ref.jpg. Thanks Jothy On Thu, Apr 21, 2016 at 9:55 AM, Jothybasu Selvaraj wrote: > Hi David > > Though it works, I would like to have the images rendered like the one > shown in Ref.jpg. With the current code it is rendered like the one in the > attached Current.jpg. > > Thanks > > Jothy > > On Thu, Apr 21, 2016 at 9:32 AM, Jothybasu Selvaraj > wrote: > >> Fantastic David! >> >> With the latest modification on table2 you sent, it works well. >> >> I agree, it will be great if VTK can add a class to do this where users >> can choose a set of colors they need to fuse. >> >> >> Thanks a lot! >> >> >> Cheers >> >> Jothy >> >> On Thu, Apr 21, 2016 at 12:45 AM, David Gobbi >> wrote: >> >>> Looks like I was wrong about the second table. It should use this: >>> >>> table2 ->SetValueRange(0.0,1.0); >>> table2 ->SetAlphaRange(0.5,0.5); >>> >>> Ideally, it would be nice if VTK provided a way to simply add the >>> two colors together, but the best you can do is use the alpha to >>> make VTK multiply the images by 0.5 before adding them. As a >>> result, you end up with grey instead of white. >>> >>> - David >>> >>> On Wed, Apr 20, 2016 at 1:15 AM, David Gobbi >>> wrote: >>> >>>> Hi Jothy, >>>> >>>> I see this mistake a lot... people try to blend images by setting the >>>> alpha of both images to 0.5. That's wrong. If you want to blend images, >>>> then the first image should be opaque, and the second image should have an >>>> alpha of 0.5. >>>> >>>> C = C1*(1 - alpha2) + C2*alpha2 >>>> >>>> The second mistake is that, if you want to blend complimentary colors, >>>> then you don't want the Value of the second image to be the ramp. Instead, >>>> you want the Alpha of the second image to be the ramp. >>>> >>>> // Create a GREEN lookup table >>>> vtkSmartPointer table = >>>> vtkSmartPointer::New(); >>>> table->SetHueRange(0.33333,0.33333); >>>> table->SetSaturationRange(1.0,1.0); >>>> table->SetValueRange(0.0,1.0); >>>> table->SetAlphaRange(1.0,1.0); // make the bottom image opaque >>>> table->SetRampToLinear(); >>>> table->Build(); >>>> >>>> // Create a MAGENTA lookup table >>>> vtkSmartPointertable2 = >>>> vtkSmartPointer::New(); >>>> table2 ->SetHueRange(0.8333,0.8333); >>>> table2 ->SetSaturationRange(1.0,1.0); >>>> table2 ->SetValueRange(1.0,1.0); // use pure magenta, don't mix >>>> with black >>>> table2 ->SetAlphaRange(0.0,1.0); // use an alpha ramp to blend the >>>> images >>>> table2 ->SetRampToLinear(); >>>> table2 ->Build(); >>>> >>>> - David >>>> >>>> >>>> On Tue, Apr 19, 2016 at 11:43 PM, Jothybasu Selvaraj < >>>> jothybasu at gmail.com> wrote: >>>> >>>>> Hi All >>>>> >>>>> I am trying to overlay 2 registered images using complementary LUTs >>>>> (magenta & green), so that the images will appear white where they match >>>>> perfectly. However, I couldn't get the desired results. The image appears >>>>> magenta where they match. >>>>> >>>>> Can anyone find any mistakes in this? >>>>> >>>>> Below are the LUTs I use: >>>>> >>>>> // Create a GREEN lookup table >>>>> >>>>> vtkSmartPointer table = >>>>> >>>>> vtkSmartPointer::New(); >>>>> >>>>> table->SetHueRange(0.33333,0.33333); >>>>> >>>>> table->SetSaturationRange(1.0,1.0); >>>>> >>>>> table->SetValueRange(0.0,1.0); >>>>> >>>>> table->SetAlpha(0.5); >>>>> >>>>> table->SetRampToLinear(); >>>>> >>>>> table->Build(); >>>>> >>>>> >>>>> // Create a MAGENTA lookup table >>>>> >>>>> vtkSmartPointertable2 = >>>>> >>>>> vtkSmartPointer::New(); >>>>> >>>>> table2 ->SetHueRange(0.8333,0.8333); >>>>> >>>>> table2 ->SetSaturationRange(1.0,1.0); >>>>> >>>>> table2 ->SetValueRange(0.0,1.0); >>>>> >>>>> table2 ->SetAlpha(0.5); >>>>> >>>>> table2 ->SetRampToLinear(); >>>>> >>>>> table2 ->Build(); >>>>> >>>>> >>>>> Any help is highly appreciated! >>>>> >>>>> >>>>> >>>>> Cheers >>>>> >>>>> >>>>> Jothy >>>>> >>>>> >>>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Untitled.png Type: image/png Size: 53691 bytes Desc: not available URL: From david.gobbi at gmail.com Wed Apr 20 20:32:12 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 20 Apr 2016 18:32:12 -0600 Subject: [vtkusers] Complementary color LUTs In-Reply-To: References: Message-ID: It looks like the "Window" part of your Window/Level setting is wrong. On Wed, Apr 20, 2016 at 6:15 PM, Jothybasu Selvaraj wrote: > Sorry, with the GreenTable->SetRampToLinear() it looks like the one in > the attached figure. But I would like to visualize some anatomical details > as in the previous Ref.jpg. > > Thanks > > Jothy > > On Thu, Apr 21, 2016 at 9:55 AM, Jothybasu Selvaraj > wrote: > >> Hi David >> >> Though it works, I would like to have the images rendered like the one >> shown in Ref.jpg. With the current code it is rendered like the one in the >> attached Current.jpg. >> >> Thanks >> >> Jothy >> >> On Thu, Apr 21, 2016 at 9:32 AM, Jothybasu Selvaraj >> wrote: >> >>> Fantastic David! >>> >>> With the latest modification on table2 you sent, it works well. >>> >>> I agree, it will be great if VTK can add a class to do this where users >>> can choose a set of colors they need to fuse. >>> >>> >>> Thanks a lot! >>> >>> >>> Cheers >>> >>> Jothy >>> >>> On Thu, Apr 21, 2016 at 12:45 AM, David Gobbi >>> wrote: >>> >>>> Looks like I was wrong about the second table. It should use this: >>>> >>>> table2 ->SetValueRange(0.0,1.0); >>>> table2 ->SetAlphaRange(0.5,0.5); >>>> >>>> Ideally, it would be nice if VTK provided a way to simply add the >>>> two colors together, but the best you can do is use the alpha to >>>> make VTK multiply the images by 0.5 before adding them. As a >>>> result, you end up with grey instead of white. >>>> >>>> - David >>>> >>>> On Wed, Apr 20, 2016 at 1:15 AM, David Gobbi >>>> wrote: >>>> >>>>> Hi Jothy, >>>>> >>>>> I see this mistake a lot... people try to blend images by setting the >>>>> alpha of both images to 0.5. That's wrong. If you want to blend images, >>>>> then the first image should be opaque, and the second image should have an >>>>> alpha of 0.5. >>>>> >>>>> C = C1*(1 - alpha2) + C2*alpha2 >>>>> >>>>> The second mistake is that, if you want to blend complimentary colors, >>>>> then you don't want the Value of the second image to be the ramp. Instead, >>>>> you want the Alpha of the second image to be the ramp. >>>>> >>>>> // Create a GREEN lookup table >>>>> vtkSmartPointer table = >>>>> vtkSmartPointer::New(); >>>>> table->SetHueRange(0.33333,0.33333); >>>>> table->SetSaturationRange(1.0,1.0); >>>>> table->SetValueRange(0.0,1.0); >>>>> table->SetAlphaRange(1.0,1.0); // make the bottom image opaque >>>>> table->SetRampToLinear(); >>>>> table->Build(); >>>>> >>>>> // Create a MAGENTA lookup table >>>>> vtkSmartPointertable2 = >>>>> vtkSmartPointer::New(); >>>>> table2 ->SetHueRange(0.8333,0.8333); >>>>> table2 ->SetSaturationRange(1.0,1.0); >>>>> table2 ->SetValueRange(1.0,1.0); // use pure magenta, don't mix >>>>> with black >>>>> table2 ->SetAlphaRange(0.0,1.0); // use an alpha ramp to blend the >>>>> images >>>>> table2 ->SetRampToLinear(); >>>>> table2 ->Build(); >>>>> >>>>> - David >>>>> >>>>> >>>>> On Tue, Apr 19, 2016 at 11:43 PM, Jothybasu Selvaraj < >>>>> jothybasu at gmail.com> wrote: >>>>> >>>>>> Hi All >>>>>> >>>>>> I am trying to overlay 2 registered images using complementary LUTs >>>>>> (magenta & green), so that the images will appear white where they match >>>>>> perfectly. However, I couldn't get the desired results. The image appears >>>>>> magenta where they match. >>>>>> >>>>>> Can anyone find any mistakes in this? >>>>>> >>>>>> Below are the LUTs I use: >>>>>> >>>>>> // Create a GREEN lookup table >>>>>> >>>>>> vtkSmartPointer table = >>>>>> >>>>>> vtkSmartPointer::New(); >>>>>> >>>>>> table->SetHueRange(0.33333,0.33333); >>>>>> >>>>>> table->SetSaturationRange(1.0,1.0); >>>>>> >>>>>> table->SetValueRange(0.0,1.0); >>>>>> >>>>>> table->SetAlpha(0.5); >>>>>> >>>>>> table->SetRampToLinear(); >>>>>> >>>>>> table->Build(); >>>>>> >>>>>> >>>>>> // Create a MAGENTA lookup table >>>>>> >>>>>> vtkSmartPointertable2 = >>>>>> >>>>>> vtkSmartPointer::New(); >>>>>> >>>>>> table2 ->SetHueRange(0.8333,0.8333); >>>>>> >>>>>> table2 ->SetSaturationRange(1.0,1.0); >>>>>> >>>>>> table2 ->SetValueRange(0.0,1.0); >>>>>> >>>>>> table2 ->SetAlpha(0.5); >>>>>> >>>>>> table2 ->SetRampToLinear(); >>>>>> >>>>>> table2 ->Build(); >>>>>> >>>>>> >>>>>> Any help is highly appreciated! >>>>>> >>>>>> >>>>>> >>>>>> Cheers >>>>>> >>>>>> >>>>>> Jothy >>>>>> >>>>>> >>>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Wed Apr 20 20:49:05 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Thu, 21 Apr 2016 10:49:05 +1000 Subject: [vtkusers] Complementary color LUTs In-Reply-To: References: Message-ID: Yup, SetValueRange() missing! Thanks a lot! Cheers Jothy On Thu, Apr 21, 2016 at 10:32 AM, David Gobbi wrote: > It looks like the "Window" part of your Window/Level setting is wrong. > > On Wed, Apr 20, 2016 at 6:15 PM, Jothybasu Selvaraj > wrote: > >> Sorry, with the GreenTable->SetRampToLinear() it looks like the one in >> the attached figure. But I would like to visualize some anatomical details >> as in the previous Ref.jpg. >> >> Thanks >> >> Jothy >> >> On Thu, Apr 21, 2016 at 9:55 AM, Jothybasu Selvaraj >> wrote: >> >>> Hi David >>> >>> Though it works, I would like to have the images rendered like the one >>> shown in Ref.jpg. With the current code it is rendered like the one in the >>> attached Current.jpg. >>> >>> Thanks >>> >>> Jothy >>> >>> On Thu, Apr 21, 2016 at 9:32 AM, Jothybasu Selvaraj >> > wrote: >>> >>>> Fantastic David! >>>> >>>> With the latest modification on table2 you sent, it works well. >>>> >>>> I agree, it will be great if VTK can add a class to do this where users >>>> can choose a set of colors they need to fuse. >>>> >>>> >>>> Thanks a lot! >>>> >>>> >>>> Cheers >>>> >>>> Jothy >>>> >>>> On Thu, Apr 21, 2016 at 12:45 AM, David Gobbi >>>> wrote: >>>> >>>>> Looks like I was wrong about the second table. It should use this: >>>>> >>>>> table2 ->SetValueRange(0.0,1.0); >>>>> table2 ->SetAlphaRange(0.5,0.5); >>>>> >>>>> Ideally, it would be nice if VTK provided a way to simply add the >>>>> two colors together, but the best you can do is use the alpha to >>>>> make VTK multiply the images by 0.5 before adding them. As a >>>>> result, you end up with grey instead of white. >>>>> >>>>> - David >>>>> >>>>> On Wed, Apr 20, 2016 at 1:15 AM, David Gobbi >>>>> wrote: >>>>> >>>>>> Hi Jothy, >>>>>> >>>>>> I see this mistake a lot... people try to blend images by setting the >>>>>> alpha of both images to 0.5. That's wrong. If you want to blend images, >>>>>> then the first image should be opaque, and the second image should have an >>>>>> alpha of 0.5. >>>>>> >>>>>> C = C1*(1 - alpha2) + C2*alpha2 >>>>>> >>>>>> The second mistake is that, if you want to blend complimentary >>>>>> colors, then you don't want the Value of the second image to be the ramp. >>>>>> Instead, you want the Alpha of the second image to be the ramp. >>>>>> >>>>>> // Create a GREEN lookup table >>>>>> vtkSmartPointer table = >>>>>> vtkSmartPointer::New(); >>>>>> table->SetHueRange(0.33333,0.33333); >>>>>> table->SetSaturationRange(1.0,1.0); >>>>>> table->SetValueRange(0.0,1.0); >>>>>> table->SetAlphaRange(1.0,1.0); // make the bottom image opaque >>>>>> table->SetRampToLinear(); >>>>>> table->Build(); >>>>>> >>>>>> // Create a MAGENTA lookup table >>>>>> vtkSmartPointertable2 = >>>>>> vtkSmartPointer::New(); >>>>>> table2 ->SetHueRange(0.8333,0.8333); >>>>>> table2 ->SetSaturationRange(1.0,1.0); >>>>>> table2 ->SetValueRange(1.0,1.0); // use pure magenta, don't mix >>>>>> with black >>>>>> table2 ->SetAlphaRange(0.0,1.0); // use an alpha ramp to blend >>>>>> the images >>>>>> table2 ->SetRampToLinear(); >>>>>> table2 ->Build(); >>>>>> >>>>>> - David >>>>>> >>>>>> >>>>>> On Tue, Apr 19, 2016 at 11:43 PM, Jothybasu Selvaraj < >>>>>> jothybasu at gmail.com> wrote: >>>>>> >>>>>>> Hi All >>>>>>> >>>>>>> I am trying to overlay 2 registered images using complementary LUTs >>>>>>> (magenta & green), so that the images will appear white where they match >>>>>>> perfectly. However, I couldn't get the desired results. The image appears >>>>>>> magenta where they match. >>>>>>> >>>>>>> Can anyone find any mistakes in this? >>>>>>> >>>>>>> Below are the LUTs I use: >>>>>>> >>>>>>> // Create a GREEN lookup table >>>>>>> >>>>>>> vtkSmartPointer table = >>>>>>> >>>>>>> vtkSmartPointer::New(); >>>>>>> >>>>>>> table->SetHueRange(0.33333,0.33333); >>>>>>> >>>>>>> table->SetSaturationRange(1.0,1.0); >>>>>>> >>>>>>> table->SetValueRange(0.0,1.0); >>>>>>> >>>>>>> table->SetAlpha(0.5); >>>>>>> >>>>>>> table->SetRampToLinear(); >>>>>>> >>>>>>> table->Build(); >>>>>>> >>>>>>> >>>>>>> // Create a MAGENTA lookup table >>>>>>> >>>>>>> vtkSmartPointertable2 = >>>>>>> >>>>>>> vtkSmartPointer::New(); >>>>>>> >>>>>>> table2 ->SetHueRange(0.8333,0.8333); >>>>>>> >>>>>>> table2 ->SetSaturationRange(1.0,1.0); >>>>>>> >>>>>>> table2 ->SetValueRange(0.0,1.0); >>>>>>> >>>>>>> table2 ->SetAlpha(0.5); >>>>>>> >>>>>>> table2 ->SetRampToLinear(); >>>>>>> >>>>>>> table2 ->Build(); >>>>>>> >>>>>>> >>>>>>> Any help is highly appreciated! >>>>>>> >>>>>>> >>>>>>> >>>>>>> Cheers >>>>>>> >>>>>>> >>>>>>> Jothy >>>>>>> >>>>>>> >>>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.hernandez.cerdan at outlook.com Wed Apr 20 22:03:56 2016 From: pablo.hernandez.cerdan at outlook.com (=?iso-8859-1?B?UGFibG8gSGVybuFuZGV6?=) Date: Thu, 21 Apr 2016 04:03:56 +0200 Subject: [vtkusers] multiple sets of vtkImagePlanesWidget in one render window Message-ID: I'd like to render two 3D images using two sets of 3 vtkImagePlanesWidgets in the same render window. Now I can render both sets but they are both occupying the center of the window. I like the approach of setting viewports in the renderer, but it seems there is no access to the renderer from vtkImagePlanesWidget. Is there anyway to show these two sets in one render window but bounded differently and shifted from each other? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From abenchaaben at histalim.com Thu Apr 21 03:58:15 2016 From: abenchaaben at histalim.com (abenchaaben) Date: Thu, 21 Apr 2016 00:58:15 -0700 (MST) Subject: [vtkusers] Read big VTK file Message-ID: <1461225495479-5737814.post@n5.nabble.com> Hi, I have a big VTK (.vtk) file that i generate it from multiple 2D slices. The file is about 2.6 GB. The problem is that i can't read with paraview or convert it into a VTI file. I enabled the TK_USE_64BIT_IDS ON but it does not work. What did i missed? does VTK support big data file? Regards Assil. -- View this message in context: http://vtk.1045678.n5.nabble.com/Read-big-VTK-file-tp5737814.html Sent from the VTK - Users mailing list archive at Nabble.com. From ilindsay at insigniamedical.co.uk Thu Apr 21 04:14:11 2016 From: ilindsay at insigniamedical.co.uk (ianl) Date: Thu, 21 Apr 2016 01:14:11 -0700 (MST) Subject: [vtkusers] Offscreen rendering beyond screen resolution with WindowToImageFilter magnification In-Reply-To: <526E3F98.7090409@ece.ubc.ca> References: <526931C1.8080305@ece.ubc.ca> <526E3F98.7090409@ece.ubc.ca> Message-ID: <1461226451358-5737815.post@n5.nabble.com> Hi, sorry for reviving an old post, but just in case anyone else has this issue, I have a potential workaround for Windows builds. It seems that VTK creates the offscreen window for OpenGL to draw to behind the scenes as having a border by default. This leads to the window being created with the WS_OVERLAPPEDWINDOW style. It turns out that Windows will crop windows of this style to the desktop area, so the actual size of the window will be clamped if it exceeds the desktop dimensions in either direction. This can be verified by calling SetSize with some large values on a bordered offscreen vtk window, then immediately calling GetSize and checking the results. The solution is simply to turn borders off with SetBorders(0). This results in the window being created with the WS_POPUP style and all is ok from then on - the window is the size you asked for. Maybe this should be implicit for offscreen windows as this use case is likely to be a server side rendering application running on a small desktop? Hope that helps someone, it kept me busy for a couple of days tracking it down! -- View this message in context: http://vtk.1045678.n5.nabble.com/Offscreen-rendering-beyond-screen-resolution-with-WindowToImageFilter-magnification-tp5724102p5737815.html Sent from the VTK - Users mailing list archive at Nabble.com. From erol.cakir at akromuhendislik.com Thu Apr 21 04:51:09 2016 From: erol.cakir at akromuhendislik.com (M.Erol) Date: Thu, 21 Apr 2016 01:51:09 -0700 (MST) Subject: [vtkusers] How to get angle value in vtkAngleWidget class ? Message-ID: <1461228669860-5737817.post@n5.nabble.com> Hi everyone, I am using Visual Studio C# and i want to get angle with using vtkAngleWidget. public void addAngleWidget() { angleWidget = new vtkAngleWidget(); angleWidget.SetInteractor(this.iren); angleWidget.CreateDefaultRepresentation(); angleWidget.On(); } With this code, vtkAngleWidget is working perfectly. But i want to write to angle, inside a textbox. Like this; How do i ? Thx for advices.. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-angle-value-in-vtkAngleWidget-class-tp5737817.html Sent from the VTK - Users mailing list archive at Nabble.com. From 925345468 at qq.com Thu Apr 21 07:45:05 2016 From: 925345468 at qq.com (=?ISO-8859-1?B?anVzdF9yb29raWU=?=) Date: Thu, 21 Apr 2016 19:45:05 +0800 Subject: [vtkusers] default linking order of static VTK libraries Message-ID: Hi all, I would like to link static VTK libraries (linux .a files) in CMake, I got two questions: (1) how to find out which static libraries should be linked? Based on header files or other ways? (2) When linking static libraries, linking order is important, so is there a default linking order of VTK libraries? Which libraries should come first and the others come later? Thank you in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From 925345468 at qq.com Thu Apr 21 07:54:35 2016 From: 925345468 at qq.com (just_rookie) Date: Thu, 21 Apr 2016 04:54:35 -0700 (MST) Subject: [vtkusers] default linking order of static VTK libraries in CMake Message-ID: <1461239675635-5737819.post@n5.nabble.com> Hi all, I would like to link static VTK libraries (linux .a files) in CMake, I got two questions: (1) How to find out which static libraries should be linked? Based on header files or other ways? (2) When linking static libraries, linking order is important, so is there a default linking order of VTK libraries? Which libraries should come first or come later? Thank you in advance! -- View this message in context: http://vtk.1045678.n5.nabble.com/default-linking-order-of-static-VTK-libraries-in-CMake-tp5737819.html Sent from the VTK - Users mailing list archive at Nabble.com. From black4online at yahoo.com Thu Apr 21 08:59:49 2016 From: black4online at yahoo.com (max black) Date: Thu, 21 Apr 2016 12:59:49 +0000 (UTC) Subject: [vtkusers] Error running Medical4.cxx References: <1811052521.4954395.1461243589627.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1811052521.4954395.1461243589627.JavaMail.yahoo@mail.yahoo.com> Hi there I am have been trying to install VTK into visual studio 2013 for the past tow days and finished , the problem I have I been?trying to run ?medical4.cxx , and it seems that the data file cant be read when I disable the line (arg< 2) I get tow error statement? . attached a screen shot of the error ,any help will be much appreciated -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Untitled.png Type: image/png Size: 115564 bytes Desc: not available URL: From chuck.atkins at kitware.com Thu Apr 21 09:01:22 2016 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Thu, 21 Apr 2016 09:01:22 -0400 Subject: [vtkusers] default linking order of static VTK libraries in CMake In-Reply-To: <1461239675635-5737819.post@n5.nabble.com> References: <1461239675635-5737819.post@n5.nabble.com> Message-ID: If your project uses CMake then the imported targets from VTK will automatically pull in their appropriate dependencies in the right order. For example: CMakeLists.txt: project(foo) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) # Add an executable that users vtkFiltersCore add_executable(foo foo.cxx) target_link_libraries(foo vtkFiltersCore) Since your using CMake then vtkFiltersCore is not just a link library, but a full blown imported target, which means that it carries it's dependencies with it as they need to be linked. - Chuck On Thu, Apr 21, 2016 at 7:54 AM, just_rookie <925345468 at qq.com> wrote: > Hi all, > > I would like to link static VTK libraries (linux .a files) in CMake, I got > two questions: > > (1) How to find out which static libraries should be linked? Based on > header > files or other ways? > > (2) When linking static libraries, linking order is important, so is there > a > default linking order of VTK libraries? Which libraries should come first > or > come later? > > Thank you in advance! > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/default-linking-order-of-static-VTK-libraries-in-CMake-tp5737819.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Thu Apr 21 09:05:19 2016 From: drescherjm at gmail.com (John Drescher) Date: Thu, 21 Apr 2016 09:05:19 -0400 Subject: [vtkusers] Error running Medical4.cxx In-Reply-To: <1811052521.4954395.1461243589627.JavaMail.yahoo@mail.yahoo.com> References: <1811052521.4954395.1461243589627.JavaMail.yahoo.ref@mail.yahoo.com> <1811052521.4954395.1461243589627.JavaMail.yahoo@mail.yahoo.com> Message-ID: > I am have been trying to install VTK into visual studio 2013 for the past > tow days and finished , the problem I have I been trying to run > medical4.cxx , and it seems that the data file cant be read when I disable > the line (arg< 2) I get tow error statement You should not disable this. Pass the program the correct command line arguments. If you are not that familiar with doing so under Visual Studio a quick google should lead to many results. John From maxheinrich1988 at gmail.com Thu Apr 21 09:09:48 2016 From: maxheinrich1988 at gmail.com (Max-Heinrich Laves) Date: Thu, 21 Apr 2016 15:09:48 +0200 Subject: [vtkusers] vtkVectorText on iOS In-Reply-To: References: <2D952600-6D13-426A-8B54-4E0BD20FA985@gmail.com> Message-ID: <0C9CC199-8294-440C-9457-AB1AD60A1865@gmail.com> Hi Ken, that indeed solved my issue. I?m able to compile my app for iOS as well. With RenderingFreeType module in current VTK master, vtkVectorText is now available. Thanks, Max > Am 19.04.2016 um 17:46 schrieb Max-Heinrich Laves : > > Thanks for quick response! I will try it and give feedback. > Max > >> Am 19.04.2016 um 17:40 schrieb Ken Martin >: >> >> You need to turn on the RenderingFreeType module. In VTK master this option is exposed for iOS builds. In VTK 7.0 I believe you have to manually edit vtk/CMake/vtkiOS.cmake to turn the option on. >> >> Thanks >> Ken >> >> >> >> >> On Tue, Apr 19, 2016 at 11:37 AM, Max-Heinrich Laves > wrote: >> Hello list, >> >> I am porting my android app (using Qt 5.6 and VTK 7.0) to iOS and noticed, that the iOS build of VTK is missing vtkVectorText. I did not change any options in cmake. As my app is using vtkVectorText, I?m wondering how to build and use vtkVectorText for iOS. Any ideas? >> >> Cheers, >> Max >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> >> >> -- >> Ken Martin PhD >> Chairman & CFO >> Kitware Inc. >> 28 Corporate Drive >> Clifton Park NY 12065 >> 518 371 3971 >> >> This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Thu Apr 21 09:15:44 2016 From: ken.martin at kitware.com (Ken Martin) Date: Thu, 21 Apr 2016 09:15:44 -0400 Subject: [vtkusers] vtkVectorText on iOS In-Reply-To: <0C9CC199-8294-440C-9457-AB1AD60A1865@gmail.com> References: <2D952600-6D13-426A-8B54-4E0BD20FA985@gmail.com> <0C9CC199-8294-440C-9457-AB1AD60A1865@gmail.com> Message-ID: Awesome! Glad it worked out - Ken On Thu, Apr 21, 2016 at 9:09 AM, Max-Heinrich Laves < maxheinrich1988 at gmail.com> wrote: > Hi Ken, > > that indeed solved my issue. I?m able to compile my app for iOS as well. > With RenderingFreeType module in current VTK master, vtkVectorText is now > available. > > Thanks, > Max > > Am 19.04.2016 um 17:46 schrieb Max-Heinrich Laves < > maxheinrich1988 at gmail.com>: > > Thanks for quick response! I will try it and give feedback. > Max > > Am 19.04.2016 um 17:40 schrieb Ken Martin : > > You need to turn on the RenderingFreeType module. In VTK master this > option is exposed for iOS builds. In VTK 7.0 I believe you have to > manually edit vtk/CMake/vtkiOS.cmake to turn the option on. > > Thanks > Ken > > > > > On Tue, Apr 19, 2016 at 11:37 AM, Max-Heinrich Laves < > maxheinrich1988 at gmail.com> wrote: > >> Hello list, >> >> I am porting my android app (using Qt 5.6 and VTK 7.0) to iOS and >> noticed, that the iOS build of VTK is missing vtkVectorText. I did not >> change any options in cmake. As my app is using vtkVectorText, I?m >> wondering how to build and use vtkVectorText for iOS. Any ideas? >> >> Cheers, >> Max >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > > > -- > Ken Martin PhD > Chairman & CFO > Kitware Inc. > 28 Corporate Drive > Clifton Park NY 12065 > 518 371 3971 > > This communication, including all attachments, contains confidential and > legally privileged information, and it is intended only for the use of the > addressee. Access to this email by anyone else is unauthorized. If you are > not the intended recipient, any disclosure, copying, distribution or any > action taken in reliance on it is prohibited and may be unlawful. If you > received this communication in error please notify us immediately and > destroy the original message. Thank you. > > > > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Thu Apr 21 11:58:24 2016 From: ken.martin at kitware.com (Ken Martin) Date: Thu, 21 Apr 2016 11:58:24 -0400 Subject: [vtkusers] wxPlaneWidget on OSX In-Reply-To: References: <4FA127E3-C507-4DB8-B88F-475675294E11@gmail.com> <0E344297-3AC7-4DD7-A021-BADA916A9416@gmail.com> Message-ID: I believe this has been fixed in VTK master now ala https://gitlab.kitware.com/vtk/vtk/merge_requests/1434 Thanks for tracking it down. Ken On Wed, Apr 6, 2016 at 9:21 PM, ABE Hiroshi wrote: > Dear All, > > I found the reason why the problem occurs. > > Dragging the handle and then stop to set the vector of motion of mouse > pointer to zero vector in ?vtkPlaneWIdget::MovePoint?? methods. > The vector is expected not to be zero but it is on OSX. I put statement to > prevent zero divide as; > // Project v onto these vector to determine the amount of motion > // Scale it by the relative size of the motion to the vector length > double d1, d2; > if( vN == 0 ) { > d1 = 0.0; > d2 = 0.0; > } else { > d1 = (vN/n10) * vtkMath::Dot(v,p10) / (vN*n10); > d2 = (vN/n20) * vtkMath::Dot(v,p20) / (vN*n20); > } > to work fine for me. > > Tchuss, > > 2016/04/06 16:57?ABE Hiroshi ????? > > > Dear All, > > > > I modified the VTK wiki?s sample as is bottom of this mail to show the > status of vtkPlaneWidget. > > The output of ?Print? method in the constructor is; > > > > vtkPlaneWidget (0x7fea78d1e1d0) > > Debug: Off > > Modified Time: 2705 > > Reference Count: 1 > > Registered Events: (none) > > Current Renderer: 0x0 > > Default Renderer: 0x0 > > Enabled: 0 > > Priority: 0.5 > > Interactor: 0x0 > > Key Press Activation: On > > Key Press Activation Value: i > > Prop3D: 0x0 > > Input: 0x0 > > Handle Size: 0.05 > > Place Factor: 0.5 > > Handle Property: 0x7fea78d4a2c0 > > Selected Handle Property: 0x7fea78d4a470 > > Plane Property: 0x7fea78d4a620 > > Selected Plane Property: 0x7fea78d4a7d0 > > Plane Representation: Wireframe > > Normal To X Axis: Off > > Normal To Y Axis: Off > > Normal To Z Axis: Off > > Resolution: 4 > > Origin: (-0.5, -0.5, 0) > > Point 1: (0.5, -0.5, 0) > > Point 2: (-0.5, 0.5, 0) > > > > and in the destructor; > > > > vtkPlaneWidget (0x7fea78d1e1d0) > > Debug: Off > > Modified Time: 2806 > > Reference Count: 0 > > Registered Events: (none) > > Current Renderer: 0x7fea78f00160 > > Default Renderer: 0x0 > > Enabled: 1 > > Priority: 0.5 > > Interactor: 0x7fea78f00b40 > > Key Press Activation: On > > Key Press Activation Value: i > > Prop3D: 0x0 > > Input: 0x0 > > Handle Size: 0.05 > > Place Factor: 0.5 > > Handle Property: 0x7fea78d4a2c0 > > Selected Handle Property: 0x7fea78d4a470 > > Plane Property: 0x7fea78d4a620 > > Selected Plane Property: 0x7fea78d4a7d0 > > Plane Representation: Wireframe > > Normal To X Axis: Off > > Normal To Y Axis: Off > > Normal To Z Axis: Off > > Resolution: 4 > > Origin: (-0.562965, -0.555969, 0) > > Point 1: (nan, nan, nan) > > Point 2: (nan, nan, nan) > > > > The Point 1 and 2 are changed to ?nan?. The value (X,Y) in OnMouseMove > is not strange as; > > ( 182, 172 ) > > ( 180, 170 ) > > ( 180, 169 ) > > ( 177, 169 ) > > ( 177, 167 ) > > ( 175, 167 ) > > ( 174, 166 ) > > ( 174, 165 ) > > ( 173, 165 ) > > ( 218, 212 ) > > ( 219, 213 ) > > ( 221, 215 ) > > ( 222, 217 ) > > ( 224, 218 ) > > ( 225, 221 ) > > ( 226, 222 ) > > ( 227, 224 ) > > ( 229, 225 ) > > ( 230, 225 ) > > ( 232, 227 ) > > ( 235, 229 ) > > ( 237, 231 ) > > ( 241, 234 ) > > ( 244, 235 ) > > ( 246, 236 ) > > ( 247, 238 ) > > ( 249, 238 ) > > ( 250, 238 ) > > ( 250, 239 ) > > ( 252, 239 ) > > ( 253, 241 ) > > ( 253, 241 ) > > ( 255, 241 ) > > ( 255, 242 ) > > ( 255, 244 ) > > ( 256, 244 ) > > ( 256, 244 ) > > ( 258, 244 ) > > > > This is the result of my investigation on this. > > > > Still I am looking for any suggestions on this. > > Thank you. > > > > 2016/04/05 11:28?ABE Hiroshi ????? > > > >> Dear all, > >> > >> This might be a known issue but I could find any description about it > on the net so I ask you about vtkPlaneWidget. > >> That is a weired behavior that the handles of vtkPlaneWidget is gone > when you drag one of the handles. > >> > >> The sample program I used is available at: > >> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/PlaneWidget > >> > >> Building it straightforwardly and get an executable program. The > application launches as usual to display a VTK window. > >> You can find a vtkPlaneWidget?s plane in the window, which has four > handles. If you drag one of the handles suddenly the handle disappears. > This is always happens on OSX (10.9.5, 10.10.5). The env. are: > >> > >> OS X 10.9.5 (iMac late 2013 21.5?) VTK 5.10.1 (with Apple Wireless > Trackpad) > >> OS X 10.10.5 (MBP Letina 13?) VTK 5.10.1 VTK 6.3.0 > >> > >> As an additional info. Run the same program on OpenSUSE 13 (VTK 5.10) > on the Linux box itself, it works fine as expected. But if you display on > iMac with XQuartz (2.7.8), the same problem happens. > >> > >> Anybody out there point me the way workaround or any suggestions to > solve this. > >> > >> Thank you very much in advance. > > > > ABE Hiroshi > > from Tokorozawa, JAPAN > > > > #include > > > > #include > > #include > > #include > > #include > > #include > > #include > > > > class myPlaneWidget : public vtkPlaneWidget { > > public: > > static myPlaneWidget *New(); > > myPlaneWidget() : vtkPlaneWidget() { > > this->Print( std::cout ); > > } > > virtual ~myPlaneWidget() { > > this->Print( std::cout ); > > } > > virtual void UpdatePlacement() { > > this->Print( std::cout ); > > vtkPlaneWidget::UpdatePlacement(); > > } > > virtual void PositionHandles() { > > this->Print( std::cout ); > > vtkPlaneWidget::PositionHandles(); > > } > > }; > > vtkStandardNewMacro(myPlaneWidget); > > > > int main(int, char *[]) > > { > > vtkSmartPointer renderer = > > vtkSmartPointer::New(); > > > > vtkSmartPointer renderWindow = > > vtkSmartPointer::New(); > > renderWindow->AddRenderer(renderer); > > > > vtkSmartPointer renderWindowInteractor = > > vtkSmartPointer::New(); > > renderWindowInteractor->SetRenderWindow(renderWindow); > > > > vtkSmartPointer planeWidget = > > vtkSmartPointer::New(); > > planeWidget->SetInteractor(renderWindowInteractor); > > > > planeWidget->On(); > > > > renderWindowInteractor->Initialize(); > > > > renderer->ResetCamera(); > > renderWindow->Render(); > > > > renderWindowInteractor->Start(); > > > > return EXIT_SUCCESS; > > } > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > ABE Hiroshi > from Tokorozawa, JAPAN > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nico.schloemer at gmail.com Thu Apr 21 12:40:21 2016 From: nico.schloemer at gmail.com (=?UTF-8?Q?Nico_Schl=C3=B6mer?=) Date: Thu, 21 Apr 2016 16:40:21 +0000 Subject: [vtkusers] compiling with python 2 and python 3 support Message-ID: Hi everyone, I was going to try out VTK 7 with its support for Python 3. What configure flag do I have to pull to get this in? (`VTK_WRAP_PYTHON` only seems to do Python 2.) Also, is it possible to compile interfaces for both Python 2 and Python 3 at once? Cheers, Nico -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Thu Apr 21 13:06:07 2016 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 21 Apr 2016 13:06:07 -0400 Subject: [vtkusers] compiling with python 2 and python 3 support In-Reply-To: References: Message-ID: On Thu, Apr 21, 2016 at 12:40 PM, Nico Schl?mer wrote: > Hi everyone, > > I was going to try out VTK 7 with its support for Python 3. What configure > flag do I have to pull to get this in? (`VTK_WRAP_PYTHON` only seems to do > Python 2.) Also, is it possible to compile interfaces for both Python 2 and > Python 3 at once? > You should set VTK_PYTHON_VERSION to 3, it defaults to 2. You cannot compile with both, and will have to choose one or the other. From mallikarjun49 at gmail.com Thu Apr 21 13:42:34 2016 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Thu, 21 Apr 2016 23:12:34 +0530 Subject: [vtkusers] Error running Medical4.cxx In-Reply-To: References: <1811052521.4954395.1461243589627.JavaMail.yahoo.ref@mail.yahoo.com> <1811052521.4954395.1461243589627.JavaMail.yahoo@mail.yahoo.com> Message-ID: Hi Max, In your CMakeLists.txt change find_package(VTK COMPONENTS .. .. ..) to find_package(VTK REQUIRED) and regenerate your solution. HTH. /Mallikarjun On Thu, Apr 21, 2016 at 6:35 PM, John Drescher wrote: > > I am have been trying to install VTK into visual studio 2013 for the past > > tow days and finished , the problem I have I been trying to run > > medical4.cxx , and it seems that the data file cant be read when I > disable > > the line (arg< 2) I get tow error statement > > > You should not disable this. Pass the program the correct command line > arguments. If you are not that familiar with doing so under Visual > Studio a quick google should lead to many results. > > > John > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- *With Kind Regards:* Mallikarjun -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Thu Apr 21 17:44:43 2016 From: rickfrank at me.com (Richard Frank) Date: Thu, 21 Apr 2016 21:44:43 +0000 (GMT) Subject: [vtkusers] vtkVolumePicker Message-ID: <0eb5ea14-9d4f-40dc-8697-46e4c61bdb55@me.com> Hi, I'm having trouble reaching all ijk in a volume using the Volume Picker. The computed ijk returned from the picker is in a few?cases incorrect. I realize there are rounding issues and such, but I'm trying to pick a single voxel and I get back, say, 314,391,454 instead of 313,392,454 - in image coordinates, for example. Most often it is fine - it's just in some cases there are small rows / columns that are unreachable. Anyone have any advice on this? I assume it's some sort of fractional voxel issue but I need to find a way to reach all the voxels. I've tried setting the tolerance but it's unclear if that's really the issue.... Thanks Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Apr 21 18:17:47 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 21 Apr 2016 16:17:47 -0600 Subject: [vtkusers] vtkVolumePicker In-Reply-To: <0eb5ea14-9d4f-40dc-8697-46e4c61bdb55@me.com> References: <0eb5ea14-9d4f-40dc-8697-46e4c61bdb55@me.com> Message-ID: Hi Richard, You'll have to lay out your methods in a bit more detail... you say that you need a way "reach all the voxels" in the volume, and I'm trying to wrap my head around what you mean by this. Picking transparent voxels is obviously going to be impossible. Ditto for picking any voxels that are surrounded by opaque voxels. I'm not sure what you man by "small rows/columns" either... aren't all the rows and columns in the volume the same size? - David On Thu, Apr 21, 2016 at 3:44 PM, Richard Frank wrote: > Hi, > > I'm having trouble reaching all ijk in a volume using the Volume Picker. > > The computed ijk returned from the picker is in a few cases incorrect. I > realize there are rounding issues and such, but I'm trying to pick a single > voxel and I get back, say, 314,391,454 instead of 313,392,454 - in image > coordinates, for example. > > Most often it is fine - it's just in some cases there are small rows / > columns that are unreachable. Anyone have any advice on this? I assume it's > some sort of fractional voxel issue but I need to find a way to reach all > the voxels. I've tried setting the tolerance but it's unclear if that's > really the issue.... > > > Thanks > > Rick > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Thu Apr 21 21:13:24 2016 From: tjlp at netease.com (Liu_tj) Date: Fri, 22 Apr 2016 09:13:24 +0800 (CST) Subject: [vtkusers] How to set the vtkBorderWidget initial position for DICOM image on vtkRenderWindow In-Reply-To: <560ca846.16.154348e1edc.Coremail.tjlp@netease.com> References: <560ca846.16.154348e1edc.Coremail.tjlp@netease.com> Message-ID: <7a333abb.1.1543b8752b8.Coremail.tjlp@netease.com> Hi, Sorry for post it again. As no guys give some comments, I try to repost it. I use vtkImageViewer2 to display a DICOM series. Now I choose vtkBorderWidget to select area for the DICOM series. My problem is how to set the vtkBorderWidget initial position to a place where can include for example 3/4 of the DICOM image instead of the low bottom position. Possibly it needs to get the left bottom and right top coordinate of the DICOM image on the vtkRenderWindow (I also don't know how to get that). Thanks for understanding Liu Peng ?2016-04-21?"Liu_tj" ??? -----????----- ???:"Liu_tj" ????:2016?04?21? ??? ???:"vtkusers" ??:[vtkusers] How to set the vtkBorderWidget initial position for DICOM image on vtkRenderWindow Hi, I use vtkImageViewer2 to display a DICOM series. Now I choose vtkBorderWidget to select area for the DICOM series. My problem is how to set the vtkBorderWidget initial position to a place where can include for example 3/4 of the DICOM image instead of the low bottom position. Possibly it needs to get the left bottom and right top coordinate of the DICOM image on the vtkRenderWindow (I also don't know how to get that). Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Thu Apr 21 22:19:46 2016 From: rickfrank at me.com (Richard Frank) Date: Fri, 22 Apr 2016 02:19:46 +0000 (GMT) Subject: [vtkusers] vtkVolumePicker Message-ID: Hi David I have a binary volume (thresholded from a gray volume). ?The opacity transfer function sets 0 to transparent and 1.0 to opaque. There are some noise areas and I've created an eraser tool so the user can erase some individual voxels. Since the volume is mostly black, and I need to do computations on the non-zero voxels later, I first go through the volume k = 0 ?< kmax, ?j = 0 ?< jmax x=?0?GetPointIJK(ijk) ?returns in one case 318 391 452. but my cursor has 318 364 452 318 390 452 <------ 319 307 88 319 308 88 And so I don't think the point is actually hit, so I don't erase it. My ijk s are accurate - I presume - because I walk through the whole volume voxel?by voxels?to build the cursor. This is a "close" match but others are off by 4 - 10 voxels (usually in the z direction). I've tried doing a distance match based on the xyz coordinates (which I also record in my cursor) and that works the best so far, but, I still wind up with a lone pixel (or say a row or column of 4 - 5 pixels) that I can't do an inverse map to ?- from the hit xyz to my ijk. So it seems that the picker->ijk has some rounding or something going on that doesn't exactly match my precomputed ijk. Any thoughts on how to accomplish what I want to do? Thanks Rick On Apr 21, 2016, at 06:18 PM, David Gobbi wrote: Hi Richard, You'll have to lay out your methods in a bit more detail... you say that you need a way "reach all the voxels" in the volume, and I'm trying to wrap my head around what you mean by this.? Picking transparent voxels is obviously going to be impossible.? Ditto for picking any voxels that are surrounded by opaque voxels.? I'm not sure what you man by "small rows/columns" either... aren't all the rows and columns in the volume the same size? ?- David On Thu, Apr 21, 2016 at 3:44 PM, Richard Frank wrote: Hi, I'm having trouble reaching all ijk in a volume using the Volume Picker. The computed ijk returned from the picker is in a few?cases incorrect. I realize there are rounding issues and such, but I'm trying to pick a single voxel and I get back, say, 314,391,454 instead of 313,392,454 - in image coordinates, for example. Most often it is fine - it's just in some cases there are small rows / columns that are unreachable. Anyone have any advice on this? I assume it's some sort of fractional voxel issue but I need to find a way to reach all the voxels. I've tried setting the tolerance but it's unclear if that's really the issue.... Thanks Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Apr 21 22:53:51 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 21 Apr 2016 20:53:51 -0600 Subject: [vtkusers] vtkVolumePicker In-Reply-To: References: Message-ID: Hi Richard, Try different values for picker->SetVolumeOpacityIsovalue(x). For a binary volume, a value of 0.51 will work better than the default value of 0.05. While debugging this, you can use picker->GetPCoords() to get the fractional part of the IJK coords. - David On Thu, Apr 21, 2016 at 8:19 PM, Richard Frank wrote: > Hi David > > I have a binary volume (thresholded from a gray volume). The opacity > transfer function sets 0 to transparent and 1.0 to opaque. > > There are some noise areas and I've created an eraser tool so the user can > erase some individual voxels. > > Since the volume is mostly black, and I need to do computations on the > non-zero voxels later, I first go through the volume k = 0 < kmax, j = 0 > < jmax x= 0 < xmax > and build a point list where each voxel != 0 has it's voxel ijk and > pointId recorded. So I have a cursor. > > > When the user clicks, picker->GetPointIJK(ijk) returns in one case 318 > 391 452. > > but my cursor has > > 318 364 452 > 318 390 452 <------ > 319 307 88 > 319 308 88 > > And so I don't think the point is actually hit, so I don't erase it. > > My ijk s are accurate - I presume - because I walk through the whole > volume voxel by voxels to build the cursor. > > This is a "close" match but others are off by 4 - 10 voxels (usually in > the z direction). > > I've tried doing a distance match based on the xyz coordinates (which I > also record in my cursor) and that works the best so far, but, I still wind > up with a lone pixel (or say a row or column of 4 - 5 pixels) that I can't > do an inverse map to - from the hit xyz to my ijk. > > So it seems that the picker->ijk has some rounding or something going on > that doesn't exactly match my precomputed ijk. > > Any thoughts on how to accomplish what I want to do? > > Thanks > > Rick > > > On Apr 21, 2016, at 06:18 PM, David Gobbi wrote: > > Hi Richard, > > You'll have to lay out your methods in a bit more detail... you say that > you need a way "reach all the voxels" in the volume, and I'm trying to wrap > my head around what you mean by this. Picking transparent voxels is > obviously going to be impossible. Ditto for picking any voxels that are > surrounded by opaque voxels. I'm not sure what you man by "small > rows/columns" either... aren't all the rows and columns in the volume the > same size? > > - David > > > On Thu, Apr 21, 2016 at 3:44 PM, Richard Frank wrote: > >> Hi, >> >> I'm having trouble reaching all ijk in a volume using the Volume Picker. >> >> The computed ijk returned from the picker is in a few cases incorrect. I >> realize there are rounding issues and such, but I'm trying to pick a single >> voxel and I get back, say, 314,391,454 instead of 313,392,454 - in image >> coordinates, for example. >> >> Most often it is fine - it's just in some cases there are small rows / >> columns that are unreachable. Anyone have any advice on this? I assume it's >> some sort of fractional voxel issue but I need to find a way to reach all >> the voxels. I've tried setting the tolerance but it's unclear if that's >> really the issue.... >> >> >> Thanks >> >> Rick >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tossin at gmail.com Fri Apr 22 00:42:02 2016 From: tossin at gmail.com (Evan Kao) Date: Thu, 21 Apr 2016 21:42:02 -0700 Subject: [vtkusers] VTK equivalent of Paraview's Crinkle Clip option? Message-ID: Hey all, Is there a VTK equivalent of Paraview's Crinkle Clip option? Some background: I'm want to interactively edit the point data array of some vtkDataSet. I'm trying to do the following pipeline: - vtkIdsFilter is applied to a geometry generate an Ids array - User uses (box, plane, sphere) widget to roughly specify an implicit function encompassing part of the geometry - The implicit function is used to clip the data set (inside out) and the remaining point Ids are obtained - The array data for those specific point Ids are set to a specific value However, for some reason the various clippers will remove the generated point Ids array in both VTK and Paraview. It makes some sense since new points are generated by the clip, but I think it would be more convenient if the array wasn't thrown out entirely. in Paraview, this issue can be avoided if the Crinkle Clip option is turned on. But I couldn't find an equivalent option in any of VTK's various clippers. I can get around this by basically casting the Idsarray from vtkIdType to Int before clipping, but that seems pretty inelegant. A crinkle clip would be more appropriate. I'm also open to other ideas for grabbing the point Ids without using a clipper. Thanks, Evan Kao -------------- next part -------------- An HTML attachment was scrubbed... URL: From black4online at yahoo.com Fri Apr 22 05:52:32 2016 From: black4online at yahoo.com (max black) Date: Fri, 22 Apr 2016 09:52:32 +0000 (UTC) Subject: [vtkusers] Using medical4.cxx to read CT scan References: <430975770.258897.1461318752661.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <430975770.258897.1461318752661.JavaMail.yahoo@mail.yahoo.com> HI therethank for responding for the first email it was very helpful, my next goal is to read CT scan and create 3d model like example medical4.cxx, any idea how to do it , or tutorial that can help me to accomplish this task , and help will be much appreciated .?Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From sur.chiranjib at gmail.com Fri Apr 22 06:39:09 2016 From: sur.chiranjib at gmail.com (Chiranjib Sur) Date: Fri, 22 Apr 2016 16:09:09 +0530 Subject: [vtkusers] find inside / outside region of a polydata -- some clarification Message-ID: Hi, Here is a problem I am dealing with. 1. I have created a polydata (vtkPolydata) consists of a set of unstructured points (vtkPoints). 2. I run the Delaunay filter to create the connectivity and cells for the points in the polydata. 3. As a result I get the surface of the polydata and then I run the "FillHolesFilter" to make sure that there are no holes in the surface. At this stage I am not sure if am successful or still there are some disconnected regions on the surface where the connectivity information is missing. 4. Now I try to find out for a given point p, if it is inside or outside of the polydata I get after step 3. (ex : http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject) Here I notice that some points which are strictly should be identified as outside of the surface, are determined as inside. The above example works on the assumption that the original polydata (after step 3) should have a closed surface. If my understanding is right, then how do I make sure that at stage 3, I have a polydata for which I really have a closed continuous surface ? http://vtk.1045678.n5.nabble.com/Find-if-a-point-is-inside-a-mesh-td5649582.html The above thread, discussed about this problem partially, but I am still not clear if I my understanding is right and how to solve it. Any help from the experts? Thanks, Chiranjib -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Fri Apr 22 09:10:08 2016 From: rickfrank at me.com (Richard Frank) Date: Fri, 22 Apr 2016 09:10:08 -0400 Subject: [vtkusers] vtkVolumePicker In-Reply-To: References: Message-ID: <87A26FE1-33E6-46DE-A126-A3275D94D7B5@me.com> Ok I will experiment. I think I have the iso set to 0.3 currently ( through trial and error) I also found an issue where in some cases the Ray trace loop ( in vtkCellPicker ) would get stuck. While ( t1 < tLast ) // something like this Etc In the particular instance, which seemed to be a click on an "empty" transparent area, t1 would get stuck at 1.0 " fore ever" ... So I subclassed it to work around and if t1 stays a 1.0 +- tiny e for >200 loops I break out. Sent from my iPad > On Apr 21, 2016, at 10:53 PM, David Gobbi wrote: > > Hi Richard, > > Try different values for picker->SetVolumeOpacityIsovalue(x). For a binary volume, a value of 0.51 will work better than the default value of 0.05. > > While debugging this, you can use picker->GetPCoords() to get the fractional part of the IJK coords. > > - David > > >> On Thu, Apr 21, 2016 at 8:19 PM, Richard Frank wrote: >> Hi David >> >> I have a binary volume (thresholded from a gray volume). The opacity transfer function sets 0 to transparent and 1.0 to opaque. >> >> There are some noise areas and I've created an eraser tool so the user can erase some individual voxels. >> >> Since the volume is mostly black, and I need to do computations on the non-zero voxels later, I first go through the volume k = 0 < kmax, j = 0 < jmax x= 0 < xmax >> and build a point list where each voxel != 0 has it's voxel ijk and pointId recorded. So I have a cursor. >> >> >> When the user clicks, picker->GetPointIJK(ijk) returns in one case 318 391 452. >> >> but my cursor has >> >> 318 364 452 >> 318 390 452 <------ >> 319 307 88 >> 319 308 88 >> >> And so I don't think the point is actually hit, so I don't erase it. >> >> My ijk s are accurate - I presume - because I walk through the whole volume voxel by voxels to build the cursor. >> >> This is a "close" match but others are off by 4 - 10 voxels (usually in the z direction). >> >> I've tried doing a distance match based on the xyz coordinates (which I also record in my cursor) and that works the best so far, but, I still wind up with a lone pixel (or say a row or column of 4 - 5 pixels) that I can't do an inverse map to - from the hit xyz to my ijk. >> >> So it seems that the picker->ijk has some rounding or something going on that doesn't exactly match my precomputed ijk. >> >> Any thoughts on how to accomplish what I want to do? >> >> Thanks >> >> Rick >> >> >>> On Apr 21, 2016, at 06:18 PM, David Gobbi wrote: >>> >> >>> Hi Richard, >>> >>> You'll have to lay out your methods in a bit more detail... you say that you need a way "reach all the voxels" in the volume, and I'm trying to wrap my head around what you mean by this. Picking transparent voxels is obviously going to be impossible. Ditto for picking any voxels that are surrounded by opaque voxels. I'm not sure what you man by "small rows/columns" either... aren't all the rows and columns in the volume the same size? >>> >>> - David >>> >>> >>>> On Thu, Apr 21, 2016 at 3:44 PM, Richard Frank wrote: >>>> Hi, >>>> >>>> I'm having trouble reaching all ijk in a volume using the Volume Picker. >>>> >>>> The computed ijk returned from the picker is in a few cases incorrect. I realize there are rounding issues and such, but I'm trying to pick a single voxel and I get back, say, 314,391,454 instead of 313,392,454 - in image coordinates, for example. >>>> >>>> Most often it is fine - it's just in some cases there are small rows / columns that are unreachable. Anyone have any advice on this? I assume it's some sort of fractional voxel issue but I need to find a way to reach all the voxels. I've tried setting the tolerance but it's unclear if that's really the issue.... >>>> >>>> >>>> Thanks >>>> >>>> Rick > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Apr 22 09:25:31 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 22 Apr 2016 07:25:31 -0600 Subject: [vtkusers] vtkVolumePicker In-Reply-To: <87A26FE1-33E6-46DE-A126-A3275D94D7B5@me.com> References: <87A26FE1-33E6-46DE-A126-A3275D94D7B5@me.com> Message-ID: On Fri, Apr 22, 2016 at 7:10 AM, Richard Frank wrote: > > I also found an issue where in some cases the Ray trace loop ( in > vtkCellPicker ) would get stuck. > > While ( t1 < tLast ) // something like this > > Etc > > In the particular instance, which seemed to be a click on an "empty" > transparent area, t1 would get stuck at 1.0 " fore ever" ... > > So I subclassed it to work around and if t1 stays a 1.0 +- tiny e for >200 > loops I break out. > Thanks for the info, there must be a bug. I'll take a look at that loop. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.j.brown at live.co.uk Fri Apr 22 10:05:26 2016 From: richard.j.brown at live.co.uk (Richard Brown) Date: Fri, 22 Apr 2016 16:05:26 +0200 Subject: [vtkusers] vtkChartXY picking In-Reply-To: References: <1460726004464-5737711.post@n5.nabble.com> Message-ID: Hi Jeff, So if I want my left button to select the point underneath it (I think the right button by default creates a box and selects points within that box but then does nothing with them?) and then, for example, print the information pertaining to that point, how would I go about that? SetButtonToAction(vtkChartXY::SELECT, vtkContextMouseEvent::LEFT_MOUSE); Do I then set up an observer for vtkChartXY::SELECT? And from there, when I?m in the callback function, how do I get the information of the selected point? Thanks in advance, Richard > On 18 Apr 2016, at 13:54, Jeff Baumes wrote: > > I think you want SetActionToButton() on vtkChart to change mouse bindings. You should be able to listen for a selection event once that is set up. > > http://www.vtk.org/doc/nightly/html/classvtkChart.html#ac4162187f5f3ad97f0163a079e06f13d > On Fri, Apr 15, 2016 at 9:13 AM mbcx9rb9 > wrote: > Hi all, > > I'd like to create a custom interactor for vtkChartXY (inherited from > vtkContextInteractorStyle), but I can't figure out how to select single > points with the left click of the mouse. Once I manage to that, I would need > to return the index of the selected point. > > This seems very straightforward to me, but I haven't seen any concrete > examples. > > Any pointers would be greatly appreciated. > > Regards, > Richard > > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp5737711.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.j.brown at live.co.uk Fri Apr 22 10:37:40 2016 From: richard.j.brown at live.co.uk (Richard Brown) Date: Fri, 22 Apr 2016 16:37:40 +0200 Subject: [vtkusers] vtkChartXY picking In-Reply-To: References: <1460726004464-5737711.post@n5.nabble.com> Message-ID: I just advanced from where I was and I know have: void pointSelected(vtkObject* obj, unsigned long,void*, void*) { std::cout << "\nPoint selected.\n"; // Print info of selected point } int main() { chart->SetActionToButton(vtkChartXY::SELECT, vtkContextMouseEvent::LEFT_BUTTON); vtkSmartPointer keypressCallback = vtkSmartPointer::New(); keypressCallback->SetCallback ( pointSelected ); chart->AddObserver(vtkContextMouseEvent::LEFT_BUTTON, keypressCallback); } And this works as expected; every time I left-click on a point, I cout ?Point selected?. My initial question is still stands: how do I get information on the selected point? When plotting my points, they were part of a table. Could I get the table in question (there are multiple plots, so multiple tables), and then the index of the data point within the table? Regards, Richard > On 22 Apr 2016, at 16:05, Richard Brown wrote: > > Hi Jeff, > > So if I want my left button to select the point underneath it (I think the right button by default creates a box and selects points within that box but then does nothing with them?) and then, for example, print the information pertaining to that point, how would I go about that? > > SetButtonToAction(vtkChartXY::SELECT, vtkContextMouseEvent::LEFT_MOUSE); > > Do I then set up an observer for vtkChartXY::SELECT? > > And from there, when I?m in the callback function, how do I get the information of the selected point? > > Thanks in advance, > Richard > > >> On 18 Apr 2016, at 13:54, Jeff Baumes > wrote: >> >> I think you want SetActionToButton() on vtkChart to change mouse bindings. You should be able to listen for a selection event once that is set up. >> >> http://www.vtk.org/doc/nightly/html/classvtkChart.html#ac4162187f5f3ad97f0163a079e06f13d >> On Fri, Apr 15, 2016 at 9:13 AM mbcx9rb9 > wrote: >> Hi all, >> >> I'd like to create a custom interactor for vtkChartXY (inherited from >> vtkContextInteractorStyle), but I can't figure out how to select single >> points with the left click of the mouse. Once I manage to that, I would need >> to return the index of the selected point. >> >> This seems very straightforward to me, but I haven't seen any concrete >> examples. >> >> Any pointers would be greatly appreciated. >> >> Regards, >> Richard >> >> >> >> >> >> -- >> View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp5737711.html >> Sent from the VTK - Users mailing list archive at Nabble.com . >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From Siqueiros.jorge at outlook.com Fri Apr 22 14:58:09 2016 From: Siqueiros.jorge at outlook.com (Georges) Date: Fri, 22 Apr 2016 11:58:09 -0700 (MST) Subject: [vtkusers] How to obtain the coordinates (double and not int type) mouse picking over an image? Message-ID: <1461351489614-5737850.post@n5.nabble.com> Hi everybody, I'm new in vtk, this is my first vtk project. I'm working over C++ in VisualStudio with vtk 5.10.1 version. I'm making a SDI-MFC aplication and I'm trying to obtain the coordinates (image coordinates) of the left mouse click event when this click is over an image. I've reviewed the examples pickpixel, pickpixel2 and picking, but pickpixel2 gave me the coordiantes in int type variable and I need the coordinates in double type variable. I've implemented the picking example (link: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/Picking) but when I run the app over my program I get an Assertion and I can?t find the error. I now attach my programm. I appreciate your help in explaining how could I make the picking detection event or find the program mistake. *// ************************************************************************* // FUNCTION TO LOAD AN IMAGE IN FORMATS *,jpg. *.bmp, *.tiff, *.png // ************************************************************************** void COSSysView::OssysLoadImagevtk(CString m_ImagePath) { //Create an image reader vtkImageFileReader *ImageReader = vtkImageFileReader::New(); ImageReader->SetFileName(m_ImagePath); ImageReader->Update(); // ###Create an image mapper vtkImageMapper3D *imageMapper; vtkImageSliceMapper *imageSMapper = vtkImageSliceMapper::New(); imageMapper = imageSMapper; imageMapper->SetInputConnection(ImageReader->GetOutputPort()); // Create an actor vtkImageActor *ImageActor = vtkImageActor::New(); ImageActor->SetInput(ImageReader->GetOutput()); ImageActor->SetPosition(0,0,0); ImageActor->SetMapper(imageMapper); GetRenderer()->RemoveAllViewProps(); // Remove all the actors // Setup renderer GetRenderer()->AddActor(ImageActor); GetRenderer()->ResetCamera(); // Setup render window GetRenderer()->GetRenderWindow()->Render(); // Setup render window interactor vtkRenderWindowInteractor *renderWindowInteractor = vtkRenderWindowInteractor::New(); MouseInteractorStyle2 *style = MouseInteractorStyle2::New(); renderWindowInteractor->SetInteractorStyle(style); // Render and start interaction renderWindowInteractor->SetRenderWindow(GetRenderer()->GetRenderWindow()); renderWindowInteractor->Initialize(); renderWindowInteractor->Start(); } *// ************************************************************************** *// ************************************************************************* // CLASS TO HANDLE MOUSE EVENT // ************************************************************************** class MouseInteractorStyle2 : public vtkInteractorStyleTrackballCamera { public: static MouseInteractorStyle2* New(); vtkTypeMacro(MouseInteractorStyle2, vtkInteractorStyleTrackballCamera); virtual void OnLeftButtonDown() { int* clickPos = this->GetInteractor()->GetEventPosition(); // Pick from this location. vtkSmartPointer picker = vtkSmartPointer::New(); picker->Pick(clickPos[0], clickPos[1], 0, this->GetDefaultRenderer()); // IN THIS PART THE ASSERTION APPEARS double* pos = picker->GetPickPosition(); std::cout << "Pick position (world coordinates) is: " << pos[0] << " " << pos[1] << " " << pos[2] << std::endl; std::cout << "Picked actor: " << picker->GetActor() << std::endl; //Create a sphere vtkSmartPointer sphereSource = vtkSmartPointer::New(); sphereSource->SetCenter(pos[0], pos[1], pos[2]); sphereSource->SetRadius(0.1); //Create a mapper and actor vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(sphereSource->GetOutputPort()); vtkSmartPointer actorsphere = vtkSmartPointer::New(); actorsphere->SetMapper(mapper); this->GetDefaultRenderer()->AddActor(actorsphere); // Forward events vtkInteractorStyleTrackballCamera::OnLeftButtonDown(); } }; vtkStandardNewMacro(MouseInteractorStyle2); -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-obtain-the-coordinates-double-and-not-int-type-mouse-picking-over-an-image-tp5737850.html Sent from the VTK - Users mailing list archive at Nabble.com. From inglis.dl at gmail.com Fri Apr 22 15:13:39 2016 From: inglis.dl at gmail.com (Dean Inglis) Date: Fri, 22 Apr 2016 15:13:39 -0400 Subject: [vtkusers] How to obtain the coordinates (double and not int type) mouse picking over an image? In-Reply-To: <1461351489614-5737850.post@n5.nabble.com> References: <1461351489614-5737850.post@n5.nabble.com> Message-ID: HI Georges, you should see if the left mouse button actually clicked on your image actor, something like this: picker->PickFromListOn(); picker->AddPickList(imageActor); picker->Pick( X, Y, 0.0, this->CurrentRenderer ); vtkAssemblyPath* path = this->Picker->GetPath(); vtkProp* pickedProp = 0; if( path ) { // Deal with the possibility that we may be using a shared picker vtkCollectionSimpleIterator sit; path->InitTraversal( sit ); vtkAssemblyNode *node; for( int i = 0; i < path->GetNumberOfItems(); ++i ) { node = path->GetNextNode( sit ); pickedProp = node->GetViewProp(); if( imageActor == pickedProp ) { break; } } } if( !pickedProp ) return; double q[3]; picker->GetPickPosition(q); What I do with picking on a vtkImageActor is to clamp the picked position to the bounds of the actor, then convert the clamped position from world coordinates back into image data voxel/pixel coordinate using the origin, spacing and extent of the vtkImageData that is being displayed by the actor. You probably will need to NOT set the actor position: ImageActor->SetPosition(0,0,0); - Dean On Fri, Apr 22, 2016 at 2:58 PM, Georges wrote: > Hi everybody, I'm new in vtk, this is my first vtk project. I'm working > over > C++ in VisualStudio with vtk 5.10.1 version. I'm making a SDI-MFC > aplication > and I'm trying to obtain the coordinates (image coordinates) of the left > mouse click event when this click is over an image. I've reviewed the > examples pickpixel, pickpixel2 and picking, but pickpixel2 gave me the > coordiantes in int type variable and I need the coordinates in double type > variable. I've implemented the picking example (link: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/Picking) but when I > run > the app over my program I get an Assertion and I can?t find the error. I > now > attach my programm. I appreciate your help in explaining how could I make > the picking detection event or find the program mistake. > > *// > ************************************************************************* > // FUNCTION TO LOAD AN IMAGE IN FORMATS *,jpg. *.bmp, *.tiff, *.png > // > ************************************************************************** > void COSSysView::OssysLoadImagevtk(CString m_ImagePath) > { > //Create an image reader > vtkImageFileReader *ImageReader = vtkImageFileReader::New(); > ImageReader->SetFileName(m_ImagePath); > ImageReader->Update(); > > // ###Create an image mapper > vtkImageMapper3D *imageMapper; > vtkImageSliceMapper *imageSMapper = vtkImageSliceMapper::New(); > imageMapper = imageSMapper; > imageMapper->SetInputConnection(ImageReader->GetOutputPort()); > > // Create an actor > vtkImageActor *ImageActor = vtkImageActor::New(); > ImageActor->SetInput(ImageReader->GetOutput()); > ImageActor->SetPosition(0,0,0); > ImageActor->SetMapper(imageMapper); > > GetRenderer()->RemoveAllViewProps(); // Remove all the actors > > // Setup renderer > GetRenderer()->AddActor(ImageActor); > GetRenderer()->ResetCamera(); > > // Setup render window > GetRenderer()->GetRenderWindow()->Render(); > > // Setup render window interactor > vtkRenderWindowInteractor *renderWindowInteractor = > vtkRenderWindowInteractor::New(); > MouseInteractorStyle2 *style = > MouseInteractorStyle2::New(); > > renderWindowInteractor->SetInteractorStyle(style); > > // Render and start interaction > > renderWindowInteractor->SetRenderWindow(GetRenderer()->GetRenderWindow()); > renderWindowInteractor->Initialize(); > renderWindowInteractor->Start(); > > } > *// > ************************************************************************** > > *// > ************************************************************************* > // CLASS TO HANDLE MOUSE EVENT > // > ************************************************************************** > > class MouseInteractorStyle2 : public vtkInteractorStyleTrackballCamera > { > public: > static MouseInteractorStyle2* New(); > vtkTypeMacro(MouseInteractorStyle2, vtkInteractorStyleTrackballCamera); > > virtual void OnLeftButtonDown() > { > int* clickPos = this->GetInteractor()->GetEventPosition(); > > // Pick from this location. > vtkSmartPointer picker = > vtkSmartPointer::New(); > picker->Pick(clickPos[0], clickPos[1], 0, > this->GetDefaultRenderer()); > // IN THIS PART THE ASSERTION APPEARS > > double* pos = picker->GetPickPosition(); > std::cout << "Pick position (world coordinates) is: " > << pos[0] << " " << pos[1] > << " " << pos[2] << std::endl; > > std::cout << "Picked actor: " << picker->GetActor() << std::endl; > > //Create a sphere > vtkSmartPointer sphereSource = > vtkSmartPointer::New(); > sphereSource->SetCenter(pos[0], pos[1], pos[2]); > sphereSource->SetRadius(0.1); > > //Create a mapper and actor > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(sphereSource->GetOutputPort()); > > vtkSmartPointer actorsphere = > vtkSmartPointer::New(); > actorsphere->SetMapper(mapper); > this->GetDefaultRenderer()->AddActor(actorsphere); > // Forward events > vtkInteractorStyleTrackballCamera::OnLeftButtonDown(); > } > > }; > > vtkStandardNewMacro(MouseInteractorStyle2); > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/How-to-obtain-the-coordinates-double-and-not-int-type-mouse-picking-over-an-image-tp5737850.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From at.higginson at gmail.com Fri Apr 22 19:11:37 2016 From: at.higginson at gmail.com (Andrew Higginson) Date: Fri, 22 Apr 2016 23:11:37 +0000 Subject: [vtkusers] JPEGImageWriter to memory (C++) Message-ID: Hi all, I am trying to use a vtkJPEGImageWriter to write a JPEG file to memory (instead of writing to disk and then reading it again using fopen or similar) in C++. To do this I believe I need something like the following: ---- vtkSmartPointer writer = vtkSmartPointer::New(); writer->SetWriteToMemory(true); writer->SetInputData(...); writer->Write(); vtkUnsignedCharArray* d = writer->GetResult(); ---- However at this point I don't know how to extract what I need from the vtkUnsignedCharArray. I would like the raw bytes and size, like so: ---- char* data = d->... size_t size = d->... ---- But I am not sure how to do this. Any help would be greatly appreciated :) Thanks, Andrew Higginson -- Andrew Higginson -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Sat Apr 23 07:25:18 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Sat, 23 Apr 2016 07:25:18 -0400 Subject: [vtkusers] JPEGImageWriter to memory (C++) In-Reply-To: References: Message-ID: Try: char *data = (char*)d->GetVoidPointer(); size_t size = (size_t)(d->GetSize()*d->GetDataTypeSize()); David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Apr 22, 2016 at 7:11 PM, Andrew Higginson wrote: > Hi all, > > > I am trying to use a vtkJPEGImageWriter to write a JPEG file to memory > (instead of writing to disk and then reading it again using fopen or > similar) in C++. > > > To do this I believe I need something like the following: > > ---- > vtkSmartPointer writer = > vtkSmartPointer::New(); > writer->SetWriteToMemory(true); > writer->SetInputData(...); > writer->Write(); > > vtkUnsignedCharArray* d = writer->GetResult(); > ---- > > > However at this point I don't know how to extract what I need from the > vtkUnsignedCharArray. I would like the raw bytes and size, like so: > > > ---- > char* data = d->... > size_t size = d->... > ---- > > > > But I am not sure how to do this. Any help would be greatly appreciated :) > > > Thanks, > Andrew Higginson > -- > > Andrew Higginson > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From at.higginson at gmail.com Sat Apr 23 08:45:00 2016 From: at.higginson at gmail.com (Andrew Higginson) Date: Sat, 23 Apr 2016 12:45:00 +0000 Subject: [vtkusers] JPEGImageWriter to memory (C++) In-Reply-To: References: Message-ID: Fab it works! I think I also had issues with trying to use the data directly, however after copying it to a new location with memcpy everything worked. Cheers :) On Sat, 23 Apr 2016 at 12:25 David E DeMarle wrote: > Try: > char *data = (char*)d->GetVoidPointer(); > size_t size = (size_t)(d->GetSize()*d->GetDataTypeSize()); > > > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > On Fri, Apr 22, 2016 at 7:11 PM, Andrew Higginson > wrote: > >> Hi all, >> >> >> I am trying to use a vtkJPEGImageWriter to write a JPEG file to memory >> (instead of writing to disk and then reading it again using fopen or >> similar) in C++. >> >> >> To do this I believe I need something like the following: >> >> ---- >> vtkSmartPointer writer = >> vtkSmartPointer::New(); >> writer->SetWriteToMemory(true); >> writer->SetInputData(...); >> writer->Write(); >> >> vtkUnsignedCharArray* d = writer->GetResult(); >> ---- >> >> >> However at this point I don't know how to extract what I need from the >> vtkUnsignedCharArray. I would like the raw bytes and size, like so: >> >> >> ---- >> char* data = d->... >> size_t size = d->... >> ---- >> >> >> >> But I am not sure how to do this. Any help would be greatly appreciated :) >> >> >> Thanks, >> Andrew Higginson >> -- >> >> Andrew Higginson >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -- Andrew Higginson -------------- next part -------------- An HTML attachment was scrubbed... URL: From lihouxing at yeah.net Sat Apr 23 23:47:14 2016 From: lihouxing at yeah.net (lee) Date: Sat, 23 Apr 2016 20:47:14 -0700 (MST) Subject: [vtkusers] How to initialize the distancewidget with my specified two world positions? Message-ID: <1461469634064-5737857.post@n5.nabble.com> Hi all, I want to show the distance between two points in 3D, I believe vtkDistanceWidget can realize this function. I tried the code below, but the position of the two point handles is always at {0,0,0}. Anybody know why,or have another option for me to realzie the function? Any suggestion would be appriciated, thanks in advance! m_distanceWidget=vtkSmartPointer::New(); m_distanceRep=vtkSmartPointer::New(); m_distanceRep->SetPoint1WorldPosition(IntersectionPoint); m_distanceRep->SetPoint2WorldPosition(sagitalProjectionPoint); m_distanceWidget->SetInteractor(ui.ModelView->interactor()); m_distanceWidget->SetRepresentation(m_distanceRep); m_distanceWidget->SetWidgetStateToManipulate(); m_distanceWidget->EnabledOn(); m_distanceWidget->Render(); -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-initialize-the-distancewidget-with-my-specified-two-world-positions-tp5737857.html Sent from the VTK - Users mailing list archive at Nabble.com. From rickfrank at me.com Sun Apr 24 13:24:41 2016 From: rickfrank at me.com (Richard Frank) Date: Sun, 24 Apr 2016 13:24:41 -0400 Subject: [vtkusers] Assemblies "coming apart " during long test runs.... Message-ID: <3AD159AF-2ADE-4C21-AF64-49FDE7E30AC4@me.com> We are seeing a strange behavior. We have a model of an human internal organ, made up of a series of triangle meshes. The are between four and seven sets of meshes combined into an an assembly. During a long ( multiple hours ) automated test, where a surgical instrument is moved through the scene repeatedly ( Made from implicit function sources and also combined into an assembly) , there is an issue - and the best way for me to describe it is that the assemblies " come apart. Each actor in the assembly is moved to a deferent place in the scene, as if perhaps they " exploded ". We have videoed this and there seems to be a screen flash before the happens. Things keep going, there's no crashes, etc. Has anyone else experienced this? Does anyone have an insight as to how to track down the problem? Thanks Rick Sent from my iPad From lasso at queensu.ca Sun Apr 24 13:45:10 2016 From: lasso at queensu.ca (Andras Lasso) Date: Sun, 24 Apr 2016 17:45:10 +0000 Subject: [vtkusers] Assemblies "coming apart " during long test runs.... In-Reply-To: <3AD159AF-2ADE-4C21-AF64-49FDE7E30AC4@me.com> References: <3AD159AF-2ADE-4C21-AF64-49FDE7E30AC4@me.com> Message-ID: Yes, we've experienced this, too. Screen flashes and then actors don't move anymore on screen and colors cannot be changed (we change actor properties in VTK but nothing changes on screen). Actors that we add after the flash behave normally. We run the same software on many computers in our lab but the problem only occurs on a few computers and never on others (even when running continuously for several days). We suspect it's a video card hardware/driver issue. The "flash" is probably a crash&recovery of the video card driver. Andras -----Original Message----- From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank Sent: April 24, 2016 1:25 PM To: vtkusers at vtk.org Subject: [vtkusers] Assemblies "coming apart " during long test runs.... We are seeing a strange behavior. We have a model of an human internal organ, made up of a series of triangle meshes. The are between four and seven sets of meshes combined into an an assembly. During a long ( multiple hours ) automated test, where a surgical instrument is moved through the scene repeatedly ( Made from implicit function sources and also combined into an assembly) , there is an issue - and the best way for me to describe it is that the assemblies " come apart. Each actor in the assembly is moved to a deferent place in the scene, as if perhaps they " exploded ". We have videoed this and there seems to be a screen flash before the happens. Things keep going, there's no crashes, etc. Has anyone else experienced this? Does anyone have an insight as to how to track down the problem? Thanks Rick Sent from my iPad _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers From rickfrank at me.com Sun Apr 24 13:50:41 2016 From: rickfrank at me.com (Richard Frank) Date: Sun, 24 Apr 2016 13:50:41 -0400 Subject: [vtkusers] Assemblies "coming apart " during long test runs.... In-Reply-To: References: <3AD159AF-2ADE-4C21-AF64-49FDE7E30AC4@me.com> Message-ID: <849F6681-2108-4BC7-9930-6C5A5CAA3AA7@me.com> Hmm. We're using top of the line quadro m 5000 cards ( and some geoforce 9xx cards ). Have you done any other tests ( OpenGL logging etc ) to get further information? Are you on Windows? Thanks Sent from my iPad > On Apr 24, 2016, at 1:45 PM, Andras Lasso wrote: > > Yes, we've experienced this, too. Screen flashes and then actors don't move anymore on screen and colors cannot be changed (we change actor properties in VTK but nothing changes on screen). Actors that we add after the flash behave normally. We run the same software on many computers in our lab but the problem only occurs on a few computers and never on others (even when running continuously for several days). > > We suspect it's a video card hardware/driver issue. The "flash" is probably a crash&recovery of the video card driver. > > Andras > > -----Original Message----- > From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank > Sent: April 24, 2016 1:25 PM > To: vtkusers at vtk.org > Subject: [vtkusers] Assemblies "coming apart " during long test runs.... > > We are seeing a strange behavior. We have a model of an human internal organ, made up of a series of triangle meshes. The are between four and seven sets of meshes combined into an an assembly. During a long ( multiple hours ) automated test, where a surgical instrument is moved through the scene repeatedly ( Made from implicit function sources and also combined into an assembly) , there is an issue - and the best way for me to describe it is that the assemblies " come apart. Each actor in the assembly is moved to a deferent place in the scene, as if perhaps they " exploded ". We have videoed this and there seems to be a screen flash before the happens. > Things keep going, there's no crashes, etc. > > Has anyone else experienced this? Does anyone have an insight as to how to track down the problem? > > Thanks > > Rick > > Sent from my iPad > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From lasso at queensu.ca Sun Apr 24 14:06:26 2016 From: lasso at queensu.ca (Andras Lasso) Date: Sun, 24 Apr 2016 18:06:26 +0000 Subject: [vtkusers] Assemblies "coming apart " during long test runs.... In-Reply-To: <849F6681-2108-4BC7-9930-6C5A5CAA3AA7@me.com> References: <3AD159AF-2ADE-4C21-AF64-49FDE7E30AC4@me.com> <849F6681-2108-4BC7-9930-6C5A5CAA3AA7@me.com> Message-ID: One computer where it happens quite frequently has NVidia GeForce GTX 660, uses Windows 8.1. The symptoms indicate video card/driver (maybe lower level - motherboard, BIOS, etc) issues, which are time-consuming to diagnose, so we just decided to not use this computer for any serious work. Andras -----Original Message----- From: Richard Frank [mailto:rickfrank at me.com] Sent: April 24, 2016 1:51 PM To: Andras Lasso Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Assemblies "coming apart " during long test runs.... Hmm. We're using top of the line quadro m 5000 cards ( and some geoforce 9xx cards ). Have you done any other tests ( OpenGL logging etc ) to get further information? Are you on Windows? Thanks Sent from my iPad > On Apr 24, 2016, at 1:45 PM, Andras Lasso wrote: > > Yes, we've experienced this, too. Screen flashes and then actors don't move anymore on screen and colors cannot be changed (we change actor properties in VTK but nothing changes on screen). Actors that we add after the flash behave normally. We run the same software on many computers in our lab but the problem only occurs on a few computers and never on others (even when running continuously for several days). > > We suspect it's a video card hardware/driver issue. The "flash" is probably a crash&recovery of the video card driver. > > Andras > > -----Original Message----- > From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank > Sent: April 24, 2016 1:25 PM > To: vtkusers at vtk.org > Subject: [vtkusers] Assemblies "coming apart " during long test runs.... > > We are seeing a strange behavior. We have a model of an human internal organ, made up of a series of triangle meshes. The are between four and seven sets of meshes combined into an an assembly. During a long ( multiple hours ) automated test, where a surgical instrument is moved through the scene repeatedly ( Made from implicit function sources and also combined into an assembly) , there is an issue - and the best way for me to describe it is that the assemblies " come apart. Each actor in the assembly is moved to a deferent place in the scene, as if perhaps they " exploded ". We have videoed this and there seems to be a screen flash before the happens. > Things keep going, there's no crashes, etc. > > Has anyone else experienced this? Does anyone have an insight as to how to track down the problem? > > Thanks > > Rick > > Sent from my iPad > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From rickfrank at me.com Sun Apr 24 14:16:44 2016 From: rickfrank at me.com (Richard Frank) Date: Sun, 24 Apr 2016 14:16:44 -0400 Subject: [vtkusers] Assemblies "coming apart " during long test runs.... In-Reply-To: References: <3AD159AF-2ADE-4C21-AF64-49FDE7E30AC4@me.com> <849F6681-2108-4BC7-9930-6C5A5CAA3AA7@me.com> Message-ID: So far it happens on all three of our machines ( Clevo "laptop" with quadro k5000m , I power computer with geoforce 9xx and another workstation with quadro m5000) , but it does seem low level as per flash/ recovery as you say... Anyone from Nvidia on this list who might be able to assist? :-) Thanks Rick Sent from my iPad > On Apr 24, 2016, at 2:06 PM, Andras Lasso wrote: > > One computer where it happens quite frequently has NVidia GeForce GTX 660, uses Windows 8.1. The symptoms indicate video card/driver (maybe lower level - motherboard, BIOS, etc) issues, which are time-consuming to diagnose, so we just decided to not use this computer for any serious work. > > Andras > > -----Original Message----- > From: Richard Frank [mailto:rickfrank at me.com] > Sent: April 24, 2016 1:51 PM > To: Andras Lasso > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] Assemblies "coming apart " during long test runs.... > > Hmm. We're using top of the line quadro m 5000 cards ( and some geoforce 9xx cards ). Have you done any other tests ( OpenGL logging etc ) to get further information? > > Are you on Windows? > > Thanks > > Sent from my iPad > >> On Apr 24, 2016, at 1:45 PM, Andras Lasso wrote: >> >> Yes, we've experienced this, too. Screen flashes and then actors don't move anymore on screen and colors cannot be changed (we change actor properties in VTK but nothing changes on screen). Actors that we add after the flash behave normally. We run the same software on many computers in our lab but the problem only occurs on a few computers and never on others (even when running continuously for several days). >> >> We suspect it's a video card hardware/driver issue. The "flash" is probably a crash&recovery of the video card driver. >> >> Andras >> >> -----Original Message----- >> From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank >> Sent: April 24, 2016 1:25 PM >> To: vtkusers at vtk.org >> Subject: [vtkusers] Assemblies "coming apart " during long test runs.... >> >> We are seeing a strange behavior. We have a model of an human internal organ, made up of a series of triangle meshes. The are between four and seven sets of meshes combined into an an assembly. During a long ( multiple hours ) automated test, where a surgical instrument is moved through the scene repeatedly ( Made from implicit function sources and also combined into an assembly) , there is an issue - and the best way for me to describe it is that the assemblies " come apart. Each actor in the assembly is moved to a deferent place in the scene, as if perhaps they " exploded ". We have videoed this and there seems to be a screen flash before the happens. >> Things keep going, there's no crashes, etc. >> >> Has anyone else experienced this? Does anyone have an insight as to how to track down the problem? >> >> Thanks >> >> Rick >> >> Sent from my iPad >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers From Siqueiros.jorge at outlook.com Sun Apr 24 21:37:41 2016 From: Siqueiros.jorge at outlook.com (Georges) Date: Sun, 24 Apr 2016 18:37:41 -0700 (MST) Subject: [vtkusers] How to obtain the coordinates (double and not int type) mouse picking over an image? In-Reply-To: References: <1461351489614-5737850.post@n5.nabble.com> Message-ID: <1461548261219-5737863.post@n5.nabble.com> *Thank you very much for your answer Dean.* I am making the suggestion you made me but I have a doubt. In the sections ............. ............. picker-> AddPickList (*ImageActor*); ............. ............. if (*ImageActor* == pickedProp) ............. ............. How could i get the *ImageActor* if this is declared in another class? I appreciate your help. Regards Georges -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-obtain-the-coordinates-double-and-not-int-type-mouse-picking-over-an-image-tp5737850p5737863.html Sent from the VTK - Users mailing list archive at Nabble.com. From jeff.baumes at kitware.com Mon Apr 25 07:57:03 2016 From: jeff.baumes at kitware.com (Jeff Baumes) Date: Mon, 25 Apr 2016 11:57:03 +0000 Subject: [vtkusers] vtkChartXY picking In-Reply-To: References: <1460726004464-5737711.post@n5.nabble.com> Message-ID: If you've added one plot to the chart, you can get the list of selected indices with: vtkIdTypeArray *idarray = chart->GetPlot(0)->GetSelection(); I am not sure the order of firing LEFT_BUTTON and updating the plot's selection, hopefully the selection is available by the time that callback is fired. Jeff On Fri, Apr 22, 2016 at 10:37 AM Richard Brown wrote: > I just advanced from where I was and I know have: > > void pointSelected(vtkObject* obj, unsigned long,void*, void*) > > { > > std::cout << "\nPoint selected.\n"; > > > // Print info of selected point > > } > > > int main() > > { > > chart->SetActionToButton(vtkChartXY::SELECT, vtkContextMouseEvent::LEFT_BUTTON); > > > vtkSmartPointer keypressCallback = vtkSmartPointer::New(); > > keypressCallback->SetCallback ( pointSelected ); > > chart->AddObserver(vtkContextMouseEvent::LEFT_BUTTON, keypressCallback); > > } > > > And this works as expected; every time I left-click on a point, I cout > ?Point selected?. > > My initial question is still stands: how do I get information on the > selected point? > > When plotting my points, they were part of a table. Could I get the table > in question (there are multiple plots, so multiple tables), and then the > index of the data point within the table? > > Regards, > Richard > > On 22 Apr 2016, at 16:05, Richard Brown > wrote: > > Hi Jeff, > > So if I want my left button to select the point underneath it (I think the > right button by default creates a box and selects points within that box > but then does nothing with them?) and then, for example, print the > information pertaining to that point, how would I go about that? > > SetButtonToAction(vtkChartXY::SELECT, vtkContextMouseEvent::LEFT_MOUSE); > > Do I then set up an observer for vtkChartXY::SELECT? > > And from there, when I?m in the callback function, how do I get the > information of the selected point? > > Thanks in advance, > Richard > > > On 18 Apr 2016, at 13:54, Jeff Baumes wrote: > > I think you want SetActionToButton() on vtkChart to change mouse bindings. > You should be able to listen for a selection event once that is set up. > > > http://www.vtk.org/doc/nightly/html/classvtkChart.html#ac4162187f5f3ad97f0163a079e06f13d > > On Fri, Apr 15, 2016 at 9:13 AM mbcx9rb9 > wrote: > >> Hi all, >> >> I'd like to create a custom interactor for vtkChartXY (inherited from >> vtkContextInteractorStyle), but I can't figure out how to select single >> points with the left click of the mouse. Once I manage to that, I would >> need >> to return the index of the selected point. >> >> This seems very straightforward to me, but I haven't seen any concrete >> examples. >> >> Any pointers would be greatly appreciated. >> >> Regards, >> Richard >> >> >> >> >> >> -- >> View this message in context: >> http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp5737711.html >> Sent from the VTK - Users mailing list archive at Nabble.com >> . >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Mon Apr 25 10:01:00 2016 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 25 Apr 2016 10:01:00 -0400 Subject: [vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper In-Reply-To: <1461097665105-5737793.post@n5.nabble.com> References: <1460742057180-5737734.post@n5.nabble.com> <1461097665105-5737793.post@n5.nabble.com> Message-ID: Well the good news it that it means your system works fine with opengl and VTK. The bad news is that is sounds like your application is hitting some odd condition that is causing the issue. I have not worked with java in a while but from what I have heard some common issues boil down to something in a different thread causing calls to VTK's OpenGL. Ken On Tue, Apr 19, 2016 at 4:27 PM, dei wrote: > After some headaches, I think I have VTK built with testing. I switched on > BUILD_TESTING and BUILD_ALL_MODULES_FOR_TESTS and, after some headaches, > got > it configured and generated in cmake-gui and built in Visual Studio. I > don't > have any VBOPLY tests, however. > > I do have vtkRenderingOpenGL2CxxTests.exe and it passes (along with 1000 > other tests). vtkRenderingOpenGL2CxxTests project has a > TestVBOPLYMapper.cxx file in it. Is this the test you were recommending I > run? I'm building and running in Visual Studio 2012 on Windows 7 > Professional-x64. If so, it passes when run by the RUN_TESTS project. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734p5737793.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.ei at novodynamics.com Mon Apr 25 17:12:18 2016 From: david.ei at novodynamics.com (dei) Date: Mon, 25 Apr 2016 14:12:18 -0700 (MST) Subject: [vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper In-Reply-To: References: <1460742057180-5737734.post@n5.nabble.com> <1461097665105-5737793.post@n5.nabble.com> Message-ID: <1461618738247-5737869.post@n5.nabble.com> After fixing several other things, I've solved all the crash issues except one. There appears to be a short (< 1 second) lag between the time my parent JPanel become visible and the time its child vtkPanel is ready to accept mouse events (and consequent calls to Render()). I'm trying to suppress mouse events until the vtkPanel is ready but I have not been able to find a way to reliably detect that the vtkPanel is done initializing. The crash occurs in vtkWin32OpenGLRenderWindow::SetupPixelFormatPaletteAndContext() with the error: "failed to get valid pixel format." *How do I tell if vtkWin32OpenGLRenderWindow is completely initialized?* I'd hate to have use a delay timer kludge. BTW, all my java accesses to the vtk are on the AWT-EventQueue-0 (the GUI thread). -- View this message in context: http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734p5737869.html Sent from the VTK - Users mailing list archive at Nabble.com. From sebastien.jourdain at kitware.com Mon Apr 25 17:58:47 2016 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 25 Apr 2016 15:58:47 -0600 Subject: [vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper In-Reply-To: <1461618738247-5737869.post@n5.nabble.com> References: <1460742057180-5737734.post@n5.nabble.com> <1461097665105-5737793.post@n5.nabble.com> <1461618738247-5737869.post@n5.nabble.com> Message-ID: Did you try to guard your mouse call by the following method from vtkPanel? public boolean isWindowSet() { return (this.windowset == 1); } On Mon, Apr 25, 2016 at 3:12 PM, dei wrote: > After fixing several other things, I've solved all the crash issues except > one. There appears to be a short (< 1 second) lag between the time my > parent > JPanel become visible and the time its child vtkPanel is ready to accept > mouse events (and consequent calls to Render()). I'm trying to suppress > mouse events until the vtkPanel is ready but I have not been able to find a > way to reliably detect that the vtkPanel is done initializing. > > The crash occurs in > vtkWin32OpenGLRenderWindow::SetupPixelFormatPaletteAndContext() with the > error: "failed to get valid pixel format." *How do I tell if > vtkWin32OpenGLRenderWindow is completely initialized?* I'd hate to have use > a delay timer kludge. > > BTW, all my java accesses to the vtk are on the AWT-EventQueue-0 (the GUI > thread). > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734p5737869.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zmanvortex at gmail.com Mon Apr 25 19:18:49 2016 From: zmanvortex at gmail.com (Donny Zimmerman) Date: Mon, 25 Apr 2016 18:18:49 -0500 Subject: [vtkusers] Assemblies "coming apart " during long test runs.... In-Reply-To: References: <3AD159AF-2ADE-4C21-AF64-49FDE7E30AC4@me.com> <849F6681-2108-4BC7-9930-6C5A5CAA3AA7@me.com> Message-ID: <53150C17-E740-4E72-9F6C-D12EEFAFC769@gmail.com> I think it might be related to the following thread: http://vtk.1045678.n5.nabble.com/Moving-an-actor-after-about-1-5-hours-td5737049.html If I remember correctly there is a fix suggested at the end of the thread. Sent from my iPhone > On Apr 24, 2016, at 1:16 PM, Richard Frank wrote: > > So far it happens on all three of our machines ( Clevo "laptop" with quadro k5000m , I power computer with geoforce 9xx and another workstation with quadro m5000) , but it does seem low level as per flash/ recovery as you say... > > Anyone from Nvidia on this list who might be able to assist? :-) > > Thanks > > Rick > > Sent from my iPad > >> On Apr 24, 2016, at 2:06 PM, Andras Lasso wrote: >> >> One computer where it happens quite frequently has NVidia GeForce GTX 660, uses Windows 8.1. The symptoms indicate video card/driver (maybe lower level - motherboard, BIOS, etc) issues, which are time-consuming to diagnose, so we just decided to not use this computer for any serious work. >> >> Andras >> >> -----Original Message----- >> From: Richard Frank [mailto:rickfrank at me.com] >> Sent: April 24, 2016 1:51 PM >> To: Andras Lasso >> Cc: vtkusers at vtk.org >> Subject: Re: [vtkusers] Assemblies "coming apart " during long test runs.... >> >> Hmm. We're using top of the line quadro m 5000 cards ( and some geoforce 9xx cards ). Have you done any other tests ( OpenGL logging etc ) to get further information? >> >> Are you on Windows? >> >> Thanks >> >> Sent from my iPad >> >>> On Apr 24, 2016, at 1:45 PM, Andras Lasso wrote: >>> >>> Yes, we've experienced this, too. Screen flashes and then actors don't move anymore on screen and colors cannot be changed (we change actor properties in VTK but nothing changes on screen). Actors that we add after the flash behave normally. We run the same software on many computers in our lab but the problem only occurs on a few computers and never on others (even when running continuously for several days). >>> >>> We suspect it's a video card hardware/driver issue. The "flash" is probably a crash&recovery of the video card driver. >>> >>> Andras >>> >>> -----Original Message----- >>> From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank >>> Sent: April 24, 2016 1:25 PM >>> To: vtkusers at vtk.org >>> Subject: [vtkusers] Assemblies "coming apart " during long test runs.... >>> >>> We are seeing a strange behavior. We have a model of an human internal organ, made up of a series of triangle meshes. The are between four and seven sets of meshes combined into an an assembly. During a long ( multiple hours ) automated test, where a surgical instrument is moved through the scene repeatedly ( Made from implicit function sources and also combined into an assembly) , there is an issue - and the best way for me to describe it is that the assemblies " come apart. Each actor in the assembly is moved to a deferent place in the scene, as if perhaps they " exploded ". We have videoed this and there seems to be a screen flash before the happens. >>> Things keep going, there's no crashes, etc. >>> >>> Has anyone else experienced this? Does anyone have an insight as to how to track down the problem? >>> >>> Thanks >>> >>> Rick >>> >>> Sent from my iPad >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Mon Apr 25 20:53:24 2016 From: lasso at queensu.ca (Andras Lasso) Date: Tue, 26 Apr 2016 00:53:24 +0000 Subject: [vtkusers] Assemblies "coming apart " during long test runs.... In-Reply-To: <53150C17-E740-4E72-9F6C-D12EEFAFC769@gmail.com> References: <3AD159AF-2ADE-4C21-AF64-49FDE7E30AC4@me.com> <849F6681-2108-4BC7-9930-6C5A5CAA3AA7@me.com> <53150C17-E740-4E72-9F6C-D12EEFAFC769@gmail.com> Message-ID: Donny, that thread was about the same issue, reported by Richard a couple of weeks ago. I don?t think there was a fix. Richard, you may try to turn off ?Threaded optimization? in NVidia settings. It sometimes fixes crashes in the driver. Andras From: Donny Zimmerman [mailto:zmanvortex at gmail.com] Sent: April 25, 2016 7:19 PM To: Richard Frank Cc: Andras Lasso ; vtkusers at vtk.org Subject: Re: [vtkusers] Assemblies "coming apart " during long test runs.... I think it might be related to the following thread: http://vtk.1045678.n5.nabble.com/Moving-an-actor-after-about-1-5-hours-td5737049.html If I remember correctly there is a fix suggested at the end of the thread. Sent from my iPhone On Apr 24, 2016, at 1:16 PM, Richard Frank > wrote: So far it happens on all three of our machines ( Clevo "laptop" with quadro k5000m , I power computer with geoforce 9xx and another workstation with quadro m5000) , but it does seem low level as per flash/ recovery as you say... Anyone from Nvidia on this list who might be able to assist? :-) Thanks Rick Sent from my iPad On Apr 24, 2016, at 2:06 PM, Andras Lasso > wrote: One computer where it happens quite frequently has NVidia GeForce GTX 660, uses Windows 8.1. The symptoms indicate video card/driver (maybe lower level - motherboard, BIOS, etc) issues, which are time-consuming to diagnose, so we just decided to not use this computer for any serious work. Andras -----Original Message----- From: Richard Frank [mailto:rickfrank at me.com] Sent: April 24, 2016 1:51 PM To: Andras Lasso > Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Assemblies "coming apart " during long test runs.... Hmm. We're using top of the line quadro m 5000 cards ( and some geoforce 9xx cards ). Have you done any other tests ( OpenGL logging etc ) to get further information? Are you on Windows? Thanks Sent from my iPad On Apr 24, 2016, at 1:45 PM, Andras Lasso > wrote: Yes, we've experienced this, too. Screen flashes and then actors don't move anymore on screen and colors cannot be changed (we change actor properties in VTK but nothing changes on screen). Actors that we add after the flash behave normally. We run the same software on many computers in our lab but the problem only occurs on a few computers and never on others (even when running continuously for several days). We suspect it's a video card hardware/driver issue. The "flash" is probably a crash&recovery of the video card driver. Andras -----Original Message----- From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank Sent: April 24, 2016 1:25 PM To: vtkusers at vtk.org Subject: [vtkusers] Assemblies "coming apart " during long test runs.... We are seeing a strange behavior. We have a model of an human internal organ, made up of a series of triangle meshes. The are between four and seven sets of meshes combined into an an assembly. During a long ( multiple hours ) automated test, where a surgical instrument is moved through the scene repeatedly ( Made from implicit function sources and also combined into an assembly) , there is an issue - and the best way for me to describe it is that the assemblies " come apart. Each actor in the assembly is moved to a deferent place in the scene, as if perhaps they " exploded ". We have videoed this and there seems to be a screen flash before the happens. Things keep going, there's no crashes, etc. Has anyone else experienced this? Does anyone have an insight as to how to track down the problem? Thanks Rick Sent from my iPad _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From zmanvortex at gmail.com Mon Apr 25 21:22:09 2016 From: zmanvortex at gmail.com (Donny Zimmerman) Date: Mon, 25 Apr 2016 20:22:09 -0500 Subject: [vtkusers] Assemblies "coming apart " during long test runs.... In-Reply-To: References: <3AD159AF-2ADE-4C21-AF64-49FDE7E30AC4@me.com> <849F6681-2108-4BC7-9930-6C5A5CAA3AA7@me.com> <53150C17-E740-4E72-9F6C-D12EEFAFC769@gmail.com> Message-ID: Yes, you are correct. Sorry about that. Sent from my iPhone > On Apr 25, 2016, at 7:53 PM, Andras Lasso wrote: > > Donny, that thread was about the same issue, reported by Richard a couple of weeks ago. I don?t think there was a fix. > > Richard, you may try to turn off ?Threaded optimization? in NVidia settings. It sometimes fixes crashes in the driver. > > Andras > > From: Donny Zimmerman [mailto:zmanvortex at gmail.com] > Sent: April 25, 2016 7:19 PM > To: Richard Frank > Cc: Andras Lasso ; vtkusers at vtk.org > Subject: Re: [vtkusers] Assemblies "coming apart " during long test runs.... > > I think it might be related to the following thread: > > http://vtk.1045678.n5.nabble.com/Moving-an-actor-after-about-1-5-hours-td5737049.html > > If I remember correctly there is a fix suggested at the end of the thread. > > Sent from my iPhone > > On Apr 24, 2016, at 1:16 PM, Richard Frank wrote: > > So far it happens on all three of our machines ( Clevo "laptop" with quadro k5000m , I power computer with geoforce 9xx and another workstation with quadro m5000) , but it does seem low level as per flash/ recovery as you say... > > Anyone from Nvidia on this list who might be able to assist? :-) > > Thanks > > Rick > > Sent from my iPad > > > On Apr 24, 2016, at 2:06 PM, Andras Lasso wrote: > > One computer where it happens quite frequently has NVidia GeForce GTX 660, uses Windows 8.1. The symptoms indicate video card/driver (maybe lower level - motherboard, BIOS, etc) issues, which are time-consuming to diagnose, so we just decided to not use this computer for any serious work. > > Andras > > -----Original Message----- > From: Richard Frank [mailto:rickfrank at me.com] > Sent: April 24, 2016 1:51 PM > To: Andras Lasso > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] Assemblies "coming apart " during long test runs.... > > Hmm. We're using top of the line quadro m 5000 cards ( and some geoforce 9xx cards ). Have you done any other tests ( OpenGL logging etc ) to get further information? > > Are you on Windows? > > Thanks > > Sent from my iPad > > On Apr 24, 2016, at 1:45 PM, Andras Lasso wrote: > > Yes, we've experienced this, too. Screen flashes and then actors don't move anymore on screen and colors cannot be changed (we change actor properties in VTK but nothing changes on screen). Actors that we add after the flash behave normally. We run the same software on many computers in our lab but the problem only occurs on a few computers and never on others (even when running continuously for several days). > > We suspect it's a video card hardware/driver issue. The "flash" is probably a crash&recovery of the video card driver. > > Andras > > -----Original Message----- > From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank > Sent: April 24, 2016 1:25 PM > To: vtkusers at vtk.org > Subject: [vtkusers] Assemblies "coming apart " during long test runs.... > > We are seeing a strange behavior. We have a model of an human internal organ, made up of a series of triangle meshes. The are between four and seven sets of meshes combined into an an assembly. During a long ( multiple hours ) automated test, where a surgical instrument is moved through the scene repeatedly ( Made from implicit function sources and also combined into an assembly) , there is an issue - and the best way for me to describe it is that the assemblies " come apart. Each actor in the assembly is moved to a deferent place in the scene, as if perhaps they " exploded ". We have videoed this and there seems to be a screen flash before the happens. > Things keep going, there's no crashes, etc. > > Has anyone else experienced this? Does anyone have an insight as to how to track down the problem? > > Thanks > > Rick > > Sent from my iPad > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Mon Apr 25 23:00:05 2016 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 26 Apr 2016 03:00:05 +0000 Subject: [vtkusers] Building Activiz 7.0 Message-ID: Has anyone been able to build ActiViz 7.0? I was able to build ActiViz up to 6.3 version but this last 7.0 version is throwing 59 errors on my build attempt. I had to manually patch the core ActiViz Files to build 6.2 and 6.3 successfully but this last one I'm driving a bit crazy trying to patch... Some of the errors I get: Error 23 fatal error C1083: Cannot open include file: 'vtksys/ios/sstream': No such file or directory c:\ActiViz\activizdotnet_7.0_buildx64\export-layer\vtkObjectEL.cxx 446 Error 24 error CS0246: The type or namespace name 'vtkRecti' could not be found (are you missing a using directive or an assembly reference?) c:\ActiViz\activizdotnet_7.0_buildx64\csharp\vtkContextArea.cs 327 Error 37 error CS0246: The type or namespace name 'vtkTextureObject' could not be found (are you missing a using directive or an assembly reference?) c:\ActiViz\activizdotnet_7.0_buildx64\csharp\vtkOpenGLRenderWindow.cs 77 Error 39 error CS0246: The type or namespace name 'vtkOpenGLShaderCache' could not be found (are you missing a using directive or an assembly reference?) c:\ActiViz\activizdotnet_7.0_buildx64\csharp\vtkOpenGLRenderWindow.cs 413 Error 42 error CS0246: The type or namespace name 'vtkOpenGLVertexArrayObject' could not be found (are you missing a using directive or an assembly reference?) c:\ActiViz\activizdotnet_7.0_buildx64\csharp\vtkOpenGLRenderUtilities.cs 146 Thanks for your help Matias. -- Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Apr 25 23:24:34 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 25 Apr 2016 21:24:34 -0600 Subject: [vtkusers] Building Activiz 7.0 In-Reply-To: References: Message-ID: Hi Matias, For the sstream header, change the code to just use "#include ". Also change includes like "#include " to "include " wherever they occur. And this is just a guess (I've got experience in wrapping, but not ActiViz), whenever it complains "type name could not be found", add the problem class to MummySettings.xml.in with wrappable="false". - David On Mon, Apr 25, 2016 at 9:00 PM, Matias Montroull wrote: > Has anyone been able to build ActiViz 7.0? > > I was able to build ActiViz up to 6.3 version but this last 7.0 version is > throwing 59 errors on my build attempt. > I had to manually patch the core ActiViz Files to build 6.2 and 6.3 > successfully but this last one I'm driving a bit crazy trying to patch... > > Some of the errors I get: > > Error 23 fatal error C1083: Cannot open include file: > 'vtksys/ios/sstream': No such file or directory > c:\ActiViz\activizdotnet_7.0_buildx64\export-layer\vtkObjectEL.cxx 446 > > Error 24 error CS0246: The type or namespace name 'vtkRecti' could not be > found (are you missing a using directive or an assembly reference?) > c:\ActiViz\activizdotnet_7.0_buildx64\csharp\vtkContextArea.cs 327 > > Error 37 error CS0246: The type or namespace name 'vtkTextureObject' > could not be found (are you missing a using directive or an assembly > reference?) > c:\ActiViz\activizdotnet_7.0_buildx64\csharp\vtkOpenGLRenderWindow.cs 77 > > Error 39 error CS0246: The type or namespace name 'vtkOpenGLShaderCache' > could not be found (are you missing a using directive or an assembly > reference?) > c:\ActiViz\activizdotnet_7.0_buildx64\csharp\vtkOpenGLRenderWindow.cs 413 > > Error 42 error CS0246: The type or namespace name > 'vtkOpenGLVertexArrayObject' could not be found (are you missing a using > directive or an assembly reference?) > c:\ActiViz\activizdotnet_7.0_buildx64\csharp\vtkOpenGLRenderUtilities.cs > 146 > > > Thanks for your help > > Matias. > -- > Matias > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jaimefbc at gmail.com Tue Apr 26 10:34:10 2016 From: jaimefbc at gmail.com (Jaime Campos) Date: Tue, 26 Apr 2016 15:34:10 +0100 Subject: [vtkusers] Requirements for multiple volumes in one render window In-Reply-To: References: <1456418666540-5736853.post@n5.nabble.com> Message-ID: I'm also very interested in this issue/feature, anyone care to answer us ? Will this be available in a near future ? Thank you Jaime 2016-04-20 14:08 GMT+01:00 Elvis Stansvik : > 2016-02-25 20:03 GMT+01:00 Elvis Stansvik : > >> 2016-02-25 18:04 GMT+01:00 Aashish Chaudhary < >> aashish.chaudhary at kitware.com>: >> >>> On Thu, Feb 25, 2016 at 11:44 AM, longbowzhang >>> wrote: >>> > Hi, >>> > >>> > 1 vtkRenderer is like a container, so you can put several volumes (as >>> > vtkVolume) into it. No problem. >>> >>> Yes, >>> >> >> Alright, good to know. >> >> >>> >>> > >>> > 2 I think (not 100% sure) it would be a problem if those volumes are >>> > intersecting with each other. You can test it easily. >>> > Just put two vtkVolumes into the scene, and then check the results. >>> >>> Intersecting volume would a be problem but having multiple volume >>> would be fine. You will have to sort them (tell VTK to sort them). >>> >> >> With sort them, you mean set the z order such that they are rendered on >> top of each other? >> > > Zhang, do you think you could clarify what you meant by "sort them" above, > and what (visual) consequences doing so would have for the rendering of the > volumes, assuming the volumes intersect in 3D space. > > Elvis > > >> This would be a real problem for us. We are doing x-ray tomography of >> drill cores. The core breaks into pieces during drilling, so think of each >> volume I'm speaking of as one of the pieces in the attached photo. Our >> software will do some algorithmic "puzzling" to align the volumes (pieces) >> after scanning, but we need to have an interactive way for the user to >> manually align the pieces as well, for the cases where automatic alignment >> fails (which it will in some hard/hopeless cases). >> >> If VTK can't properly render intersecting volumes, then I'm afraid it >> will be really hard to make such a tool for manual alignment intuitive to >> use. The user must be able to see the pieces while rotating them when they >> are close together, which invariably means they will intersect now and then >> as he/she tries to fit them together. >> >> Is this limitation of VTK present also in 7.0? I've been thinking of >> compiling a custom VTK 7.0, since I saw it has many improvements to volume >> rendering, and if it can do composite rendering of intersecting volumes, >> then we'll definitely do that. >> Elvis >> >> >>> >>> - Aashish >>> >>> > >>> > >>> > >>> > >>> > -- >>> > View this message in context: >>> http://vtk.1045678.n5.nabble.com/Requirements-for-multiple-volumes-in-one-render-window-tp5736847p5736853.html >>> > Sent from the VTK - Users mailing list archive at Nabble.com. >>> > _______________________________________________ >>> > Powered by www.kitware.com >>> > >>> > Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> > >>> > Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> > >>> > Search the list archives at: http://markmail.org/search/?q=vtkusers >>> > >>> > Follow this link to subscribe/unsubscribe: >>> > http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >>> >>> -- >>> | Aashish Chaudhary >>> | Technical Leader >>> | Kitware Inc. >>> | http://www.kitware.com/company/team/chaudhary.html >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From JoseI_g at outlook.com Tue Apr 26 10:59:11 2016 From: JoseI_g at outlook.com (Jose Gil) Date: Tue, 26 Apr 2016 14:59:11 +0000 Subject: [vtkusers] VTK Python Support with Biomechanical Tool Kit(BTK) Library Message-ID: Hi everyone! I am working on a project in which i need to use de VTK libraries(used by Mokka) that come with the BTK (Biomechanical Tool Kit) Library, I tried to make a wrapped of the source code with no success. If anyone knows how to access them from python please tell me. This is the VTK Library (in C++)that i'm trying to use: http://b-tk.googlecode.com/svn/doc/API/0.1/group___b_t_k_v_t_k.html Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.ei at novodynamics.com Tue Apr 26 14:28:50 2016 From: david.ei at novodynamics.com (dei) Date: Tue, 26 Apr 2016 11:28:50 -0700 (MST) Subject: [vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper In-Reply-To: References: <1460742057180-5737734.post@n5.nabble.com> <1461097665105-5737793.post@n5.nabble.com> <1461618738247-5737869.post@n5.nabble.com> Message-ID: <1461695330984-5737886.post@n5.nabble.com> That works! It should be added to vtkPanel.mouseDragged(). I'm also marshalling vtkPanel.Render() onto the GUI thread, but I'm not sure that's required to keep the vtk from crashing - I'll test it. Should I push the change into the git source tree? -- View this message in context: http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734p5737886.html Sent from the VTK - Users mailing list archive at Nabble.com. From sebastien.jourdain at kitware.com Tue Apr 26 15:05:08 2016 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Tue, 26 Apr 2016 13:05:08 -0600 Subject: [vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper In-Reply-To: <1461695330984-5737886.post@n5.nabble.com> References: <1460742057180-5737734.post@n5.nabble.com> <1461097665105-5737793.post@n5.nabble.com> <1461618738247-5737869.post@n5.nabble.com> <1461695330984-5737886.post@n5.nabble.com> Message-ID: I guess we should. ;-) On Tue, Apr 26, 2016 at 12:28 PM, dei wrote: > That works! It should be added to vtkPanel.mouseDragged(). I'm also > marshalling vtkPanel.Render() onto the GUI thread, but I'm not sure that's > required to keep the vtk from crashing - I'll test it. Should I push the > change into the git source tree? > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734p5737886.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.ei at novodynamics.com Tue Apr 26 15:25:36 2016 From: david.ei at novodynamics.com (dei) Date: Tue, 26 Apr 2016 12:25:36 -0700 (MST) Subject: [vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper In-Reply-To: References: <1460742057180-5737734.post@n5.nabble.com> <1461097665105-5737793.post@n5.nabble.com> <1461618738247-5737869.post@n5.nabble.com> <1461695330984-5737886.post@n5.nabble.com> Message-ID: <1461698736298-5737889.post@n5.nabble.com> Maybe I spoke too soon. I'm getting another crash quite consistently when I set up a vtkPanel/vtkPolyDataMapper/vtkActor/vtkRenderer/vtkPolyData before the parent JPanel is visible (it's on another tab page). When I open the tab page I get a crash more often than not. Of course it doesn't occur in my simple test programs, or apparently with the debug of the vtk dlls. Are there any restrictions on initializing the vtk objects before windowset == 1? -- View this message in context: http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734p5737889.html Sent from the VTK - Users mailing list archive at Nabble.com. From sebastien.jourdain at kitware.com Tue Apr 26 15:48:11 2016 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Tue, 26 Apr 2016 13:48:11 -0600 Subject: [vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper In-Reply-To: <1461698736298-5737889.post@n5.nabble.com> References: <1460742057180-5737734.post@n5.nabble.com> <1461097665105-5737793.post@n5.nabble.com> <1461618738247-5737869.post@n5.nabble.com> <1461695330984-5737886.post@n5.nabble.com> <1461698736298-5737889.post@n5.nabble.com> Message-ID: It is pretty strange as I recall being able to use a vtkPanel without a parent several years ago. Obviously plenty has changed but it was not an issue before... You may want to delay the registration of the actors into the renderer until that one is visible (maybe). Otherwise VTK can be used without rendering as well even across many thread if rendering is not involved... On Tue, Apr 26, 2016 at 1:25 PM, dei wrote: > Maybe I spoke too soon. I'm getting another crash quite consistently when I > set up a vtkPanel/vtkPolyDataMapper/vtkActor/vtkRenderer/vtkPolyData before > the parent JPanel is visible (it's on another tab page). When I open the > tab > page I get a crash more often than not. Of course it doesn't occur in my > simple test programs, or apparently with the debug of the vtk dlls. Are > there any restrictions on initializing the vtk objects before windowset == > 1? > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734p5737889.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.sutton at padtinc.com Tue Apr 26 17:33:19 2016 From: matt.sutton at padtinc.com (Matt Sutton) Date: Tue, 26 Apr 2016 21:33:19 +0000 Subject: [vtkusers] Multiple vtkPropAssemblies referencing the same Actor Message-ID: <972682737fb64927bc3fdef5f0ee6e44@ex0.padtinc.com> Hi Folks, I'm looking to use a series of vtkPropAssemblies to manage the graphics associated with something like a BRep data structure. For example, given a face in the BRep, it will be bounded by a series of edges forming a loop. I would like to put all of these edges into a vtkPropAssembly to control their visibility and properties as a group. However, these edges will also be shared by an adjacent face. The documentation makes it clear that vtkPropAssemblies can include an actor that is also included in another Assembly, so long as there are no loops. My question is, what state will an actor that is shared by two vtkPropAssemblies take if those assembly objects themselves have different states? Is it simply the last state rendered? Specifically for something like visibility, I would like an edge to be visible if any (either) of its adjacent faces are visible. So, more precisely, would an actor be visible if *any* of its parent assemblies are visible, or only if the last assembly rendered that references that actor is visible? Obviously, I be testing this shortly, but I thought I'd ask ahead of time if someone already knew the answer. Regards, Matt Sutton Senior Engineer PADT, Inc. www.PADTINC.com 480.813.4884 x106 matt.sutton at padtinc.com Simulation - Product Development - Rapid Prototyping CONFIDENTIALITY NOTICE: This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Unless you are the intended recipient, you are hereby notified that copying, forwarding, printing or otherwise disseminating the information contained in or attached to this e-mail is strictly prohibited. If you are not the intended recipient, please notify the sender by telephone, and immediately and permanently delete and destroy all copies and printouts of this e-mail message and/or attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zionman.hsu at gmail.com Wed Apr 27 04:19:44 2016 From: zionman.hsu at gmail.com (=?UTF-8?B?5b6Q5b+XIOiPrw==?=) Date: Wed, 27 Apr 2016 16:19:44 +0800 Subject: [vtkusers] Error C2660: 'vtkObject::operatpr new': do not take 3 patameters In-Reply-To: References: Message-ID: Hi, I had a class derived from vtkInteractorStyleRubberBandPick defined as following: class myAreaSelector : public vtkInteractorStyleRubberBandPick { public: vtkTypeMacro(myAreaSelector, vtkInteractorStyleRubberBandPick); static myAreaSelector *New(); ..... }; And implemented this new function with: vtkStandardNewMacro(myAreaSelector); Which leads to error C2660 : 'vtkObject::operator new' not take 3 parameters Is there any wrong doings with this implementation? Any suggestion to overcoming this error message is welcome. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hinesh_88 at hotmail.co.uk Wed Apr 27 07:24:53 2016 From: hinesh_88 at hotmail.co.uk (Hpatel) Date: Wed, 27 Apr 2016 04:24:53 -0700 (MST) Subject: [vtkusers] vtk 3d volume rendering -.dcm files Message-ID: <1461756293683-5737898.post@n5.nabble.com> Hi all, I am new to vtk. I am currently working on a university project and would be extremely grateful if anyone can provide me with some advice and help. My setup is Pydev installed on eclipse and running vtk version 5.10.1 I have been trying to load in a .dcm file (Ct scans) and use a 3d Volume rendering (ray casting ?isosurface function). I previously tried using the marching cubes algorithm however the output was very ?blocky? and smoothing is not an option. Below is what I have tried, however I keep getting an error. Now I?m not entirely sure what each error means and when I google it I very easily find myself entering an endless maze. In short I want to take a .dcm file and 3d render the file to display a 3d image. import vtk dicompath = raw_input(?Dicom path: ?) reader = vtk.vtkDICOMImageReader() reader.SetDirectoryName(dicompath) reader.Update() t = vtk.vtkImageThreshold() t.SetInputConnection(reader.GetOutputPort()) t.ThresholdByLower(400) t.ReplaceInOn() t.SetInValue(0) t.ReplaceInOn() t.SetOutValue(1) t.Update() func = vtk.vtkVolumeRayCastIsosurfaceFunction() funcmapper = vtk.vtkVolumeRayCastMapper() funcmapper.SetInputConnection(t.GetOutputPort()) funcmapper.SetVolumeRayCastFunction(func) actor = vtk.vtkImageActor() actor.SetMapper(funcmapper) render = vtk.vtkRenderer() render.AddActor(actor) renderWin = vtk.vtkRenderWindow() renderWin.AddRenderer(render) renderWin.setSize(300,300) rwi = vtk.vtkRenderWindowInteractor() rwi.Initialize() rwi.Start() Thanks in advance. -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk-3d-volume-rendering-dcm-files-tp5737898.html Sent from the VTK - Users mailing list archive at Nabble.com. From cory.quammen at kitware.com Wed Apr 27 09:14:58 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 27 Apr 2016 09:14:58 -0400 Subject: [vtkusers] Error C2660: 'vtkObject::operatpr new': do not take 3 patameters In-Reply-To: References: Message-ID: >From the code you have shared, I do not see what would cause the error you report. Could you post the header file and the portion of the code in the implementation file (.cxx) leading up to and including vtkStandardNweMacro? Thanks, Cory On Wed, Apr 27, 2016 at 4:19 AM, ?? ? wrote: > Hi, > I had a class derived from vtkInteractorStyleRubberBandPick defined as > following: > > class myAreaSelector : public vtkInteractorStyleRubberBandPick > { > public: > vtkTypeMacro(myAreaSelector, vtkInteractorStyleRubberBandPick); > static myAreaSelector *New(); > ..... > }; > > And implemented this new function with: > > vtkStandardNewMacro(myAreaSelector); > > Which leads to error C2660 : 'vtkObject::operator new' not take 3 parameters > > Is there any wrong doings with this implementation? > > Any suggestion to overcoming this error message is welcome. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen R&D Engineer Kitware, Inc. From zionman.hsu at gmail.com Wed Apr 27 10:38:40 2016 From: zionman.hsu at gmail.com (=?big5?B?rn2n07XY?=) Date: Wed, 27 Apr 2016 22:38:40 +0800 Subject: [vtkusers] Error C2660: 'vtkObject::operatpr new': do not take 3 patameters In-Reply-To: References: Message-ID: Attached is the header file and implementation file that cause error I test it with VS 2008, and it caused Error C2660, but, test it with VS 2015, It's OK, and no Error message generates. -----Original Message----- From: Cory Quammen [mailto:cory.quammen at kitware.com] Sent: Wednesday, April 27, 2016 9:15 PM To: ?? ? Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Error C2660: 'vtkObject::operatpr new': do not take 3 patameters >From the code you have shared, I do not see what would cause the error you report. Could you post the header file and the portion of the code in the implementation file (.cxx) leading up to and including vtkStandardNweMacro? Thanks, Cory On Wed, Apr 27, 2016 at 4:19 AM, ?? ? wrote: > Hi, > I had a class derived from vtkInteractorStyleRubberBandPick defined as > following: > > class myAreaSelector : public vtkInteractorStyleRubberBandPick > { > public: > vtkTypeMacro(myAreaSelector, vtkInteractorStyleRubberBandPick); > static myAreaSelector *New(); > ..... > }; > > And implemented this new function with: > > vtkStandardNewMacro(myAreaSelector); > > Which leads to error C2660 : 'vtkObject::operator new' not take 3 parameters > > Is there any wrong doings with this implementation? > > Any suggestion to overcoming this error message is welcome. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: myAreaSelector.h URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: myAreaSelector.cpp URL: From jan.hirsch at st.ovgu.de Wed Apr 27 11:03:22 2016 From: jan.hirsch at st.ovgu.de (jhirsch) Date: Wed, 27 Apr 2016 08:03:22 -0700 (MST) Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: Message-ID: <1461769402974-5737901.post@n5.nabble.com> If you have the correct normals for each point, then you may add this classes to your project: http://www.vtkjournal.org/browse/publication/713 Maybe this proposed VTK filter will get you the needed results. -- View this message in context: http://vtk.1045678.n5.nabble.com/Triangulate-surface-points-tp5737226p5737901.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.ei at novodynamics.com Wed Apr 27 11:15:29 2016 From: david.ei at novodynamics.com (dei) Date: Wed, 27 Apr 2016 08:15:29 -0700 (MST) Subject: [vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper In-Reply-To: References: <1460742057180-5737734.post@n5.nabble.com> <1461097665105-5737793.post@n5.nabble.com> <1461618738247-5737869.post@n5.nabble.com> <1461695330984-5737886.post@n5.nabble.com> <1461698736298-5737889.post@n5.nabble.com> Message-ID: <1461770129232-5737902.post@n5.nabble.com> This feels like a race condition between the vtk initialization of OpenGL and the first vtkRender() call. Is there a way to test for OpenGL initialized? I could block vtkRender() calls till it's ready to go. vtk's usage of OpenGL changed a lot in the last 2 years, right? -- View this message in context: http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734p5737902.html Sent from the VTK - Users mailing list archive at Nabble.com. From sebastien.jourdain at kitware.com Wed Apr 27 11:26:05 2016 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 27 Apr 2016 09:26:05 -0600 Subject: [vtkusers] Crash in vtkShaderProgram/vtkOpenGLPolyDataMapper In-Reply-To: <1461770129232-5737902.post@n5.nabble.com> References: <1460742057180-5737734.post@n5.nabble.com> <1461097665105-5737793.post@n5.nabble.com> <1461618738247-5737869.post@n5.nabble.com> <1461695330984-5737886.post@n5.nabble.com> <1461698736298-5737889.post@n5.nabble.com> <1461770129232-5737902.post@n5.nabble.com> Message-ID: There is only one change on the OpenGL backend but it is a huge one. So definitely it is more than likely the case... Ken any thoughts on that initialization process/check? Otherwise, you can always build your VTK with the OpenGL1 backend and see if your problem goes away. That could also help us narrow down the source of the problem. Thanks, Seb On Wed, Apr 27, 2016 at 9:15 AM, dei wrote: > This feels like a race condition between the vtk initialization of OpenGL > and > the first vtkRender() call. Is there a way to test for OpenGL initialized? > I > could block vtkRender() calls till it's ready to go. vtk's usage of OpenGL > changed a lot in the last 2 years, right? > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Crash-in-vtkShaderProgram-vtkOpenGLPolyDataMapper-tp5737734p5737902.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcplatt at dsl.pipex.com Wed Apr 27 12:00:20 2016 From: jcplatt at dsl.pipex.com (John Platt) Date: Wed, 27 Apr 2016 17:00:20 +0100 Subject: [vtkusers] Error C2660: 'vtkObject::operatpr new': do not take 3 patameters In-Reply-To: References: Message-ID: Hi, The files compile OK on my VS2008 after removing the symbol VTKINTERACTIONSTYLE_EXPORT (not defined in my project). Sorry I can't be more helpful. John. On 27/04/2016 15:38, ??? wrote: > Attached is the header file and implementation file that cause error > I test it with VS 2008, and it caused Error C2660, but, test it with VS > 2015, It's OK, and no Error message generates. > > -----Original Message----- > From: Cory Quammen [mailto:cory.quammen at kitware.com] > Sent: Wednesday, April 27, 2016 9:15 PM > To: ?? ? > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] Error C2660: 'vtkObject::operatpr new': do not take > 3 patameters > > >From the code you have shared, I do not see what would cause the error > you report. > > Could you post the header file and the portion of the code in the > implementation file (.cxx) leading up to and including > vtkStandardNweMacro? > > Thanks, > Cory > > On Wed, Apr 27, 2016 at 4:19 AM, ?? ? wrote: >> Hi, >> I had a class derived from vtkInteractorStyleRubberBandPick defined as >> following: >> >> class myAreaSelector : public vtkInteractorStyleRubberBandPick >> { >> public: >> vtkTypeMacro(myAreaSelector, vtkInteractorStyleRubberBandPick); >> static myAreaSelector *New(); >> ..... >> }; >> >> And implemented this new function with: >> >> vtkStandardNewMacro(myAreaSelector); >> >> Which leads to error C2660 : 'vtkObject::operator new' not take 3 > parameters >> Is there any wrong doings with this implementation? >> >> Any suggestion to overcoming this error message is welcome. >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Wed Apr 27 12:22:26 2016 From: tjlp at netease.com (Liu_tj) Date: Thu, 28 Apr 2016 00:22:26 +0800 (CST) Subject: [vtkusers] How to transform the selected area by vtkBorderWidget to vtkExtractVOI Message-ID: <2b248433.f.15458875bc4.Coremail.tjlp@netease.com> Hi, My requirement is using a rectangle to select an area on the DICOM iamge and generate 3D model for the selected area. At present what I know is using vtkBorderWidget for selection and vtkExtractVOI to get the vtkImageData of the selected area. However, vtkExtractVOI::SetVOI() uses the min and max extents as the input. So, my question is: how to transform the selected area by vtkBorderWidget to the extent number used by vtkExtractVOI? Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From hjchen.work at gmail.com Wed Apr 27 16:39:40 2016 From: hjchen.work at gmail.com (hchen) Date: Wed, 27 Apr 2016 13:39:40 -0700 (MST) Subject: [vtkusers] read RT dose, structure and plan DICOM to vtk+python? Message-ID: <1461789580773-5737906.post@n5.nabble.com> Hi, It there a native VTK class that reads RT dose, structure and plan DICOM files? I am using VTK in python. vtkDICOMImageReader() works fine with DICOM CT, but seems to have trouble with RT files. Some older posts mentioned vtkGDCMImageReader, but somehow it is not in my VTK build ( VTK 7 + python 3.4 on Ubuntu 14.04 ) Right now I take a detour by using pydicom to read RT DICOM files and then convert to vtkImageData, but then I have to create a structure to store things such as patient name, id, plan name, etc. Does anyone know a better way of handling RT DICOM files in VTK? Thanks chen -- View this message in context: http://vtk.1045678.n5.nabble.com/read-RT-dose-structure-and-plan-DICOM-to-vtk-python-tp5737906.html Sent from the VTK - Users mailing list archive at Nabble.com. From rickfrank at me.com Wed Apr 27 18:28:33 2016 From: rickfrank at me.com (Richard Frank) Date: Wed, 27 Apr 2016 22:28:33 +0000 (GMT) Subject: [vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx, continued References: Message-ID: <493c7ff8-8340-4e11-91fa-7d3e18daf43c@me.com> Hi, I was able to isolate?the problem. We are using vtkLightKit in our application. Here is a small app that will demonstrate the problem https://www.dropbox.com/s/crwlm6njmqvdrz4/Source.7z?dl=0 But basically all you have to do is: vtkSmartPointer lightKit = vtkSmartPointer::New(); lightKit->AddLightsToRenderer(ren1); and render a volume and the shader fails to compile. Can you verify? Also, while in there the code this->Impl->ShaderProgram = this->Impl->ShaderCache->ReadyShaderProgram( vertexShader.c_str(), fragmentShader.c_str(), ""); if (!this->Impl->ShaderProgram->GetCompiled()) { vtkErrorMacro("Shader failed to compile"); } should be changed to? if (this->Impl->ShaderProgram == nullptr || !this->Impl->ShaderProgram->GetCompiled()) { } as?ReadyShaderProgram returns nullptr at least in this case (which causes the crash) Let me ?know if you can repro and, if you fix it I will fetch from git and try again. Thanks! Rick Frank Begin forwarded message: From: Richard Frank Date: April 7, 2016 at 11:45:48 AM EDT To: Aashish Chaudhary Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx, continued Hi, I pulled from git about 2 or 3 days ago, and got around to testing this AM. I still crash, albeit slightly different place it seems but the same undefined gl_aspect : ERROR: In Y:\ThirdParty\vtk700\Rendering\OpenGL2\vtkShaderProgram.cxx, line 378 vtkShaderProgram (00000000362FFA50): 1: #version 150 2: #ifdef GL_ES 3: #if __VERSION__ == 300 4: #define varying in 5: #ifdef GL_FRAGMENT_PRECISION_HIGH 6: precision highp float; 7: precision highp sampler2D; 8: precision highp sampler3D; 9: #else 10: precision mediump float; 11: precision mediump sampler2D; 12: precision mediump sampler3D; 13: #endif 14: #define texelFetchBuffer texelFetch 15: #define texture1D texture 16: #define texture2D texture 17: #define texture3D texture 18: #endif // 300 19: #if __VERSION__ == 100 20: #extension GL_OES_standard_derivatives : enable 21: #ifdef GL_FRAGMENT_PRECISION_HIGH 22: precision highp float; 23: #else 24: precision mediump float; 25: #endif 26: #endif // 100 27: #else // GL_ES 28: #define highp 29: #define mediump 30: #define lowp 31: #if __VERSION__ == 150 32: #define varying in 33: #define texelFetchBuffer texelFetch 34: #define texture1D texture 35: #define texture2D texture 36: #define texture3D texture 37: #endif 38: #if __VERSION__ == 120 39: #extension GL_EXT_gpu_shader4 : require 40: #endif 41: #endif // GL_ES 42: 43: 44: /*========================================================================= 45: 46: Program: Visualization Toolkit 47: Module: raycasterfs.glsl 48: 49: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 50: All rights reserved. 51: See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 52: 53: This software is distributed WITHOUT ANY WARRANTY; without even 54: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 55: PURPOSE. See the above copyright notice for more information. 56: 57: =========================================================================*/ 58: 59: ////////////////////////////////////////////////////////////////////////////// 60: /// 61: /// Inputs 62: /// 63: ////////////////////////////////////////////////////////////////////////////// 64: 65: /// 3D texture coordinates form vertex shader 66: varying vec3 ip_textureCoords; 67: varying vec3 ip_vertexPos; 68: 69: ////////////////////////////////////////////////////////////////////////////// 70: /// 71: /// Outputs 72: /// 73: ////////////////////////////////////////////////////////////////////////////// 74: 75: vec4 g_fragColor = vec4(0.0); 76: 77: ////////////////////////////////////////////////////////////////////////////// 78: /// 79: /// Uniforms, attributes, and globals 80: /// 81: ////////////////////////////////////////////////////////////////////////////// 82: vec3 g_dataPos; 83: vec3 g_dirStep; 84: vec4 g_srcColor; 85: vec4 g_eyePosObj; 86: bool g_exit; 87: 88: uniform vec4 in_volume_scale; 89: uniform vec4 in_volume_bias; 90: 91: out vec4 fragOutput0; 92: 93: 94: 95: // Volume dataset 96: uniform sampler3D in_volume; 97: uniform int in_noOfComponents; 98: uniform int in_independentComponents; 99: 100: uniform sampler2D in_noiseSampler; 101: #ifndef GL_ES 102: uniform sampler2D in_depthSampler; 103: #endif 104: 105: // Camera position 106: uniform vec3 in_cameraPos; 107: 108: // view and model matrices 109: uniform mat4 in_volumeMatrix; 110: uniform mat4 in_inverseVolumeMatrix; 111: uniform mat4 in_projectionMatrix; 112: uniform mat4 in_inverseProjectionMatrix; 113: uniform mat4 in_modelViewMatrix; 114: uniform mat4 in_inverseModelViewMatrix; 115: uniform mat4 in_textureDatasetMatrix; 116: uniform mat4 in_inverseTextureDatasetMatrix; 117: uniform mat4 in_texureToEyeIt; 118: 119: // Ray step size 120: uniform vec3 in_cellStep; 121: uniform vec2 in_scalarsRange[4]; 122: uniform vec3 in_cellSpacing; 123: 124: // Sample distance 125: uniform float in_sampleDistance; 126: 127: // Scales 128: uniform vec3 in_cellScale; 129: uniform vec2 in_windowLowerLeftCorner; 130: uniform vec2 in_inverseOriginalWindowSize; 131: uniform vec2 in_inverseWindowSize; 132: uniform vec3 in_textureExtentsMax; 133: uniform vec3 in_textureExtentsMin; 134: 135: // Material and lighting 136: uniform vec3 in_diffuse; 137: uniform vec3 in_ambient; 138: uniform vec3 in_specular; 139: uniform float in_shininess; 140: 141: // Others 142: uniform bool in_cellFlag; 143: uniform bool in_useJittering; 144: vec3 g_xvec; 145: vec3 g_yvec; 146: vec3 g_zvec; 147: uniform bool in_twoSidedLighting; 148: vec3 g_cellSpacing; 149: float g_avgSpacing; 150: vec4 g_fragWorldPos; 151: uniform int in_numberOfLights; 152: uniform vec3 in_lightAmbientColor[6]; 153: uniform vec3 in_lightDiffuseColor[6]; 154: uniform vec3 in_lightSpecularColor[6]; 155: uniform vec3 in_lightDirection[6]; 156: 157: //VTK::Termination::Dec 158: 159: //VTK::Cropping::Dec 160: 161: //VTK::Shading::Dec 162: 163: //VTK::BinaryMask::Dec 164: 165: //VTK::CompositeMask::Dec 166: 167: 168: uniform sampler2D in_opacityTransferFunc; 169: float computeOpacity(vec4 scalar) 170: { 171: return texture2D(in_opacityTransferFunc, vec2(scalar.w, 0)).r; 172: } 173: 174: 175: uniform sampler2D in_gradientTransferFunc; 176: float computeGradientOpacity(vec4 grad) 177: { 178: return texture2D(in_gradientTransferFunc, vec2(grad.w, 0.0)).r; 179: } 180: // c is short for component 181: vec4 computeGradient(int c) 182: { 183: vec3 g1; 184: vec4 g2; 185: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; 186: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; 187: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; 188: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; 189: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; 190: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; 191: g1 = g1 * in_volume_scale.r + in_volume_bias.r; 192: g2 = g2 * in_volume_scale.r + in_volume_bias.r; 193: g1.x = in_scalarsRange[c][0] + ( 194: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.x; 195: g1.y = in_scalarsRange[c][0] + ( 196: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.y; 197: g1.z = in_scalarsRange[c][0] + ( 198: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.z; 199: g2.x = in_scalarsRange[c][0] + ( 200: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.x; 201: g2.y = in_scalarsRange[c][0] + ( 202: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.y; 203: g2.z = in_scalarsRange[c][0] + ( 204: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.z; 205: g2.xyz = g1 - g2.xyz; 206: g2.x /= g_aspect.x; 207: g2.y /= g_aspect.y; 208: g2.z /= g_aspect.z; 209: g2.w = 0.0; 210: float grad_mag = length(g2); 211: if (grad_mag > 0.0) 212: { 213: g2.x /= grad_mag; 214: g2.y /= grad_mag; 215: g2.z /= grad_mag; 216: } 217: else 218: { 219: g2.xyz = vec3(0.0, 0.0, 0.0); 220: } 221: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[c][1] - 222: (in_scalarsRange[c][0]))); 223: grad_mag = clamp(grad_mag, 0.0, 1.0); 224: g2.w = grad_mag; 225: return g2; 226: } 227: 228: 229: vec4 computeLighting(vec4 color, int component) 230: { 231: vec4 finalColor = vec4(0.0); 232: // Compute gradient function only once 233: vec4 gradient = computeGradient(component); 234: g_fragWorldPos = in_modelViewMatrix * in_volumeMatrix * 235: in_textureDatasetMatrix * vec4(-g_dataPos, 1.0); 236: if (g_fragWorldPos.w != 0.0) 237: { 238: g_fragWorldPos /= g_fragWorldPos.w; 239: } 240: vec3 vdir = normalize(g_fragWorldPos.xyz); 241: vec3 normal = gradient.xyz; 242: vec3 ambient = vec3(0.0); 243: vec3 diffuse = vec3(0.0); 244: vec3 specular = vec3(0.0); 245: float normalLength = length(normal); 246: if (normalLength > 0.0) 247: { 248: normal = normalize((in_texureToEyeIt * vec4(normal, 0.0)).xyz); 249: } 250: else 251: { 252: normal = vec3(0.0, 0.0, 0.0); 253: } 254: for (int lightNum = 0; lightNum < in_numberOfLights; lightNum++) 255: { 256: vec3 ldir = in_lightDirection[lightNum].xyz; 257: vec3 h = normalize(ldir + vdir); 258: float nDotH = dot(normal, h); 259: if (nDotH < 0.0 && in_twoSidedLighting) 260: { 261: nDotH = -nDotH; 262: } 263: float nDotL = dot(normal, ldir); 264: if (nDotL < 0.0 && in_twoSidedLighting) 265: { 266: nDotL = -nDotL; 267: } 268: if (nDotL > 0.0) 269: { 270: diffuse += in_lightDiffuseColor[lightNum] * nDotL; 271: } 272: if (nDotH > 0.0) 273: { 274: specular = in_lightSpecularColor[lightNum] * pow(nDotH, in_shininess); 275: } 276: ambient += in_lightAmbientColor[lightNum]; 277: } 278: finalColor.xyz = in_ambient * ambient + 279: in_diffuse * diffuse * color.rgb + 280: in_specular * specular; 281: if (gradient.w >= 0.0) 282: { 283: color.a = color.a * 284: computeGradientOpacity(gradient); 285: } 286: finalColor.a = color.a; 287: return finalColor; 288: } 289: 290: 291: uniform sampler2D in_colorTransferFunc; 292: vec4 computeColor(vec4 scalar, float opacity) 293: { 294: return computeLighting(vec4(texture2D(in_colorTransferFunc, 295: vec2(scalar.w, 0.0)).xyz, opacity), 0); 296: } 297: 298: 299: vec3 computeRayDirection() 300: { 301: return normalize(ip_vertexPos.xyz - g_eyePosObj.xyz); 302: } 303: 304: /// We support only 8 clipping planes for now 305: /// The first value is the size of the data array for clipping 306: /// planes (origin, normal) 307: uniform float in_clippingPlanes[49]; 308: uniform float in_scale; 309: uniform float in_bias; 310: 311: ////////////////////////////////////////////////////////////////////////////// 312: /// 313: /// Main 314: /// 315: ////////////////////////////////////////////////////////////////////////////// 316: void main() 317: { 318: /// Initialize g_fragColor (output) to 0 319: g_fragColor = vec4(0.0); 320: g_dirStep = vec3(0.0); 321: g_srcColor = vec4(0.0); 322: g_exit = false; 323: 324: 325: bool l_adjustTextureExtents = !in_cellFlag; 326: // Get the 3D texture coordinates for lookup into the in_volume dataset 327: g_dataPos = ip_textureCoords.xyz; 328: 329: // Eye position in object space 330: g_eyePosObj = (in_inverseVolumeMatrix * vec4(in_cameraPos, 1.0)); 331: if (g_eyePosObj.w != 0.0) 332: { 333: g_eyePosObj.x /= g_eyePosObj.w; 334: g_eyePosObj.y /= g_eyePosObj.w; 335: g_eyePosObj.z /= g_eyePosObj.w; 336: g_eyePosObj.w = 1.0; 337: } 338: 339: // Getting the ray marching direction (in object space); 340: vec3 rayDir = computeRayDirection(); 341: 342: // Multiply the raymarching direction with the step size to get the 343: // sub-step size we need to take at each raymarching step 344: g_dirStep = (in_inverseTextureDatasetMatrix * 345: vec4(rayDir, 0.0)).xyz * in_sampleDistance; 346: 347: float jitterValue = (texture2D(in_noiseSampler, g_dataPos.xy).x); 348: if (in_useJittering) 349: { 350: g_dataPos += g_dirStep * jitterValue; 351: } 352: else 353: { 354: g_dataPos += g_dirStep; 355: } 356: 357: // Flag to deternmine if voxel should be considered for the rendering 358: bool l_skip = false; 359: g_cellSpacing = vec3(in_cellSpacing[0], 360: in_cellSpacing[1], 361: in_cellSpacing[2]); 362: g_avgSpacing = (g_cellSpacing[0] + 363: g_cellSpacing[1] + 364: g_cellSpacing[2])/3.0; 365: g_xvec = vec3(in_cellStep[0], 0.0, 0.0); 366: g_yvec = vec3(0.0, in_cellStep[1], 0.0); 367: g_zvec = vec3(0.0, 0.0, in_cellStep[2]); 368: // Adjust the aspect 369: g_aspect.x = g_cellSpacing[0] * 2.0 / g_avgSpacing; 370: g_aspect.y = g_cellSpacing[1] * 2.0 / g_avgSpacing; 371: g_aspect.z = g_cellSpacing[2] * 2.0 / g_avgSpacing; 372: 373: 374: // Minimum texture access coordinate 375: vec3 l_texMin = vec3(0.0); 376: vec3 l_texMax = vec3(1.0); 377: if (l_adjustTextureExtents) 378: { 379: vec3 delta = in_textureExtentsMax - in_textureExtentsMin; 380: l_texMin = vec3(0.5) / delta; 381: l_texMax = (delta - vec3(0.5)) / delta; 382: } 383: 384: // Flag to indicate if the raymarch loop should terminate 385: bool stop = false; 386: 387: // 2D Texture fragment coordinates [0,1] from fragment coordinates 388: // the frame buffer texture has the size of the plain buffer but 389: // we use a fraction of it. The texture coordinates is less than 1 if 390: // the reduction factor is less than 1. 391: // Device coordinates are between -1 and 1. We need texture 392: // coordinates between 0 and 1 the in_depthSampler buffer has the 393: // original size buffer. 394: vec2 fragTexCoord = (gl_FragCoord.xy - in_windowLowerLeftCorner) * 395: in_inverseWindowSize; 396: float l_terminatePointMax = 0.0; 397: 398: #ifdef GL_ES 399: vec4 l_depthValue = vec4(1.0,1.0,1.0,1.0); 400: #else 401: vec4 l_depthValue = texture2D(in_depthSampler, fragTexCoord); 402: #endif 403: // Depth test 404: if(gl_FragCoord.z >= l_depthValue.x) 405: { 406: discard; 407: } 408: 409: // color buffer or max scalar buffer have a reduced size. 410: fragTexCoord = (gl_FragCoord.xy - in_windowLowerLeftCorner) * 411: in_inverseOriginalWindowSize; 412: 413: // Compute max number of iterations it will take before we hit 414: // the termination point 415: 416: // Abscissa of the point on the depth buffer along the ray. 417: // point in texture coordinates 418: vec4 terminatePoint; 419: terminatePoint.x = (gl_FragCoord.x - in_windowLowerLeftCorner.x) * 2.0 * 420: in_inverseWindowSize.x - 1.0; 421: terminatePoint.y = (gl_FragCoord.y - in_windowLowerLeftCorner.y) * 2.0 * 422: in_inverseWindowSize.y - 1.0; 423: terminatePoint.z = (2.0 * l_depthValue.x - (gl_DepthRange.near + 424: gl_DepthRange.far)) / gl_DepthRange.diff; 425: terminatePoint.w = 1.0; 426: 427: // From normalized device coordinates to eye coordinates. 428: // in_projectionMatrix is inversed because of way VT 429: // >From eye coordinates to texture coordinates 430: terminatePoint = in_inverseTextureDatasetMatrix * 431: in_inverseVolumeMatrix * 432: in_inverseModelViewMatrix * 433: in_inverseProjectionMatrix * 434: terminatePoint; 435: terminatePoint /= terminatePoint.w; 436: 437: l_terminatePointMax = length(terminatePoint.xyz - g_dataPos.xyz) / 438: length(g_dirStep); 439: float l_currentT = 0.0; 440: 441: //VTK::Shading::Init 442: 443: //VTK::Cropping::Init 444: 445: //VTK::Clipping::Init 446: 447: //VTK::RenderToImage::Init 448: 449: //VTK::DepthPass::Init 450: 451: /// For all samples along the ray 452: while (!g_exit) 453: { 454: 455: l_skip = false; 456: 457: //VTK::Cropping::Impl 458: 459: //VTK::Clipping::Impl 460: 461: //VTK::BinaryMask::Impl 462: 463: //VTK::CompositeMask::Impl 464: 465: 466: if (!l_skip) 467: { 468: vec4 scalar = texture3D(in_volume, g_dataPos); 469: scalar.r = scalar.r*in_volume_scale.r + in_volume_bias.r; 470: scalar = vec4(scalar.r,scalar.r,scalar.r,scalar.r); 471: g_srcColor = vec4(0.0); 472: g_srcColor.a = computeOpacity(scalar); 473: if (g_srcColor.a > 0.0) 474: { 475: g_srcColor = computeColor(scalar, g_srcColor.a); 476: // Opacity calculation using compositing: 477: // Here we use front to back compositing scheme whereby 478: // the current sample value is multiplied to the 479: // currently accumulated alpha and then this product 480: // is subtracted from the sample value to get the 481: // alpha from the previous steps. Next, this alpha is 482: // multiplied with the current sample colour 483: // and accumulated to the composited colour. The alpha 484: // value from the previous steps is then accumulated 485: // to the composited colour alpha. 486: g_srcColor.rgb *= g_srcColor.a; 487: g_fragColor = (1.0f - g_fragColor.a) * g_srcColor + g_fragColor; 488: } 489: } 490: 491: //VTK::RenderToImage::Impl 492: 493: //VTK::DepthPass::Impl 494: 495: /// Advance ray 496: g_dataPos += g_dirStep; 497: 498: 499: // sign function performs component wise operation and returns -1 500: // if the difference is less than 0, 0 if equal to 0, and 1 if 501: // above 0. So if the ray is inside the volume, dot product will 502: // always be 3. 503: stop = dot(sign(g_dataPos - l_texMin), sign(l_texMax - g_dataPos)) 504: < 3.0; 505: 506: // If the stopping condition is true we brek out of the ray marching 507: // loop 508: if (stop) 509: { 510: break; 511: } 512: // Early ray termination 513: // if the currently composited colour alpha is already fully saturated 514: // we terminated the loop or if we have hit an obstacle in the 515: // direction of they ray (using depth buffer) we terminate as well. 516: if((g_fragColor.a > (1.0 - 1.0/255.0)) || 517: l_currentT >= l_terminatePointMax) 518: { 519: break; 520: } 521: ++l_currentT; 522: } 523: 524: //VTK::Base::Exit 525: 526: //VTK::Terminate::Exit 527: 528: //VTK::Cropping::Exit 529: 530: //VTK::Clipping::Exit 531: 532: //VTK::Shading::Exit 533: 534: g_fragColor.r = g_fragColor.r * in_scale + in_bias * g_fragColor.a; 535: g_fragColor.g = g_fragColor.g * in_scale + in_bias * g_fragColor.a; 536: g_fragColor.b = g_fragColor.b * in_scale + in_bias * g_fragColor.a; 537: fragOutput0 = g_fragColor; 538: 539: //VTK::RenderToImage::Exit 540: 541: //VTK::DepthPass::Exit 542: } 543: ERROR: In Y:\ThirdParty\vtk700\Rendering\OpenGL2\vtkShaderProgram.cxx, line 379 vtkShaderProgram (00000000362FFA50): 0(206) : error C1008: undefined variable "g_aspect" 0(207) : error C1008: undefined variable "g_aspect" 0(208) : error C1008: undefined variable "g_aspect" 0(369) : error C1008: undefined variable "g_aspect" 0(370) : error C1008: undefined variable "g_aspect" 0(371) : error C1008: undefined variable "g_aspect" On Apr 04, 2016, at 11:49 AM, Aashish Chaudhary wrote: Yes please. If you can checkout the latest master, this should not happen.? Thanks, Aashish On Mon, Apr 4, 2016 at 11:48 AM, Richard Frank wrote: No I'm using 7.0.0 release not a git clone. I guess I should get the latest?? Rick On Apr 04, 2016, at 10:53 AM, Aashish Chaudhary wrote: Thanks, and are you using VTK master as of last week since we had this problem and got fixed recently. ? - Aashish On Mon, Apr 4, 2016 at 10:47 AM, Richard Frank wrote: Hi, Here is a portion of code: volumeProperty->SetColor(0, colorTransferFunction); volumeProperty->SetColor(1, maskColorTransferFunction); volumeProperty->SetScalarOpacity(opacityTransferFunction); volumeProperty->SetGradientOpacity(volumeGradientOpacityFunction); volumeProperty->SetInterpolationTypeToLinear(); volumeProperty->ShadeOn(); volumeProperty->SetAmbient(0.4); volumeProperty->SetDiffuse(0.8); volumeProperty->SetSpecular(0.2); volumeProperty->SetSpecularPower(105.0); volumeProperty->SetScalarOpacityUnitDistance(0.7); volume->SetProperty(volumeProperty); The hard coded numbers are just picked empirically by viewing our most common inputs. On Apr 03, 2016, at 10:26 PM, Aashish Chaudhary wrote: Rick,? Can you send me information on what you are turning on in volume property and in mapper that leads to this crash? Also, is your data is single or 2 or 4 component?? Thanks, On Sun, Apr 3, 2016 at 9:25 PM, Richard Frank wrote: Further investigation seems to point the GradientOpacity section of shader ?raycasterfs.glsl, code which seems to?be?inserted at runtime: I guess gl_aspect is not defined in this scenario? Any suggestions welcome! Rick vec4 computeGradient() 145: { 146: vec3 g1; 147: vec4 g2; 148: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; 149: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; 150: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; 151: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; 152: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; 153: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; 154: g1 = g1*in_volume_scale.r + in_volume_bias.r; 155: g2 = g2*in_volume_scale.r + in_volume_bias.r; 156: g1.x = in_scalarsRange[0] + ( 157: in_scalarsRange[1] - in_scalarsRange[0]) * g1.x; 158: g1.y = in_scalarsRange[0] + ( 159: in_scalarsRange[1] - in_scalarsRange[0]) * g1.y; 160: g1.z = in_scalarsRange[0] + ( 161: in_scalarsRange[1] - in_scalarsRange[0]) * g1.z; 162: g2.x = in_scalarsRange[0] + ( 163: in_scalarsRange[1] - in_scalarsRange[0]) * g2.x; 164: g2.y = in_scalarsRange[0] + ( 165: in_scalarsRange[1] - in_scalarsRange[0]) * g2.y; 166: g2.z = in_scalarsRange[0] + ( 167: in_scalarsRange[1] - in_scalarsRange[0]) * g2.z; 168: g2.xyz = g1 - g2.xyz; 169: g2.x /= g_aspect.x; 170: g2.y /= g_aspect.y; 171: g2.z /= g_aspect.z; 172: float grad_mag = sqrt(g2.x * g2.x + 173: g2.y * g2.y + 174: g2.z * g2.z); 175: if (grad_mag > 0.0) 176: { 177: g2.x /= grad_mag; 178: g2.y /= grad_mag; 179: g2.z /= grad_mag; 180: } 181: else 182: { 183: g2.xyz = vec3(0.0, 0.0, 0.0); 184: } 185: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[1] - 186: (in_scalarsRange[0]))); 187: grad_mag = clamp(grad_mag, 0.0, 1.0); 188: g2.w = grad_mag; 189: return g2; 190: } _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- | Aashish Chaudhary | Technical Leader ? ? ? ?? | Kitware Inc.? ? ? ? ? ? |?http://www.kitware.com/company/team/chaudhary.html -- | Aashish Chaudhary | Technical Leader ? ? ? ?? | Kitware Inc.? ? ? ? ? ? |?http://www.kitware.com/company/team/chaudhary.html -- | Aashish Chaudhary | Technical Leader ? ? ? ?? | Kitware Inc.? ? ? ? ? ? |?http://www.kitware.com/company/team/chaudhary.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Wed Apr 27 18:35:25 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Wed, 27 Apr 2016 18:35:25 -0400 Subject: [vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx, continued In-Reply-To: <493c7ff8-8340-4e11-91fa-7d3e18daf43c@me.com> References: <493c7ff8-8340-4e11-91fa-7d3e18daf43c@me.com> Message-ID: Thanks Rick for giving us the case for reproducing the error. I will have someone look into it. Thanks, On Wed, Apr 27, 2016 at 6:28 PM, Richard Frank wrote: > Hi, > > I was able to isolate the problem. > > We are using vtkLightKit in our application. > > Here is a small app that will demonstrate the problem > > https://www.dropbox.com/s/crwlm6njmqvdrz4/Source.7z?dl=0 > > > But basically all you have to do is: > > vtkSmartPointer lightKit = > vtkSmartPointer::New(); > lightKit->AddLightsToRenderer(ren1); > > and render a volume > and the shader fails to compile. > > Can you verify? > > Also, while in there the code > > this->Impl->ShaderProgram = this->Impl->ShaderCache->ReadyShaderProgram( > vertexShader.c_str(), fragmentShader.c_str(), ""); > if (!this->Impl->ShaderProgram->GetCompiled()) > { > vtkErrorMacro("Shader failed to compile"); > } > > should be changed to > if (this->Impl->ShaderProgram == nullptr || > !this->Impl->ShaderProgram->GetCompiled()) > { > > } > > as ReadyShaderProgram returns nullptr at least in this case (which causes > the crash) > > Let me know if you can repro and, if you fix it I will fetch from git and > try again. > > Thanks! > > Rick Frank > > > Begin forwarded message: > *From: *Richard Frank > *Date: *April 7, 2016 at 11:45:48 AM EDT > *To: *Aashish Chaudhary > *Cc: *vtkusers at vtk.org > *Subject: **Re: [vtkusers] Error in vtkOpenGLGPUVolumeRayCastMapper.cxx, > continued* > > Hi, > > I pulled from git about 2 or 3 days ago, and got around to testing this AM. > > I still crash, albeit slightly different place it seems but the same > undefined gl_aspect > > : > > ERROR: In Y:\ThirdParty\vtk700\Rendering\OpenGL2\vtkShaderProgram.cxx, > line 378 > vtkShaderProgram (00000000362FFA50): 1: #version 150 > 2: #ifdef GL_ES > 3: #if __VERSION__ == 300 > 4: #define varying in > 5: #ifdef GL_FRAGMENT_PRECISION_HIGH > 6: precision highp float; > 7: precision highp sampler2D; > 8: precision highp sampler3D; > 9: #else > 10: precision mediump float; > 11: precision mediump sampler2D; > 12: precision mediump sampler3D; > 13: #endif > 14: #define texelFetchBuffer texelFetch > 15: #define texture1D texture > 16: #define texture2D texture > 17: #define texture3D texture > 18: #endif // 300 > 19: #if __VERSION__ == 100 > 20: #extension GL_OES_standard_derivatives : enable > 21: #ifdef GL_FRAGMENT_PRECISION_HIGH > 22: precision highp float; > 23: #else > 24: precision mediump float; > 25: #endif > 26: #endif // 100 > 27: #else // GL_ES > 28: #define highp > 29: #define mediump > 30: #define lowp > 31: #if __VERSION__ == 150 > 32: #define varying in > 33: #define texelFetchBuffer texelFetch > 34: #define texture1D texture > 35: #define texture2D texture > 36: #define texture3D texture > 37: #endif > 38: #if __VERSION__ == 120 > 39: #extension GL_EXT_gpu_shader4 : require > 40: #endif > 41: #endif // GL_ES > 42: > 43: > 44: > /*========================================================================= > 45: > 46: Program: Visualization Toolkit > 47: Module: raycasterfs.glsl > 48: > 49: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen > 50: All rights reserved. > 51: See Copyright.txt or http://www.kitware.com/Copyright.htm for details. > 52: > 53: This software is distributed WITHOUT ANY WARRANTY; without even > 54: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR > 55: PURPOSE. See the above copyright notice for more information. > 56: > 57: > =========================================================================*/ > 58: > 59: > ////////////////////////////////////////////////////////////////////////////// > 60: /// > 61: /// Inputs > 62: /// > 63: > ////////////////////////////////////////////////////////////////////////////// > 64: > 65: /// 3D texture coordinates form vertex shader > 66: varying vec3 ip_textureCoords; > 67: varying vec3 ip_vertexPos; > 68: > 69: > ////////////////////////////////////////////////////////////////////////////// > 70: /// > 71: /// Outputs > 72: /// > 73: > ////////////////////////////////////////////////////////////////////////////// > 74: > 75: vec4 g_fragColor = vec4(0.0); > 76: > 77: > ////////////////////////////////////////////////////////////////////////////// > 78: /// > 79: /// Uniforms, attributes, and globals > 80: /// > 81: > ////////////////////////////////////////////////////////////////////////////// > 82: vec3 g_dataPos; > 83: vec3 g_dirStep; > 84: vec4 g_srcColor; > 85: vec4 g_eyePosObj; > 86: bool g_exit; > 87: > 88: uniform vec4 in_volume_scale; > 89: uniform vec4 in_volume_bias; > 90: > 91: out vec4 fragOutput0; > 92: > 93: > 94: > 95: // Volume dataset > 96: uniform sampler3D in_volume; > 97: uniform int in_noOfComponents; > 98: uniform int in_independentComponents; > 99: > 100: uniform sampler2D in_noiseSampler; > 101: #ifndef GL_ES > 102: uniform sampler2D in_depthSampler; > 103: #endif > 104: > 105: // Camera position > 106: uniform vec3 in_cameraPos; > 107: > 108: // view and model matrices > 109: uniform mat4 in_volumeMatrix; > 110: uniform mat4 in_inverseVolumeMatrix; > 111: uniform mat4 in_projectionMatrix; > 112: uniform mat4 in_inverseProjectionMatrix; > 113: uniform mat4 in_modelViewMatrix; > 114: uniform mat4 in_inverseModelViewMatrix; > 115: uniform mat4 in_textureDatasetMatrix; > 116: uniform mat4 in_inverseTextureDatasetMatrix; > 117: uniform mat4 in_texureToEyeIt; > 118: > 119: // Ray step size > 120: uniform vec3 in_cellStep; > 121: uniform vec2 in_scalarsRange[4]; > 122: uniform vec3 in_cellSpacing; > 123: > 124: // Sample distance > 125: uniform float in_sampleDistance; > 126: > 127: // Scales > 128: uniform vec3 in_cellScale; > 129: uniform vec2 in_windowLowerLeftCorner; > 130: uniform vec2 in_inverseOriginalWindowSize; > 131: uniform vec2 in_inverseWindowSize; > 132: uniform vec3 in_textureExtentsMax; > 133: uniform vec3 in_textureExtentsMin; > 134: > 135: // Material and lighting > 136: uniform vec3 in_diffuse; > 137: uniform vec3 in_ambient; > 138: uniform vec3 in_specular; > 139: uniform float in_shininess; > 140: > 141: // Others > 142: uniform bool in_cellFlag; > 143: uniform bool in_useJittering; > 144: vec3 g_xvec; > 145: vec3 g_yvec; > 146: vec3 g_zvec; > 147: uniform bool in_twoSidedLighting; > 148: vec3 g_cellSpacing; > 149: float g_avgSpacing; > 150: vec4 g_fragWorldPos; > 151: uniform int in_numberOfLights; > 152: uniform vec3 in_lightAmbientColor[6]; > 153: uniform vec3 in_lightDiffuseColor[6]; > 154: uniform vec3 in_lightSpecularColor[6]; > 155: uniform vec3 in_lightDirection[6]; > 156: > 157: //VTK::Termination::Dec > 158: > 159: //VTK::Cropping::Dec > 160: > 161: //VTK::Shading::Dec > 162: > 163: //VTK::BinaryMask::Dec > 164: > 165: //VTK::CompositeMask::Dec > 166: > 167: > 168: uniform sampler2D in_opacityTransferFunc; > 169: float computeOpacity(vec4 scalar) > 170: { > 171: return texture2D(in_opacityTransferFunc, vec2(scalar.w, 0)).r; > 172: } > 173: > 174: > 175: uniform sampler2D in_gradientTransferFunc; > 176: float computeGradientOpacity(vec4 grad) > 177: { > 178: return texture2D(in_gradientTransferFunc, vec2(grad.w, 0.0)).r; > 179: } > 180: // c is short for component > 181: vec4 computeGradient(int c) > 182: { > 183: vec3 g1; > 184: vec4 g2; > 185: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; > 186: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; > 187: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; > 188: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; > 189: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; > 190: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; > 191: g1 = g1 * in_volume_scale.r + in_volume_bias.r; > 192: g2 = g2 * in_volume_scale.r + in_volume_bias.r; > 193: g1.x = in_scalarsRange[c][0] + ( > 194: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.x; > 195: g1.y = in_scalarsRange[c][0] + ( > 196: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.y; > 197: g1.z = in_scalarsRange[c][0] + ( > 198: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g1.z; > 199: g2.x = in_scalarsRange[c][0] + ( > 200: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.x; > 201: g2.y = in_scalarsRange[c][0] + ( > 202: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.y; > 203: g2.z = in_scalarsRange[c][0] + ( > 204: in_scalarsRange[c][1] - in_scalarsRange[c][0]) * g2.z; > 205: g2.xyz = g1 - g2.xyz; > 206: g2.x /= g_aspect.x; > 207: g2.y /= g_aspect.y; > 208: g2.z /= g_aspect.z; > 209: g2.w = 0.0; > 210: float grad_mag = length(g2); > 211: if (grad_mag > 0.0) > 212: { > 213: g2.x /= grad_mag; > 214: g2.y /= grad_mag; > 215: g2.z /= grad_mag; > 216: } > 217: else > 218: { > 219: g2.xyz = vec3(0.0, 0.0, 0.0); > 220: } > 221: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[c][1] - > 222: (in_scalarsRange[c][0]))); > 223: grad_mag = clamp(grad_mag, 0.0, 1.0); > 224: g2.w = grad_mag; > 225: return g2; > 226: } > 227: > 228: > 229: vec4 computeLighting(vec4 color, int component) > 230: { > 231: vec4 finalColor = vec4(0.0); > 232: // Compute gradient function only once > 233: vec4 gradient = computeGradient(component); > 234: g_fragWorldPos = in_modelViewMatrix * in_volumeMatrix * > 235: in_textureDatasetMatrix * vec4(-g_dataPos, 1.0); > 236: if (g_fragWorldPos.w != 0.0) > 237: { > 238: g_fragWorldPos /= g_fragWorldPos.w; > 239: } > 240: vec3 vdir = normalize(g_fragWorldPos.xyz); > 241: vec3 normal = gradient.xyz; > 242: vec3 ambient = vec3(0.0); > 243: vec3 diffuse = vec3(0.0); > 244: vec3 specular = vec3(0.0); > 245: float normalLength = length(normal); > 246: if (normalLength > 0.0) > 247: { > 248: normal = normalize((in_texureToEyeIt * vec4(normal, 0.0)).xyz); > 249: } > 250: else > 251: { > 252: normal = vec3(0.0, 0.0, 0.0); > 253: } > 254: for (int lightNum = 0; lightNum < in_numberOfLights; lightNum++) > 255: { > 256: vec3 ldir = in_lightDirection[lightNum].xyz; > 257: vec3 h = normalize(ldir + vdir); > 258: float nDotH = dot(normal, h); > 259: if (nDotH < 0.0 && in_twoSidedLighting) > 260: { > 261: nDotH = -nDotH; > 262: } > 263: float nDotL = dot(normal, ldir); > 264: if (nDotL < 0.0 && in_twoSidedLighting) > 265: { > 266: nDotL = -nDotL; > 267: } > 268: if (nDotL > 0.0) > 269: { > 270: diffuse += in_lightDiffuseColor[lightNum] * nDotL; > 271: } > 272: if (nDotH > 0.0) > 273: { > 274: specular = in_lightSpecularColor[lightNum] * pow(nDotH, > in_shininess); > 275: } > 276: ambient += in_lightAmbientColor[lightNum]; > 277: } > 278: finalColor.xyz = in_ambient * ambient + > 279: in_diffuse * diffuse * color.rgb + > 280: in_specular * specular; > 281: if (gradient.w >= 0.0) > 282: { > 283: color.a = color.a * > 284: computeGradientOpacity(gradient); > 285: } > 286: finalColor.a = color.a; > 287: return finalColor; > 288: } > 289: > 290: > 291: uniform sampler2D in_colorTransferFunc; > 292: vec4 computeColor(vec4 scalar, float opacity) > 293: { > 294: return computeLighting(vec4(texture2D(in_colorTransferFunc, > 295: vec2(scalar.w, 0.0)).xyz, opacity), 0); > 296: } > 297: > 298: > 299: vec3 computeRayDirection() > 300: { > 301: return normalize(ip_vertexPos.xyz - g_eyePosObj.xyz); > 302: } > 303: > 304: /// We support only 8 clipping planes for now > 305: /// The first value is the size of the data array for clipping > 306: /// planes (origin, normal) > 307: uniform float in_clippingPlanes[49]; > 308: uniform float in_scale; > 309: uniform float in_bias; > 310: > 311: > ////////////////////////////////////////////////////////////////////////////// > 312: /// > 313: /// Main > 314: /// > 315: > ////////////////////////////////////////////////////////////////////////////// > 316: void main() > 317: { > 318: /// Initialize g_fragColor (output) to 0 > 319: g_fragColor = vec4(0.0); > 320: g_dirStep = vec3(0.0); > 321: g_srcColor = vec4(0.0); > 322: g_exit = false; > 323: > 324: > 325: bool l_adjustTextureExtents = !in_cellFlag; > 326: // Get the 3D texture coordinates for lookup into the in_volume > dataset > 327: g_dataPos = ip_textureCoords.xyz; > 328: > 329: // Eye position in object space > 330: g_eyePosObj = (in_inverseVolumeMatrix * vec4(in_cameraPos, 1.0)); > 331: if (g_eyePosObj.w != 0.0) > 332: { > 333: g_eyePosObj.x /= g_eyePosObj.w; > 334: g_eyePosObj.y /= g_eyePosObj.w; > 335: g_eyePosObj.z /= g_eyePosObj.w; > 336: g_eyePosObj.w = 1.0; > 337: } > 338: > 339: // Getting the ray marching direction (in object space); > 340: vec3 rayDir = computeRayDirection(); > 341: > 342: // Multiply the raymarching direction with the step size to get the > 343: // sub-step size we need to take at each raymarching step > 344: g_dirStep = (in_inverseTextureDatasetMatrix * > 345: vec4(rayDir, 0.0)).xyz * in_sampleDistance; > 346: > 347: float jitterValue = (texture2D(in_noiseSampler, g_dataPos.xy).x); > 348: if (in_useJittering) > 349: { > 350: g_dataPos += g_dirStep * jitterValue; > 351: } > 352: else > 353: { > 354: g_dataPos += g_dirStep; > 355: } > 356: > 357: // Flag to deternmine if voxel should be considered for the rendering > 358: bool l_skip = false; > 359: g_cellSpacing = vec3(in_cellSpacing[0], > 360: in_cellSpacing[1], > 361: in_cellSpacing[2]); > 362: g_avgSpacing = (g_cellSpacing[0] + > 363: g_cellSpacing[1] + > 364: g_cellSpacing[2])/3.0; > 365: g_xvec = vec3(in_cellStep[0], 0.0, 0.0); > 366: g_yvec = vec3(0.0, in_cellStep[1], 0.0); > 367: g_zvec = vec3(0.0, 0.0, in_cellStep[2]); > 368: // Adjust the aspect > 369: g_aspect.x = g_cellSpacing[0] * 2.0 / g_avgSpacing; > 370: g_aspect.y = g_cellSpacing[1] * 2.0 / g_avgSpacing; > 371: g_aspect.z = g_cellSpacing[2] * 2.0 / g_avgSpacing; > 372: > 373: > 374: // Minimum texture access coordinate > 375: vec3 l_texMin = vec3(0.0); > 376: vec3 l_texMax = vec3(1.0); > 377: if (l_adjustTextureExtents) > 378: { > 379: vec3 delta = in_textureExtentsMax - in_textureExtentsMin; > 380: l_texMin = vec3(0.5) / delta; > 381: l_texMax = (delta - vec3(0.5)) / delta; > 382: } > 383: > 384: // Flag to indicate if the raymarch loop should terminate > 385: bool stop = false; > 386: > 387: // 2D Texture fragment coordinates [0,1] from fragment coordinates > 388: // the frame buffer texture has the size of the plain buffer but > 389: // we use a fraction of it. The texture coordinates is less than 1 if > 390: // the reduction factor is less than 1. > 391: // Device coordinates are between -1 and 1. We need texture > 392: // coordinates between 0 and 1 the in_depthSampler buffer has the > 393: // original size buffer. > 394: vec2 fragTexCoord = (gl_FragCoord.xy - in_windowLowerLeftCorner) * > 395: in_inverseWindowSize; > 396: float l_terminatePointMax = 0.0; > 397: > 398: #ifdef GL_ES > 399: vec4 l_depthValue = vec4(1.0,1.0,1.0,1.0); > 400: #else > 401: vec4 l_depthValue = texture2D(in_depthSampler, fragTexCoord); > 402: #endif > 403: // Depth test > 404: if(gl_FragCoord.z >= l_depthValue.x) > 405: { > 406: discard; > 407: } > 408: > 409: // color buffer or max scalar buffer have a reduced size. > 410: fragTexCoord = (gl_FragCoord.xy - in_windowLowerLeftCorner) * > 411: in_inverseOriginalWindowSize; > 412: > 413: // Compute max number of iterations it will take before we hit > 414: // the termination point > 415: > 416: // Abscissa of the point on the depth buffer along the ray. > 417: // point in texture coordinates > 418: vec4 terminatePoint; > 419: terminatePoint.x = (gl_FragCoord.x - in_windowLowerLeftCorner.x) * > 2.0 * > 420: in_inverseWindowSize.x - 1.0; > 421: terminatePoint.y = (gl_FragCoord.y - in_windowLowerLeftCorner.y) * > 2.0 * > 422: in_inverseWindowSize.y - 1.0; > 423: terminatePoint.z = (2.0 * l_depthValue.x - (gl_DepthRange.near + > 424: gl_DepthRange.far)) / gl_DepthRange.diff; > 425: terminatePoint.w = 1.0; > 426: > 427: // From normalized device coordinates to eye coordinates. > 428: // in_projectionMatrix is inversed because of way VT > 429: // From eye coordinates to texture coordinates > 430: terminatePoint = in_inverseTextureDatasetMatrix * > 431: in_inverseVolumeMatrix * > 432: in_inverseModelViewMatrix * > 433: in_inverseProjectionMatrix * > 434: terminatePoint; > 435: terminatePoint /= terminatePoint.w; > 436: > 437: l_terminatePointMax = length(terminatePoint.xyz - g_dataPos.xyz) / > 438: length(g_dirStep); > 439: float l_currentT = 0.0; > 440: > 441: //VTK::Shading::Init > 442: > 443: //VTK::Cropping::Init > 444: > 445: //VTK::Clipping::Init > 446: > 447: //VTK::RenderToImage::Init > 448: > 449: //VTK::DepthPass::Init > 450: > 451: /// For all samples along the ray > 452: while (!g_exit) > 453: { > 454: > 455: l_skip = false; > 456: > 457: //VTK::Cropping::Impl > 458: > 459: //VTK::Clipping::Impl > 460: > 461: //VTK::BinaryMask::Impl > 462: > 463: //VTK::CompositeMask::Impl > 464: > 465: > 466: if (!l_skip) > 467: { > 468: vec4 scalar = texture3D(in_volume, g_dataPos); > 469: scalar.r = scalar.r*in_volume_scale.r + in_volume_bias.r; > 470: scalar = vec4(scalar.r,scalar.r,scalar.r,scalar.r); > 471: g_srcColor = vec4(0.0); > 472: g_srcColor.a = computeOpacity(scalar); > 473: if (g_srcColor.a > 0.0) > 474: { > 475: g_srcColor = computeColor(scalar, g_srcColor.a); > 476: // Opacity calculation using compositing: > 477: // Here we use front to back compositing scheme whereby > 478: // the current sample value is multiplied to the > 479: // currently accumulated alpha and then this product > 480: // is subtracted from the sample value to get the > 481: // alpha from the previous steps. Next, this alpha is > 482: // multiplied with the current sample colour > 483: // and accumulated to the composited colour. The alpha > 484: // value from the previous steps is then accumulated > 485: // to the composited colour alpha. > 486: g_srcColor.rgb *= g_srcColor.a; > 487: g_fragColor = (1.0f - g_fragColor.a) * g_srcColor + g_fragColor; > 488: } > 489: } > 490: > 491: //VTK::RenderToImage::Impl > 492: > 493: //VTK::DepthPass::Impl > 494: > 495: /// Advance ray > 496: g_dataPos += g_dirStep; > 497: > 498: > 499: // sign function performs component wise operation and returns -1 > 500: // if the difference is less than 0, 0 if equal to 0, and 1 if > 501: // above 0. So if the ray is inside the volume, dot product will > 502: // always be 3. > 503: stop = dot(sign(g_dataPos - l_texMin), sign(l_texMax - g_dataPos)) > 504: < 3.0; > 505: > 506: // If the stopping condition is true we brek out of the ray marching > 507: // loop > 508: if (stop) > 509: { > 510: break; > 511: } > 512: // Early ray termination > 513: // if the currently composited colour alpha is already fully > saturated > 514: // we terminated the loop or if we have hit an obstacle in the > 515: // direction of they ray (using depth buffer) we terminate as well. > 516: if((g_fragColor.a > (1.0 - 1.0/255.0)) || > 517: l_currentT >= l_terminatePointMax) > 518: { > 519: break; > 520: } > 521: ++l_currentT; > 522: } > 523: > 524: //VTK::Base::Exit > 525: > 526: //VTK::Terminate::Exit > 527: > 528: //VTK::Cropping::Exit > 529: > 530: //VTK::Clipping::Exit > 531: > 532: //VTK::Shading::Exit > 533: > 534: g_fragColor.r = g_fragColor.r * in_scale + in_bias * g_fragColor.a; > 535: g_fragColor.g = g_fragColor.g * in_scale + in_bias * g_fragColor.a; > 536: g_fragColor.b = g_fragColor.b * in_scale + in_bias * g_fragColor.a; > 537: fragOutput0 = g_fragColor; > 538: > 539: //VTK::RenderToImage::Exit > 540: > 541: //VTK::DepthPass::Exit > 542: } > 543: > > > > ERROR: In Y:\ThirdParty\vtk700\Rendering\OpenGL2\vtkShaderProgram.cxx, > line 379 > vtkShaderProgram (00000000362FFA50): 0(206) : error C1008: undefined > variable "g_aspect" > 0(207) : error C1008: undefined variable "g_aspect" > 0(208) : error C1008: undefined variable "g_aspect" > 0(369) : error C1008: undefined variable "g_aspect" > 0(370) : error C1008: undefined variable "g_aspect" > 0(371) : error C1008: undefined variable "g_aspect" > > > > On Apr 04, 2016, at 11:49 AM, Aashish Chaudhary < > aashish.chaudhary at kitware.com> wrote: > > Yes please. If you can checkout the latest master, this should not happen. > > Thanks, > Aashish > > On Mon, Apr 4, 2016 at 11:48 AM, Richard Frank wrote: > >> No I'm using 7.0.0 release not a git clone. >> >> I guess I should get the latest? >> >> Rick >> >> >> On Apr 04, 2016, at 10:53 AM, Aashish Chaudhary < >> aashish.chaudhary at kitware.com> wrote: >> >> Thanks, and are you using VTK master as of last week since we had this >> problem and got fixed recently. >> >> - Aashish >> >> On Mon, Apr 4, 2016 at 10:47 AM, Richard Frank wrote: >> >>> Hi, >>> >>> Here is a portion of code: >>> >>> >>> volumeProperty->SetColor(0, colorTransferFunction); >>> volumeProperty->SetColor(1, maskColorTransferFunction); >>> volumeProperty->SetScalarOpacity(opacityTransferFunction); >>> volumeProperty->SetGradientOpacity(volumeGradientOpacityFunction); >>> volumeProperty->SetInterpolationTypeToLinear(); >>> volumeProperty->ShadeOn(); >>> volumeProperty->SetAmbient(0.4); >>> volumeProperty->SetDiffuse(0.8); >>> volumeProperty->SetSpecular(0.2); >>> volumeProperty->SetSpecularPower(105.0); >>> volumeProperty->SetScalarOpacityUnitDistance(0.7); >>> volume->SetProperty(volumeProperty); >>> >>> The hard coded numbers are just picked empirically by viewing our most >>> common inputs. >>> >>> On Apr 03, 2016, at 10:26 PM, Aashish Chaudhary < >>> aashish.chaudhary at kitware.com> wrote: >>> >>> Rick, >>> >>> Can you send me information on what you are turning on in volume >>> property and in mapper that leads to this crash? Also, is your data is >>> single or 2 or 4 component? >>> >>> Thanks, >>> >>> >>> On Sun, Apr 3, 2016 at 9:25 PM, Richard Frank wrote: >>> >>>> Further investigation seems to point the GradientOpacity section of >>>> shader raycasterfs.glsl, code which seems to be inserted at runtime: I >>>> guess gl_aspect is not defined in this scenario? >>>> >>>> Any suggestions welcome! >>>> >>>> Rick >>>> >>>> vec4 computeGradient() >>>> 145: { >>>> 146: vec3 g1; >>>> 147: vec4 g2; >>>> 148: g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x; >>>> 149: g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x; >>>> 150: g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x; >>>> 151: g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x; >>>> 152: g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x; >>>> 153: g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x; >>>> 154: g1 = g1*in_volume_scale.r + in_volume_bias.r; >>>> 155: g2 = g2*in_volume_scale.r + in_volume_bias.r; >>>> 156: g1.x = in_scalarsRange[0] + ( >>>> 157: in_scalarsRange[1] - in_scalarsRange[0]) * g1.x; >>>> 158: g1.y = in_scalarsRange[0] + ( >>>> 159: in_scalarsRange[1] - in_scalarsRange[0]) * g1.y; >>>> 160: g1.z = in_scalarsRange[0] + ( >>>> 161: in_scalarsRange[1] - in_scalarsRange[0]) * g1.z; >>>> 162: g2.x = in_scalarsRange[0] + ( >>>> 163: in_scalarsRange[1] - in_scalarsRange[0]) * g2.x; >>>> 164: g2.y = in_scalarsRange[0] + ( >>>> 165: in_scalarsRange[1] - in_scalarsRange[0]) * g2.y; >>>> 166: g2.z = in_scalarsRange[0] + ( >>>> 167: in_scalarsRange[1] - in_scalarsRange[0]) * g2.z; >>>> 168: g2.xyz = g1 - g2.xyz; >>>> 169: g2.x /= g_aspect.x; >>>> 170: g2.y /= g_aspect.y; >>>> 171: g2.z /= g_aspect.z; >>>> 172: float grad_mag = sqrt(g2.x * g2.x + >>>> 173: g2.y * g2.y + >>>> 174: g2.z * g2.z); >>>> 175: if (grad_mag > 0.0) >>>> 176: { >>>> 177: g2.x /= grad_mag; >>>> 178: g2.y /= grad_mag; >>>> 179: g2.z /= grad_mag; >>>> 180: } >>>> 181: else >>>> 182: { >>>> 183: g2.xyz = vec3(0.0, 0.0, 0.0); >>>> 184: } >>>> 185: grad_mag = grad_mag * 1.0 / (0.25 * (in_scalarsRange[1] - >>>> 186: (in_scalarsRange[0]))); >>>> 187: grad_mag = clamp(grad_mag, 0.0, 1.0); >>>> 188: g2.w = grad_mag; >>>> 189: return g2; >>>> 190: } >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>> >>> >>> -- >>> >>> >>> >>> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >>> * >>> *| http://www.kitware.com/company/team/chaudhary.html >>> * >>> >>> >> >> >> -- >> >> >> >> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >> * >> *| http://www.kitware.com/company/team/chaudhary.html >> * >> >> > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.j.brown at live.co.uk Thu Apr 28 05:22:43 2016 From: richard.j.brown at live.co.uk (Richard Brown) Date: Thu, 28 Apr 2016 11:22:43 +0200 Subject: [vtkusers] read RT dose, structure and plan DICOM to vtk+python? In-Reply-To: <1461789580773-5737906.post@n5.nabble.com> References: <1461789580773-5737906.post@n5.nabble.com> Message-ID: GDCM is a separately installed library (https://sourceforge.net/projects/gdcm). With my installation I ticked the GDCM_USE_VTK flag. I use vtkGDCMImageReader for DICOM files and vtkGDCMPolyDataReader for RT Struct files. I don?t use RT Dose nor RT Plan, so I can?t comment. However, I would imagine that as you said, you can read RT Dose files with vtkGDCMImageReader. Good luck, Richard > On 27 Apr 2016, at 22:39, hchen wrote: > > Hi, > > It there a native VTK class that reads RT dose, structure and plan DICOM > files? > > I am using VTK in python. vtkDICOMImageReader() works fine with DICOM CT, > but seems to have trouble with RT files. Some older posts mentioned > vtkGDCMImageReader, but somehow it is not in my VTK build ( VTK 7 + python > 3.4 on Ubuntu 14.04 ) > > Right now I take a detour by using pydicom to read RT DICOM files and then > convert to vtkImageData, but then I have to create a structure to store > things such as patient name, id, plan name, etc. > > Does anyone know a better way of handling RT DICOM files in VTK? > > Thanks > > chen > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/read-RT-dose-structure-and-plan-DICOM-to-vtk-python-tp5737906.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From zionman.hsu at gmail.com Thu Apr 28 05:49:22 2016 From: zionman.hsu at gmail.com (=?UTF-8?B?5b6Q5b+XIOiPrw==?=) Date: Thu, 28 Apr 2016 17:49:22 +0800 Subject: [vtkusers] Error C2660: 'vtkObject::operatpr new': do not take 3 patameters In-Reply-To: References: Message-ID: Thank everyone. I check my default settings of my vs2008 , found that I had set a nondocumented default macro for new function , in a closed up project , which I forgotton already. Pardon for such a foolish mistake. 2016?4?28? ??12:00? "John Platt" ??? > Hi, > > The files compile OK on my VS2008 after removing the symbol > VTKINTERACTIONSTYLE_EXPORT (not defined in my project). Sorry I can't be > more helpful. > > John. > > On 27/04/2016 15:38, ??? wrote: > > Attached is the header file and implementation file that cause error > I test it with VS 2008, and it caused Error C2660, but, test it with VS > 2015, It's OK, and no Error message generates. > > -----Original Message----- > From: Cory Quammen [mailto:cory.quammen at kitware.com ] > Sent: Wednesday, April 27, 2016 9:15 PM > To: ?? ? > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] Error C2660: 'vtkObject::operatpr new': do not take > 3 patameters > > >From the code you have shared, I do not see what would cause the error > you report. > > Could you post the header file and the portion of the code in the > implementation file (.cxx) leading up to and including > vtkStandardNweMacro? > > Thanks, > Cory > > On Wed, Apr 27, 2016 at 4:19 AM, ?? ? wrote: > > Hi, > I had a class derived from vtkInteractorStyleRubberBandPick defined as > following: > > class myAreaSelector : public vtkInteractorStyleRubberBandPick > { > public: > vtkTypeMacro(myAreaSelector, vtkInteractorStyleRubberBandPick); > static myAreaSelector *New(); > ..... > }; > > And implemented this new function with: > > vtkStandardNewMacro(myAreaSelector); > > Which leads to error C2660 : 'vtkObject::operator new' not take 3 > > parameters > > > Is there any wrong doings with this implementation? > > Any suggestion to overcoming this error message is welcome. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects athttp://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at:http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe:http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe:http://public.kitware.com/mailman/listinfo/vtkusers > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pkorir at ebi.ac.uk Thu Apr 28 07:01:03 2016 From: pkorir at ebi.ac.uk (Paul Kibet Korir) Date: Thu, 28 Apr 2016 12:01:03 +0100 Subject: [vtkusers] vtkCutter producing strange artefacts [image attached] Message-ID: <3d97f5a2-4882-226f-ea98-cf471e20ee5d@ebi.ac.uk> Hi VTK Users, I'm using VTK to interpolate contours that result from the intersection of a mesh surface with a plane. I'm getting very strange artefacts as shown in the attached image (I have other images but the file upload limit prevents me from including them). The image shows the mesh (as a wireframe) with the plane in green. There is an extra surface (large green) that protrudes off the mesh surface with a weird structure inside the mesh. What should I do to alleviate this? -- With kind regards, *Paul K Korir, PhD* /Scientific Programmer/ EMBL-EBI Main Building, A2-35, WTGC, Hinxton, Cambridge CB10 1SD P: +44 1223 49 44 22 F: +44 1223 49 44 68 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtk-cut-strange-1.png Type: image/png Size: 160732 bytes Desc: not available URL: From sur.chiranjib at gmail.com Thu Apr 28 08:24:31 2016 From: sur.chiranjib at gmail.com (Chiranjib Sur) Date: Thu, 28 Apr 2016 17:54:31 +0530 Subject: [vtkusers] How to contribute to the wiki with some examples Message-ID: Hi, I have some examples which I want to contribute back to the wiki/Examples. Can anyone points me towards the procedure of how I can contribute to the wiki? Thanks, Chiranjib -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Thu Apr 28 08:26:42 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 28 Apr 2016 08:26:42 -0400 Subject: [vtkusers] How to contribute to the wiki with some examples In-Reply-To: References: Message-ID: See http://www.vtk.org/Wiki/VTK/Examples/Instructions/ForDevelopers Feel free to ask for help. Bill On Apr 28, 2016 8:24 AM, "Chiranjib Sur" wrote: > Hi, > I have some examples which I want to contribute back to the wiki/Examples. > > Can anyone points me towards the procedure of how I can contribute to the > wiki? > > Thanks, > Chiranjib > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From myk321 at gmail.com Thu Apr 28 09:09:33 2016 From: myk321 at gmail.com (myk) Date: Thu, 28 Apr 2016 21:09:33 +0800 Subject: [vtkusers] Using VTK and QT on Linux Message-ID: <1461848973.8148.5.camel@gmail.com> I've been trying to get VTK and Qt working on Linux.??I happened on a setup the other day and thought I would share what worked for me.??To cut to the chase what worked is: VTK 6.1 + Qt 5.3 + QVTKWidget2 + OpenGL (not OpenGL2) on a non intel-graphics stack.??I've tried this successfully on AMD graphics cards and unsuccessfully on intel graphics running open source drivers under MESA (Gallium).??I tried VTK7.0 in about 8 combinations (on intel) without success. I got to this solution based partly with google and of course piles of experimentation.??The rules, as I understand them, are as follows: (a) QVTKWidget does not work on intel i915 drivers because it does not return a depth buffer -> Supposedly using QVTKWidget2 works around this but in my experience that also does not work - so if you have intel graphics it seems you need to either add some AMD or Nvidia (aahh!) graphics hardware or get windows (double aaah!!!) Ref: http://public.kitware.com/pipermail/vtk-developers/2014-May/014998 .html (b) When compiling with OpenGL2, the QVTKWidget2 object is not included in the .so, so you can't link.??So to get the object created you need to build with OpenGL and NOT OpenGL2 http://comments.gmane.org/gmane.comp.lib.vtk.user/78123 (c) QVTKWidget2 requires Qt version of 5.3 or lower http://stackoverflow.com/questions/26944831/using-qvtkwidget-and-qopeng lwidget-in-the-same-ui (d) QVTKWidget2 was broken in VTK 6.2 onwards and thus you need to build with vtk 6.1.??Refer to GitHub to get it. Ref: http://vtk.1045678.n5.nabble.com/QVTKWidget2-status-td5732729.html (e) For VTK 6.1 you need to build it special command line parameters Ref: http://stackoverflow.com/questions/28761702/getting-error-glintptr -has-not-been-declared-when-building-vtk-on-linux On Fedora 23 on amd64, I download: Qt to the default ~/Qt/5.3 VTK 6.1 to ~/VTK-6.1.0 I build in ~/vtk61-qt53 where? ~ = /home/myk I completed the one-off VTK build with following commands: cd ~/vtk61-qt53 cmake -DVTK_QT_VERSION:STRING=5 \ ???????-DCMAKE_BUILD_TYPE=Release \ ??????-DQT_QMAKE_EXECUTABLE:PATH=/home/myk/Qt/5.3/gcc_64/bin/qmake \ ??????-DVTK_Group_Qt:BOOL=ON \ ??????-DCMAKE_PREFIX_PATH:PATH=/home/myk/Qt/5.3/gcc_64/lib/cmake \ ??????-DBUILD_SHARED_LIBS:BOOL=ON \ ??????-DCMAKE_C_FLAGS=-DGLX_GLXEXT_LEGACY \ ??????-DCMAKE_CXX_FLAGS=-DGLX_GLXEXT_LEGACY \ ??????-Wno-dev \ ??????../VTK-6.1.0 make -j4 sudo make install For the 'make -j4' replace the '4' with the number of cores on your machine - in my experience this is worth the effort! I then use cmake in a .../build directory with the following command: cmake -DVTK_QT_VERSION:STRING="5" -DCMAKE_PREFIX_PATH=/home/myk/Qt/5.3/gcc_64/ -DCMAKE_PREFIX_PATH=/home/myk/Qt/5.3/gcc_64/lib/cmake/Qt5Widgets/ -DVTK_DIR=/usr/local/include/vtk-6.1/ -DCMAKE_BUILD_TYPE=Debug .. make Finally I've inserted some very basic Qt + VTK code below that creates a QVKWidget2 so you can test the results (my apologies for my funny c style programming with C++ comments). Please call out if you have another combination which works on linux or have found a way around any of these issues. Kind regards, Michael PS: Some additional pointers: (1) In my experience you can't have both a QVTKWidget and a QVTKWidget2 displayed on the same window at the same time - the QVTKWidget will display but not the QVTKWidget2, so you need to be consistent. (2) If you create two VTKWidget2's and give them both the same renderer, the first QVTKWidget2 one will display junk and generate OpenGL errors when you interact with it, while the second QVTKWidget will work just fine.? (3) If you try any of this with Intel graphics hardware under MESA expect to just get OpenGL errors. -------------------Widget2.cxx #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(int argc,char* argv[]) { ????????QApplication app(argc,argv);? ????????QMainWindow MainWindow; //Give the window a reasonable initial size QDesktopWidget Desktop; MainWindow.setFixedSize(Desktop.width()*0.7, Desktop.height()*0.5); ????????//Create the VTK widgets QVTKWidget* widget = new QVTKWidget(); QVTKWidget2* widget2 = new QVTKWidget2(); ???????? //Layout the VTK widgets in a horizontal format ???? QHBoxLayout *HorLayout = new QHBoxLayout(); ????????//HorLayout->addWidget(widget); HorLayout->addWidget(widget2); QWidget *LayoutWidget = new QWidget(); ????????LayoutWidget->setLayout(HorLayout); MainWindow.setCentralWidget(LayoutWidget); //Create the spheres to display vtkSmartPointer translucentGeometry = vtkSmartPointer::New(); for (int i = 0; i < 5; i++) { vtkSmartPointer sphereSource = vtkSmartPointer::New(); sphereSource->SetThetaResolution(100); sphereSource->SetPhiResolution(100); sphereSource->SetRadius(0.5); // all spheres except the center one should have radius = 0.5 switch (i) { case 0: sphereSource->SetRadius(1); sphereSource->SetCenter(0, 0, 0); break; case 1: sphereSource->SetCenter(1, 0, 0); break; case 2: sphereSource->SetCenter(-1, 0, 0); break; case 3: sphereSource->SetCenter(0, 1, 0); break; case 4: sphereSource->SetCenter(0, -1, 0); break; } sphereSource->Update(); translucentGeometry->AddInputConnection(sphereSource- >GetOutputPort()); } //Create the mapper vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(translucentGeometry- >GetOutputPort()); //Create the actor vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); ???? actor->GetProperty()->SetOpacity(1); //1= Spheres are fully opaque; 0 = spheres are fully transparent; 0.5 = transparent actor->GetProperty()->SetColor(1, 0, 0); //Red spheres actor->RotateX(-72); // put the objects in a position where it is easy to see? //Create the renderer vtkSmartPointer renderer = vtkSmartPointer::New(); renderer->AddActor(actor); renderer->SetBackground(1, 1, 1); //white background //Create the renderer2 vtkSmartPointer renderer2 = vtkSmartPointer::New(); renderer2->AddActor(actor); renderer2->SetBackground(1, 1, 1); //white background //Add the renderer to the VTK widget widget->GetRenderWindow()->AddRenderer(renderer); widget2->GetRenderWindow()->AddRenderer(renderer2); //Format everything nicely renderer->ResetCamera(); renderer->GetActiveCamera()->Zoom(2.2); //zoom-in renderer2->ResetCamera(); renderer2->GetActiveCamera()->Zoom(2.2); //zoom-in //Display the Qt window ????????MainWindow.show();? ????????return app.exec();? }? -------------End Widget2.cxx -------------Start CMakeLists.txt cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) ? if(POLICY CMP0020) ? cmake_policy(SET CMP0020 NEW) endif() PROJECT(widget2) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) if(${VTK_VERSION} VERSION_GREATER "6" AND VTK_QT_VERSION VERSION_GREATER "4") ? # Instruct CMake to run moc automatically when needed. ? set(CMAKE_AUTOMOC ON) ? #find_package(Qt5Widgets REQUIRED QUIET) ? find_package(Qt5Widgets CONFIG REQUIRED COMPONENTS X11Extras) else() ? find_package(Qt4 REQUIRED) ? include(${QT_USE_FILE}) endif() include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) file(GLOB UI_FILES *.ui) file(GLOB QT_WRAP *.h) file(GLOB CXX_FILES *.cxx) if(${VTK_VERSION} VERSION_GREATER "6" AND VTK_QT_VERSION VERSION_GREATER "4") ? qt5_wrap_ui(UISrcs ${UI_FILES} ) ? # CMAKE_AUTOMOC in ON so the MocHdrs will be automatically wrapped. ? add_executable(widget2 MACOSX_BUNDLE ????${CXX_FILES} ${UISrcs} ${QT_WRAP}) ? qt5_use_modules(widget2 Core Gui) ? target_link_libraries(widget2 ${VTK_LIBRARIES}) else() ? QT4_WRAP_UI(UISrcs ${UI_FILES}) ? QT4_WRAP_CPP(MOCSrcs ${QT_WRAP}) ? add_executable(vtkdemo MACOSX_BUNDLE ${CXX_FILES} ${UISrcs} ${MOCSrcs}) ? if(VTK_LIBRARIES) ????if(${VTK_VERSION} VERSION_LESS "6") ??????target_link_libraries(widget2 ${VTK_LIBRARIES} QVTK) ????else() ??????target_link_libraries(widget2 ${VTK_LIBRARIES}) ????endif() ? else() ????target_link_libraries(widget2 vtkHybrid QVTK vtkViews ${QT_LIBRARIES}) ? endif() endif() include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) if(COMPILER_SUPPORTS_CXX11) ????set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") elseif(COMPILER_SUPPORTS_CXX0X) ????set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") else() ????????message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") endif() ----------------End CMakeLists.txt From david.gobbi at gmail.com Thu Apr 28 14:29:39 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 28 Apr 2016 12:29:39 -0600 Subject: [vtkusers] vtkVolumePicker In-Reply-To: References: <87A26FE1-33E6-46DE-A126-A3275D94D7B5@me.com> Message-ID: Hi Richard, I replicated the "transparent pick" bug you reported, and submitted a fix for review: https://gitlab.kitware.com/vtk/vtk/merge_requests/1467 The loop got stuck if the pick reached the camera's far clipping plane before either 1) finding an opaque voxel or 2) exiting through the rear of the volume. - David On Fri, Apr 22, 2016 at 7:25 AM, David Gobbi wrote: > On Fri, Apr 22, 2016 at 7:10 AM, Richard Frank wrote: > >> >> I also found an issue where in some cases the Ray trace loop ( in >> vtkCellPicker ) would get stuck. >> >> While ( t1 < tLast ) // something like this >> >> Etc >> >> In the particular instance, which seemed to be a click on an "empty" >> transparent area, t1 would get stuck at 1.0 " fore ever" ... >> >> So I subclassed it to work around and if t1 stays a 1.0 +- tiny e for >> >200 loops I break out. >> > > Thanks for the info, there must be a bug. I'll take a look at that loop. > > - David > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Thu Apr 28 18:19:55 2016 From: rickfrank at me.com (Richard Frank) Date: Thu, 28 Apr 2016 18:19:55 -0400 Subject: [vtkusers] vtkVolumePicker In-Reply-To: References: <87A26FE1-33E6-46DE-A126-A3275D94D7B5@me.com> Message-ID: Hi David, Thanks for the update. We?re going to migrate over to 7.0 (I presume that?s where your fix will go) as soon as the Renderer issue with LightKit I reported is resolved? Thanks Rick > On Apr 28, 2016, at 2:29 PM, David Gobbi wrote: > > Hi Richard, > > I replicated the "transparent pick" bug you reported, and submitted a fix for review: > https://gitlab.kitware.com/vtk/vtk/merge_requests/1467 > > The loop got stuck if the pick reached the camera's far clipping plane before > either 1) finding an opaque voxel or 2) exiting through the rear of the volume. > > - David > > On Fri, Apr 22, 2016 at 7:25 AM, David Gobbi > wrote: > On Fri, Apr 22, 2016 at 7:10 AM, Richard Frank > wrote: > > I also found an issue where in some cases the Ray trace loop ( in vtkCellPicker ) would get stuck. > > While ( t1 < tLast ) // something like this > > Etc > > In the particular instance, which seemed to be a click on an "empty" transparent area, t1 would get stuck at 1.0 " fore ever" ... > > So I subclassed it to work around and if t1 stays a 1.0 +- tiny e for >200 loops I break out. > > Thanks for the info, there must be a bug. I'll take a look at that loop. > > - David > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yue.nicholas at gmail.com Thu Apr 28 19:20:03 2016 From: yue.nicholas at gmail.com (Nicholas Yue) Date: Thu, 28 Apr 2016 23:20:03 +0000 Subject: [vtkusers] VTK - Progressive loading of mesh ? Message-ID: Hi, Is there some VTK mesh formats which are amenable to progressive loading of meshes/points at various level-of-detail ? Or is this capability pure an alogrithm/node without the VTK library and not so much the mesh format ? Cheers -------------- next part -------------- An HTML attachment was scrubbed... URL: From rakesh.p at tataelxsi.co.in Fri Apr 29 05:30:33 2016 From: rakesh.p at tataelxsi.co.in (Rakesh Patil) Date: Fri, 29 Apr 2016 09:30:33 +0000 Subject: [vtkusers] vtkScalarBarActor chrashes in the release mode. Message-ID: Hello, I want to use vtkScalarBarActor in my application. It crashes when I run the application is run in release mode. So I tested with an example given here http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ScalarBarActor [http://www.vtk.org/Wiki/images/0/05/VTK_Examples_Baseline_Visualization_TestScalarBarActor.png] VTK/Examples/Cxx/Visualization/ScalarBarActor www.vtk.org This example demonstrates how to make a color bar to that reflects the range of values associated with a data set. ScalarBarActor.cxx This example also crashes in the release mode. Can anyone give me clue as what might be happening? It stops executing and throws exception from vtkSys-6.3.dll. Kindly help me to overcome this issue. Thank You Warm Regards Rakesh Patil -------------- next part -------------- An HTML attachment was scrubbed... URL: From pkorir at ebi.ac.uk Fri Apr 29 06:30:02 2016 From: pkorir at ebi.ac.uk (Paul Kibet Korir) Date: Fri, 29 Apr 2016 11:30:02 +0100 Subject: [vtkusers] vtkCutter producing strange artefacts [image attached] In-Reply-To: <3d97f5a2-4882-226f-ea98-cf471e20ee5d@ebi.ac.uk> References: <3d97f5a2-4882-226f-ea98-cf471e20ee5d@ebi.ac.uk> Message-ID: <3142c7c3-c323-ede1-9503-ffda4d83cb06@ebi.ac.uk> Answer to my question (for any future inquiry on this matter): It turns out that this may be resolved by first decimating the mesh then smoothing it... # example from VTK User's Guide, 11th edition, page 109 # may contain typos from vtk import * ... poly = vtkPolyData() poly.SetPoints(...) poly.SetPolys(...) deci = vtkDecimatePro() deci.SetInputData(poly) deci.SetTargetReduction(0.9) deci.PreserverTopologyOn() smoother = vtkSmoothPolyDataFilter() smoother.SetInputConnection(deci.GetOutputPort()) smoother.SetNumberOfIterations(50) ... Rgds, Paul On 28/04/2016 12:01, Paul Kibet Korir wrote: > > Hi VTK Users, > > I'm using VTK to interpolate contours that result from the > intersection of a mesh surface with a plane. I'm getting very strange > artefacts as shown in the attached image (I have other images but the > file upload limit prevents me from including them). The image shows > the mesh (as a wireframe) with the plane in green. There is an extra > surface (large green) that protrudes off the mesh surface with a weird > structure inside the mesh. > > What should I do to alleviate this? > > > -- > With kind regards, > > *Paul K Korir, PhD* > /Scientific Programmer/ > EMBL-EBI > Main Building, A2-35, > WTGC, Hinxton, Cambridge CB10 1SD > P: +44 1223 49 44 22 > F: +44 1223 49 44 68 > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- With kind regards, *Paul K Korir, PhD* /Scientific Programmer/ EMBL-EBI Main Building, A2-35, WTGC, Hinxton, Cambridge CB10 1SD P: +44 1223 49 44 22 F: +44 1223 49 44 68 -------------- next part -------------- An HTML attachment was scrubbed... URL: From rakesh.p at tataelxsi.co.in Fri Apr 29 06:42:57 2016 From: rakesh.p at tataelxsi.co.in (Rakesh Patil) Date: Fri, 29 Apr 2016 10:42:57 +0000 Subject: [vtkusers] vtkScalarBarActor chrashes in the release mode. In-Reply-To: References: Message-ID: Sorry, I forgot to mention that I am working on Windows 10, with VTK 6.3 version. Warm Regards Rakesh Patil ________________________________ From: vtkusers on behalf of Rakesh Patil Sent: Friday, April 29, 2016 3:00:33 PM To: vtkusers at vtk.org Subject: [vtkusers] vtkScalarBarActor chrashes in the release mode. Hello, I want to use vtkScalarBarActor in my application. It crashes when I run the application is run in release mode. So I tested with an example given here http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ScalarBarActor [http://www.vtk.org/Wiki/images/0/05/VTK_Examples_Baseline_Visualization_TestScalarBarActor.png] VTK/Examples/Cxx/Visualization/ScalarBarActor www.vtk.org This example demonstrates how to make a color bar to that reflects the range of values associated with a data set. ScalarBarActor.cxx This example also crashes in the release mode. Can anyone give me clue as what might be happening? It stops executing and throws exception from vtkSys-6.3.dll. Kindly help me to overcome this issue. Thank You Warm Regards Rakesh Patil -------------- next part -------------- An HTML attachment was scrubbed... URL: From beekmaarten at yahoo.com Fri Apr 29 09:28:03 2016 From: beekmaarten at yahoo.com (Maarten Beek) Date: Fri, 29 Apr 2016 13:28:03 +0000 (UTC) Subject: [vtkusers] images with different extents References: <1345828263.3700725.1461936483466.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1345828263.3700725.1461936483466.JavaMail.yahoo@mail.yahoo.com> Hi all, Is there a way in VTK to deal with two images that have a different extent (but similar dimensions)?E.g extent1 = {-10, 501, -10, 501, -10, 501} and extent2 = {0, 511, 0, 511, 0, 511}. Thanks - Maarten -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Apr 29 09:35:08 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 29 Apr 2016 07:35:08 -0600 Subject: [vtkusers] images with different extents In-Reply-To: <1345828263.3700725.1461936483466.JavaMail.yahoo@mail.yahoo.com> References: <1345828263.3700725.1461936483466.JavaMail.yahoo.ref@mail.yahoo.com> <1345828263.3700725.1461936483466.JavaMail.yahoo@mail.yahoo.com> Message-ID: Hi Maarten, You can use vtkImageChangeInformation. Call SetOutputExtentStart(0,0,0). You can also call SetOutputOrigin(x,y,z) to make the origin match. - David On Fri, Apr 29, 2016 at 7:28 AM, Maarten Beek via vtkusers wrote: > Hi all, > > Is there a way in VTK to deal with two images that have a different extent > (but similar dimensions)? > E.g extent1 = {-10, 501, -10, 501, -10, 501} and extent2 = {0, 511, 0, > 511, 0, 511}. > > Thanks - Maarten > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.westphal at kitware.com Fri Apr 29 10:07:28 2016 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Fri, 29 Apr 2016 16:07:28 +0200 Subject: [vtkusers] VTK/Paraview Courses in June Message-ID: Hello Kitware will be holding a 2-day Advanced VTK and Advanced ParaView course on June 22th and 23th 2016 in Lyon, France. Please visit our web site for more information and registration details at Advanced VTK (English) : http://training.kitware.fr/browse/126 Advanced VTK (French) : http://formations.kitware.fr/browse/126 Advanced ParaView (English) : http://training.kitware.fr/browse/127 Advanced ParaView (French) : http://formations.kitware.fr/browse/127 Note that the course will be taught in English. If you have any question, please contact us at formations at http://www.kitware.fr Thank you, Mathieu Westphal -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdcycling at cox.net Fri Apr 29 09:53:35 2016 From: sdcycling at cox.net (sdcycling) Date: Fri, 29 Apr 2016 06:53:35 -0700 Subject: [vtkusers] AMR examples Message-ID: Hello, Could anyone please provide examples of 2-3 levels of 3-dimensional AMR data in ascii VTK format? I think that if I saw actual data in ascii format that I could convert it to binary format using Fortran. I am interested in multi-level AMR with blanking. My AMR code is based on octrees. Thank you, Doug. -------------- next part -------------- An HTML attachment was scrubbed... URL: From beekmaarten at yahoo.com Fri Apr 29 10:43:13 2016 From: beekmaarten at yahoo.com (Maarten Beek) Date: Fri, 29 Apr 2016 14:43:13 +0000 (UTC) Subject: [vtkusers] images with different extents In-Reply-To: References: <1345828263.3700725.1461936483466.JavaMail.yahoo.ref@mail.yahoo.com> <1345828263.3700725.1461936483466.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1323861699.3698584.1461940993762.JavaMail.yahoo@mail.yahoo.com> Thanks David, I'll try that. Maarten On Friday, April 29, 2016 9:35 AM, David Gobbi wrote: Hi Maarten, You can use vtkImageChangeInformation.? Call SetOutputExtentStart(0,0,0).? You can also call SetOutputOrigin(x,y,z) to make the origin match. ?- David On Fri, Apr 29, 2016 at 7:28 AM, Maarten Beek via vtkusers wrote: Hi all, Is there a way in VTK to deal with two images that have a different extent (but similar dimensions)?E.g extent1 = {-10, 501, -10, 501, -10, 501} and extent2 = {0, 511, 0, 511, 0, 511}. Thanks - Maarten -------------- next part -------------- An HTML attachment was scrubbed... URL: From beekmaarten at yahoo.com Fri Apr 29 13:39:29 2016 From: beekmaarten at yahoo.com (Maarten Beek) Date: Fri, 29 Apr 2016 17:39:29 +0000 (UTC) Subject: [vtkusers] memory management References: <1634303515.3768763.1461951569442.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1634303515.3768763.1461951569442.JavaMail.yahoo@mail.yahoo.com> I have a pipeline of 9 image filters.For every filter I call ReleaseDataFlagOn(); In Windows task Manager I see that before the pipeline executes my memory usage is 2.7GB, after the pipeline has executed it is 8GB.I am using VTK 6.1, Is there something I don't understand re. the ReleaseDataFlagOn() call? Thanks - Maarten -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike.jackson at bluequartz.net Fri Apr 29 14:44:00 2016 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Fri, 29 Apr 2016 14:44:00 -0400 Subject: [vtkusers] The real difference between QVTKWidget and QVTKWidget2 Message-ID: <5723AB70.9060103@bluequartz.net> We are also getting a similar issue on OS X? Has anyone else seen this problem? Is QVtkWidget2 ready for use or does it need more development time on OS X? Thanks -- Mike Jackson [mike.jackson at bluequartz.net] on March 10 2016 Thales Luis Rodrigues Sabino wrote: > I'm building an application that uses VTK for visualization. > My initial intent was to process large volumes of data. > My application is being built with Qt + VTK. > > When I started coding the visualization toolkit with VTK I found the > *QVTKWidget*. So far so good, I found another one, called > *QVTKWidget2*. In > the *QVTKWidget2*.h header there is the following statement: > > *// .NAME QVTKWidget2 - Display a vtkRenderWindow in a Qt's QGLWidget.* > *// .SECTION Description* > *// QVTKWidget2 provides a way to display VTK data in a Qt OpenGL widget.* > > Well, since this class uses the *QGLWidget* (which BTW is now deprecated, > replaced by *QOpenGLWidget*), I decided to use this one. I also based my > decision in some discussion I read about *QVTKWidget2* being a future > replacement for the *QVTKWidget* class. > > Everything was fine until I decided to run my application on MacOS and the > QVTKWidget2 object was crashing in initialization. > > I then replaced my widget to one of *QVTKWidget* and everything is now > working fine (at least in the initial tests). > > So, with this context, my question is, do I get any advantage by using > *QVTKWidget2*? > > My first thought was *'yes'*, since the *QVTKWidget* is a subclass of > *QWidget*. > > Hope someone could clarify this for me. > > -- > Thales Luis Rodrigues Sabino -------------- next part -------------- An HTML attachment was scrubbed... URL: From shawn.waldon at kitware.com Fri Apr 29 14:49:04 2016 From: shawn.waldon at kitware.com (Shawn Waldon) Date: Fri, 29 Apr 2016 14:49:04 -0400 Subject: [vtkusers] The real difference between QVTKWidget and QVTKWidget2 In-Reply-To: <5723AB70.9060103@bluequartz.net> References: <5723AB70.9060103@bluequartz.net> Message-ID: Hi Mike, What version of VTK are you using? I know there were some fixes that went in for QVTKWidget2 last summer (I think right around the time VTK 7 was released). If you are using VTK 6.X then those may have fixed the problem you are seeing. Shawn On Fri, Apr 29, 2016 at 2:44 PM, Michael Jackson < mike.jackson at bluequartz.net> wrote: > We are also getting a similar issue on OS X? Has anyone else seen this > problem? Is QVtkWidget2 ready for use or does it need more development time > on OS X? > > > Thanks > -- > Mike Jackson [mike.jackson at bluequartz.net] > > on March 10 2016 Thales Luis Rodrigues Sabino wrote: > > I'm building an application that uses VTK for visualization. > My initial intent was to process large volumes of data. > My application is being built with Qt + VTK. > > When I started coding the visualization toolkit with VTK I found the > *QVTKWidget*. So far so good, I found another one, called *QVTKWidget2*. In > the *QVTKWidget2*.h header there is the following statement: > > *// .NAME QVTKWidget2 - Display a vtkRenderWindow in a Qt's QGLWidget.* > *// .SECTION Description* > *// QVTKWidget2 provides a way to display VTK data in a Qt OpenGL widget.* > > Well, since this class uses the *QGLWidget* (which BTW is now deprecated, > replaced by *QOpenGLWidget*), I decided to use this one. I also based my > decision in some discussion I read about *QVTKWidget2* being a future > replacement for the *QVTKWidget* class. > > Everything was fine until I decided to run my application on MacOS and the > QVTKWidget2 object was crashing in initialization. > > I then replaced my widget to one of *QVTKWidget* and everything is now > working fine (at least in the initial tests). > > So, with this context, my question is, do I get any advantage by using > *QVTKWidget2*? > > My first thought was *'yes'*, since the *QVTKWidget* is a subclass of > *QWidget*. > > Hope someone could clarify this for me. > > -- > Thales Luis Rodrigues Sabino > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike.jackson at bluequartz.net Fri Apr 29 14:59:07 2016 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Fri, 29 Apr 2016 14:59:07 -0400 Subject: [vtkusers] The real difference between QVTKWidget and QVTKWidget2 In-Reply-To: References: <5723AB70.9060103@bluequartz.net> Message-ID: <5723AEFB.3000006@bluequartz.net> Sorry about that: VTK 7.0.0 download from the official VTK web site; OS X 10.10.5 with Xcode 7.2 -- Mike Jackson [mike.jackson at bluequartz.net] > Shawn Waldon > April 29, 2016 at 2:49 PM > Hi Mike, > > What version of VTK are you using? I know there were some fixes that > went in for QVTKWidget2 last summer (I think right around the time VTK > 7 was released). If you are using VTK 6.X then those may have fixed > the problem you are seeing. > > Shawn > > -------------- next part -------------- An HTML attachment was scrubbed... URL: