[prev in list] [next in list] [prev in thread] [next in thread] 

List:       insight-users
Subject:    Re: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!!
From:       Arnaud Gelas <arnaudgelas () gmail ! com>
Date:       2014-08-21 10:56:37
Message-ID: 997CA50D-FE3F-4620-BBDD-CCCD9EB440E0 () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Here is the patch (for progress report):

	http://review.source.kitware.com/#/c/16769/

On Aug 21, 2014, at 12:47 PM, Arnaud Gelas <arnaudgelas@gmail.com> wrote:

> Hi,
> 
> As of now, there is no progress event on this filter, so it is normal nothing \
> happened. 
> I'll submit another patch for progress event later today.
> 
> To review the patch, you need to create an account on gerrit:
> 
> 	http://review.source.kitware.com
> 
> Then you ca volunteer to the review patch, you can add comments, accept, refuse…
> Else once you are registered, you can send me an email and I will add you as a \
> reviewer. 
> Best,
> Arnaud
> 
> On Aug 21, 2014, at 12:11 PM, Mallikarjun K <mallikarjun49@gmail.com> wrote:
> 
> > Hi,
> > I am trying observe the progressEvent by using AddObserver method of this filter \
> > but I couldn't. Could you check the below code once. 
> > And one more thing,Could you guide me what exactly I have to do to Review the \
> > patch you have submitted. 
> > Thank you
> > 
> > 
> > ///progress
> > 
> > #include<iostream>
> > #include<string>
> > 
> > #include <itkMeshFileWriter.h>
> > #include <itkMeshFileReader.h>
> > #include <itkMeshIOFactory.h>
> > #include <itkMeshIOBase.h>
> > #include "itkMesh.h"
> > #include "itkQuadEdgeMesh.h"
> > #include "itkQuadEdgeMeshTraits.h"
> > #include "itkSmoothingQuadEdgeMeshFilter.h"
> > #include "itkCommand.h"
> > 
> > class MyCommand : public itk::Command
> > {
> > public:
> > itkNewMacro( MyCommand );
> > 
> > public:
> > 
> > void Execute(itk::Object *caller, const itk::EventObject & event)
> > {
> > Execute( (const itk::Object *)caller, event);
> > }
> > 
> > void Execute(const itk::Object * object, const itk::EventObject & event)
> > {
> > std::cout << "Command called." << std::endl;
> > 
> > 	  if( typeid( itk::ProgressEvent ) ==  typeid( event ) )
> > {
> > 		   ::itk::ProcessObject::ConstPointer  process = 
> > dynamic_cast< const itk::ProcessObject *>( object/*caller*/ );
> > 
> > const int value = static_cast<int>(process->GetProgress() * 100 );
> > 		   std::cout<<"progress:"<<value<<std::endl;   
> > 		  	  
> > 
> > 
> > }
> > 
> > }
> > 
> > };
> > 
> > int main( int argc, char* argv[] )
> > {
> > 
> > 	/*if( argc < 2 )
> > {
> > std::cerr << "Usage: " << std::endl;
> > std::cerr << argv[0] << "  inputImageFile   outputImageFile   flipAxisX   \
> > flipAxisY" << std::endl; return EXIT_FAILURE;
> > }*/
> > 
> > 	std::string Inputfilename="D:\\temp.vtk";
> > typedef itk::QuadEdgeMeshTraits<double, 3,double, double, double,double > \
> > qetraits;  typedef itk::QuadEdgeMesh< double, 3,qetraits > MeshType;
> > 
> > itk::OnesMatrixCoefficients< MeshType > coeff0;
> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType \
> > >SmoothingQuadEdgeMeshFilter; 
> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = \
> > SmoothingQuadEdgeMeshFilter::New(); 
> > typedef itk::MeshFileReader<MeshType> MeshReaderType;
> > MeshReaderType::Pointer Meshreader = MeshReaderType::New();
> > Meshreader->SetFileName( Inputfilename.c_str()/*argv[1]*/ );
> > // Meshreader->Update();
> > 
> > 
> > MyCommand::Pointer myCommand = MyCommand::New();
> > 
> > QEMeshSmoother->SetInput(Meshreader->GetOutput() );
> > QEMeshSmoother->SetNumberOfIterations( 1 );
> > QEMeshSmoother->SetRelaxationFactor( 0.5 );
> > QEMeshSmoother->SetDelaunayConforming(true);
> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); 
> > QEMeshSmoother->AddObserver(itk::ProgressEvent, myCommand);
> > 
> > // QEMeshSmoother->Update();
> > std::string Outputfilename="D:\\tempOut2.vtk";
> > 
> > typedef itk::MeshFileWriter<MeshType> MeshWriterType;
> > MeshWriterType::Pointer Meshwriter = MeshWriterType::New();
> > Meshwriter->SetFileName(Outputfilename.c_str() /*argv[2]*/ );
> > Meshwriter->SetInput(QEMeshSmoother->GetOutput());
> > 
> > try
> > {
> > Meshwriter->Update();
> > }
> > catch( itk::ExceptionObject& e )
> > {
> > std::cerr << e.what() << std::endl;
> > }
> > 
> > return 0;
> > 
> > 
> > } 
> > 
> > 
> > On Wed, Aug 20, 2014 at 7:33 PM, Arnaud Gelas <arnaudgelas@gmail.com> wrote:
> > Hi,
> > 
> > I have just submitted this patch for the documentation, can you please review it?
> > 
> > 	http://review.source.kitware.com/#/c/16755/
> > 
> > I was running this code on Mac i5 with 4GB RAM, with both ITK and this program \
> > compiled in Debug… 
> > Best,
> > Arnaud
> > 
> > On Aug 7, 2014, at 5:20 PM, Mallikarjun K <mallikarjun49@gmail.com> wrote:
> > 
> > > Hi Arnaud,
> > > 
> > > Thanks,Can you please tell me your machine confuguration. I am running 4GB \
> > > RAM,i3  on windows7. I have downloaded your project and tried to execute it and \
> > > it is still the same problem Which I was facing earlier.Any suggestions ..... 
> > > thank you 
> > > 
> > > 
> > > On Thu, Aug 7, 2014 at 8:10 PM, Arnaud Gelas <arnaudgelas@gmail.com> wrote:
> > > It takes 29s on my machine in debug to run 5 iterations with Delaunay \
> > > conforming set to true 
> > > https://gist.github.com/arnaudgelas/0f20ebdaf53956f79997
> > > 
> > > 
> > > On Aug 7, 2014, at 3:45 PM, Mallikarjun K <mallikarjun49@gmail.com> wrote:
> > > 
> > > > File path is correct.if it is '\'(backward slash) we have to add "D:\\" \
> > > > .since I used '/' it's not required to add "//". 
> > > > please find the attached  .vtk file 
> > > > 
> > > > Thanks
> > > > 
> > > > 
> > > > On Thu, Aug 7, 2014 at 7:01 PM, Arnaud Gelas <arnaudgelas@gmail.com> wrote:
> > > > Shouldn't it be D://temp.vtk ? Isn't it missing one '/' ?
> > > > 
> > > > Can you send this vtk file?
> > > > 
> > > > 
> > > > On Aug 7, 2014, at 3:23 PM, Mallikarjun K <mallikarjun49@gmail.com> wrote:
> > > > 
> > > > > Hi Arnaud,
> > > > > 
> > > > > Kindly have a look in the below code ,the problem  is that even after \
> > > > > QEMeshFilter output is saved as .stl file ,the program is still running for \
> > > > > long time.I have observed in my tests that MeshFileReader seems to be the \
> > > > > culprit. Any suggestions ? 
> > > > > /////
> > > > > #include<iostream>
> > > > > #include<string>
> > > > > 
> > > > > #include <vtkPolyDataWriter.h>
> > > > > #include <vtkPolyDataReader.h>
> > > > > #include <itkMeshFileWriter.h>
> > > > > #include <itkMeshFileReader.h>
> > > > > #include <itkMeshIOFactory.h>
> > > > > #include <itkMeshIOBase.h>
> > > > > #include <vtkTriangleFilter.h>
> > > > > #include <vtkCleanPolyData.h>
> > > > > #include "itkMesh.h"
> > > > > #include "itkQuadEdgeMesh.h"
> > > > > #include "itkQuadEdgeMeshTraits.h"
> > > > > #include "itkSmoothingQuadEdgeMeshFilter.h"
> > > > > #include "vtkSTLWriter.h"
> > > > > #include <vtkSmartPointer.h>
> > > > > 
> > > > > int main()
> > > > > {
> > > > > 	std::string Inputfilename="D:/temp.vtk";   //number of points of this mesh \
> > > > > file is around 78K 
> > > > > 	typedef itk::QuadEdgeMeshTraits<double, 3,double, double, double,double > \
> > > > > qetraits;	  typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > \
> > > > > MeshType;  
> > > > > 	itk::OnesMatrixCoefficients< MeshType > coeff0;
> > > > > 	typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType \
> > > > > >SmoothingQuadEdgeMeshFilter; 
> > > > > 	vtkSmartPointer<vtkPolyDataWriter> \
> > > > > polyDatawriter=vtkSmartPointer<vtkPolyDataWriter>::New();  \
> > > > > vtkSmartPointer<vtkPolyDataReader> \
> > > > > polyDatareader=vtkSmartPointer<vtkPolyDataReader>::New(); 
> > > > > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = \
> > > > > SmoothingQuadEdgeMeshFilter::New();  
> > > > > /* polyDatareader->SetFileName(Inputfilename.c_str() );
> > > > > 	polyDatareader->ReleaseDataFlagOn();
> > > > > 	polyDatareader->Update();*/
> > > > > 
> > > > > 	/*vtkSmartPointer<vtkTriangleFilter> triangleFilter =
> > > > > vtkSmartPointer<vtkTriangleFilter>::New();
> > > > > triangleFilter->SetInput(polyDatareader->GetOutput());
> > > > > triangleFilter->Update();*/
> > > > > 
> > > > > 	//
> > > > > 	/* vtkSmartPointer<vtkCleanPolyData> clean = \
> > > > > vtkSmartPointer<vtkCleanPolyData>::New();  #if (VTK_MAJOR_VERSION < 6)
> > > > > 	 clean->SetInput(triangleFilter->GetOutput() );
> > > > > 	#else
> > > > > clean->SetInputData(triangleFilter->GetOutput() );
> > > > > 	#endif
> > > > > 	
> > > > > clean->ConvertPolysToLinesOff();
> > > > > clean->ConvertLinesToPointsOff();
> > > > > clean->Update();
> > > > > 
> > > > > 	std::string Inputfilename2="D:/cleaned.vtk";*/
> > > > > 
> > > > > 	////
> > > > > 	/*polyDatawriter->SetInput(clean->GetOutput());	
> > > > > 	polyDatawriter->SetFileName(Inputfilename2.c_str());
> > > > > 	polyDatawriter->ReleaseDataFlagOn();
> > > > > 	polyDatawriter->Write(); */ 
> > > > > 
> > > > > 	typedef itk::MeshFileReader<MeshType> MeshReaderType;
> > > > > 	MeshReaderType::Pointer Meshreader = MeshReaderType::New();
> > > > > Meshreader->SetFileName(Inputfilename.c_str( ));
> > > > > 	Meshreader->Update();
> > > > > 
> > > > > 	/*MeshType::Pointer mesh =  Meshreader->GetOutput();
> > > > > mesh->DisconnectPipeline();*/
> > > > > 	
> > > > > 
> > > > > 	QEMeshSmoother->SetInput(Meshreader->GetOutput()/*mesh*/ );
> > > > > 	QEMeshSmoother->SetNumberOfIterations(1 );
> > > > > 	QEMeshSmoother->SetRelaxationFactor( 0.5 );
> > > > > 	QEMeshSmoother->SetDelaunayConforming(true);
> > > > > 	QEMeshSmoother->SetCoefficientsMethod( &coeff0 );
> > > > > 
> > > > > 	QEMeshSmoother->ReleaseDataFlagOn();
> > > > > 
> > > > > 	QEMeshSmoother->Update();	
> > > > > 
> > > > > 	std::string Outputfilename="D:/tempOut.vtk";
> > > > > 
> > > > > 	typedef itk::MeshFileWriter<MeshType> MeshWriterType;
> > > > > 	MeshWriterType::Pointer Meshwriter = MeshWriterType::New();
> > > > > Meshwriter->SetFileName(Outputfilename.c_str( ));
> > > > > 	Meshwriter->SetInput(QEMeshSmoother->GetOutput());
> > > > > Meshwriter->Update();	
> > > > > 
> > > > > 	polyDatareader->SetFileName(Outputfilename.c_str() );
> > > > > 	polyDatareader->ReleaseDataFlagOn();
> > > > > 	polyDatareader->Update();
> > > > > 
> > > > > 	vtkSmartPointer<vtkSTLWriter> \
> > > > > stlWriter=vtkSmartPointer<vtkSTLWriter>::New();  
> > > > > 	stlWriter->SetInput( polyDatareader->GetOutput());
> > > > > 	stlWriter->SetFileName("D:/QEoutput.stl");
> > > > > 	stlWriter->SetFileTypeToASCII();
> > > > > 	stlWriter->Write();
> > > > > 	
> > > > > 	//Here it stops and taking long time 
> > > > > 
> > > > > 	return 0;
> > > > > 
> > > > > 	
> > > > > }
> > > > > ////
> > > > > 
> > > > > 
> > > > > 
> > > > > On Thu, Aug 7, 2014 at 3:39 PM, Mallikarjun K <mallikarjun49@gmail.com> \
> > > > > wrote: Hi Arnaud,
> > > > > 
> > > > > Thanks for your reply and valuable suggestions.
> > > > > 
> > > > > Number of points in my input mesh are 78928.In my pipeline I am already \
> > > > > cleaning the polydata using vtkCleanPolyData filter.I will check the speed \
> > > > > improvement and results with delaunay conforming turned OFF. 
> > > > > Thank you
> > > > > 
> > > > > 
> > > > > On Thu, Aug 7, 2014 at 2:22 PM, Arnaud Gelas <arnaudgelas@gmail.com> wrote:
> > > > > Hi Malik,
> > > > > 
> > > > > First of all, I would recommend using MeshFileReader instead of \
> > > > > VTKPolyDataReader (I guess VTKPolyDataReader will be deprecated in near \
> > > > > future?). 
> > > > > Regarding now the smoothing procedure in itself. This class definitively \
> > > > > misses some documentation and I will be adding some in the next few days \
> > > > > (mainly extracted from the corresponding insight journal). 
> > > > > At the end of each iteration, when the delaunay conforming flag is turned \
> > > > > ON, the conformation is performed. So depending on the mesh configuration, \
> > > > > mesh size and number of iterations, it can take ages… How large is your \
> > > > > input mesh (number of points)? 
> > > > > You can also check results, by running first a smoothing without delaunay \
> > > > > conforming, then apply a delaunay conforming on the output. Results won't \
> > > > > be as nice, but you should get significant speed improvement. Another \
> > > > > possibility is to first do a clean poly data in vtk, with a small threshold \
> > > > > to remove small edges in the input meshes (which results in lots of edge \
> > > > > flipping after smoothing). 
> > > > > HTH
> > > > > Arnaud
> > > > > 
> > > > > 
> > > > > On Aug 6, 2014, at 10:42 AM, Mallikarjun K <mallikarjun49@gmail.com> wrote:
> > > > > 
> > > > > > Hi All,
> > > > > > 
> > > > > > Can anyone suggest me if anything wrong I am doing in this below pipeline \
> > > > > > ,Where I used itkVtkPolydataReader to convert vtk Surface polydata to Itk \
> > > > > > QuadedgeMesh. Execution loop is being hung up for sometime(4 to 5 mins in \
> > > > > > release mode) at itkVtkPolydataReader . 
> > > > > > 
> > > > > > ////
> > > > > > 
> > > > > > typedef itk::QuadEdgeMeshTraits<double, 3,double, double, double,double > \
> > > > > > qetraits;  
> > > > > > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType;
> > > > > > 
> > > > > > itk::OnesMatrixCoefficients< MeshType > coeff0;
> > > > > > 
> > > > > > typedef itk::VTKPolyDataReader< MeshType >VTKPolyDataReaderType;
> > > > > > //typedef itk::VTKPolyDataWriter< MeshType >VTKPolyDataWriterType;
> > > > > > 
> > > > > > //VTKPolyDataWriterType::Pointer \
> > > > > > ItkToVtkWriter=VTKPolyDataWriterType::New(); \
> > > > > > VTKPolyDataReaderType::Pointer \
> > > > > > VtkToItkReader=VTKPolyDataReaderType::New(); 
> > > > > > VtkToItkReader->SetFileName("abc.vtk");
> > > > > > VtkToItkReader->Update();	
> > > > > > 
> > > > > > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType >
> > > > > > SmoothingQuadEdgeMeshFilter;
> > > > > > 
> > > > > > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother =   \
> > > > > > SmoothingQuadEdgeMeshFilter::New();  
> > > > > > 
> > > > > > QEMeshSmoother->SetInput(VtkToItkReader->GetOutPut());
> > > > > > QEMeshSmoother->SetNumberOfIterations(5 );
> > > > > > QEMeshSmoother->SetRelaxationFactor( 0.5 );
> > > > > > QEMeshSmoother->SetDelaunayConforming(true );
> > > > > > QEMeshSmoother->SetCoefficientsMethod( &coeff0 );	
> > > > > > 	
> > > > > > QEMeshSmoother->Update();
> > > > > > 
> > > > > > ////
> > > > > > 
> > > > > > 
> > > > > > On Fri, Aug 1, 2014 at 4:36 PM, Mallikarjun K <mallikarjun49@gmail.com> \
> > > > > > wrote: Thanks Bill for your answer.
> > > > > > 
> > > > > > The reason I am using this pipeline is that SmoothingQEMeshFilter has an \
> > > > > > additional parameter for smoothing which is delaunay conforming which \
> > > > > > helps to optimize aspect ratio of triangles while smoothing and thus \
> > > > > > produces better output.Is there anything similar filter in the vtk \
> > > > > > pipeline.I used vtkWindowedSincPolydatafilter which is not giving the \
> > > > > > output as good as QEMeshSmoothing filter. 
> > > > > > Thanks for your help 
> > > > > > 
> > > > > > 
> > > > > > On Thu, Jul 31, 2014 at 5:14 PM, Bill Lorensen <bill.lorensen@gmail.com> \
> > > > > > wrote: If you have it in vtk, I suggest using the vtk pipeline to smooth \
> > > > > > the data. 
> > > > > > On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K <mallikarjun49@gmail.com> \
> > > > > > wrote:
> > > > > > > Hi Bill,
> > > > > > > Thanks for the replay.
> > > > > > > 
> > > > > > > Yes,I built both ITK and my app with Release ,I forgot to mention it in \
> > > > > > > the previous post.Actually the data set is the output of
> > > > > > > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I \
> > > > > > > saved this marching cube's output as .vtk file and read it using
> > > > > > > itkVTKPolyDataReader and then I am giving this reader's output to
> > > > > > > itkSmoothingQuadEdgeMeshFilter's input.
> > > > > > > 
> > > > > > > I checked the execution time of each step in the pipeline ,after
> > > > > > > SmothingQEMeshFilter has got it's input ,it is taking time to process \
> > > > > > > the data.
> > > > > > > 
> > > > > > > Thank you
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen \
> > > > > > > <bill.lorensen@gmail.com> wrote:
> > > > > > > > 
> > > > > > > > First, make sure you are building ITK and your app with Release. A
> > > > > > > > Debug build can be 10-50 times slower.
> > > > > > > > 
> > > > > > > > 
> > > > > > > > On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K \
> > > > > > > > <mallikarjun49@gmail.com> wrote:
> > > > > > > > > Hi All,
> > > > > > > > > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh
> > > > > > > > > smoothing.This
> > > > > > > > > filter is giving good results what I expected but taking more \
> > > > > > > > > execution time.can any one suggest me to reduce the execution time( \
> > > > > > > > > multi threading
> > > > > > > > > or any parameters to add/remove )?
> > > > > > > > > 
> > > > > > > > > Below is the code snippet
> > > > > > > > > ///////
> > > > > > > > > typedef itk::QuadEdgeMeshTraits<double, 3,double, double, \
> > > > > > > > > double,double
> > > > > > > > > > 
> > > > > > > > > qetraits;
> > > > > > > > > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > \
> > > > > > > > > MeshType; 
> > > > > > > > > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType;
> > > > > > > > > 
> > > > > > > > > itk::OnesMatrixCoefficients< MeshType > coeff0;
> > > > > > > > > 
> > > > > > > > > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType >
> > > > > > > > > SmoothingQuadEdgeMeshFilter;
> > > > > > > > > 
> > > > > > > > > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother =
> > > > > > > > > SmoothingQuadEdgeMeshFilter::New();
> > > > > > > > > 
> > > > > > > > > QEMeshSmoother->SetInput("abc.vtk");
> > > > > > > > > QEMeshSmoother->SetNumberOfIterations(5 );
> > > > > > > > > QEMeshSmoother->SetRelaxationFactor( 0.5 );
> > > > > > > > > QEMeshSmoother->SetDelaunayConforming(true );
> > > > > > > > > QEMeshSmoother->SetCoefficientsMethod( &coeff0 );
> > > > > > > > > QEMeshSmoother->Update();
> > > > > > > > > ////
> > > > > > > > > 
> > > > > > > > > --
> > > > > > > > > Regards:
> > > > > > > > > Mallik
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > _____________________________________
> > > > > > > > > Powered by www.kitware.com
> > > > > > > > > 
> > > > > > > > > Visit other Kitware open-source projects at
> > > > > > > > > http://www.kitware.com/opensource/opensource.html
> > > > > > > > > 
> > > > > > > > > Kitware offers ITK Training Courses, for more information visit:
> > > > > > > > > http://www.kitware.com/products/protraining.php
> > > > > > > > > 
> > > > > > > > > Please keep messages on-topic and check the ITK FAQ at:
> > > > > > > > > http://www.itk.org/Wiki/ITK_FAQ
> > > > > > > > > 
> > > > > > > > > Follow this link to subscribe/unsubscribe:
> > > > > > > > > http://public.kitware.com/mailman/listinfo/insight-users
> > > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > --
> > > > > > > > Unpaid intern in BillsBasement at noware dot com
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > --
> > > > > > > Regards:
> > > > > > > Mallik
> > > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > --
> > > > > > Unpaid intern in BillsBasement at noware dot com
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > -- 
> > > > > > Regards:
> > > > > > Mallik
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > -- 
> > > > > > Regards:
> > > > > > Mallik
> > > > > > 
> > > > > > _____________________________________
> > > > > > Powered by www.kitware.com
> > > > > > 
> > > > > > Visit other Kitware open-source projects at
> > > > > > http://www.kitware.com/opensource/opensource.html
> > > > > > 
> > > > > > Kitware offers ITK Training Courses, for more information visit:
> > > > > > http://www.kitware.com/products/protraining.php
> > > > > > 
> > > > > > Please keep messages on-topic and check the ITK FAQ at:
> > > > > > http://www.itk.org/Wiki/ITK_FAQ
> > > > > > 
> > > > > > Follow this link to subscribe/unsubscribe:
> > > > > > http://public.kitware.com/mailman/listinfo/insight-users
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > -- 
> > > > > Regards:
> > > > > Mallik
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > -- 
> > > > > Regards:
> > > > > Mallik
> > > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > -- 
> > > > Regards:
> > > > Mallik
> > > > 
> > > > <temp.vtk>
> > > 
> > > 
> > > 
> > > 
> > > -- 
> > > Regards:
> > > Mallik
> > > 
> > 
> > 
> > 
> > 
> > -- 
> > Regards:
> > Mallik
> > 
> 


[Attachment #5 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html \
charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: \
space; -webkit-line-break: after-white-space; ">Here is the patch (for progress \
report):<div><br></div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span><a \
href="http://review.source.kitware.com/#/c/16769/">http://review.source.kitware.com/#/c/16769/</a></div><div><br><div><div>On \
Aug 21, 2014, at 12:47 PM, Arnaud Gelas &lt;<a \
href="mailto:arnaudgelas@gmail.com">arnaudgelas@gmail.com</a>&gt; wrote:</div><br \
class="Apple-interchange-newline"><blockquote type="cite"><meta \
http-equiv="Content-Type" content="text/html charset=windows-1252"><div \
style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: \
after-white-space; ">Hi,<div><br></div><div>As of now, there is no progress event on \
this filter, so it is normal nothing happened.</div><div><br></div><div>I'll submit \
another patch for progress event later today.</div><div><br></div><div>To review the \
patch, you need to create an account on gerrit:</div><div><br></div><div><span \
class="Apple-tab-span" style="white-space:pre">	</span><a \
href="http://review.source.kitware.com/">http://review.source.kitware.com</a></div><div><br></div><div>Then \
you ca volunteer to the review patch, you can add comments, accept, \
refuse…</div><div>Else once you are registered, you can send me an email and I will \
add you as a reviewer.</div><div><br></div><div>Best,</div><div>Arnaud</div><div><br></div><div><div><div>On \
Aug 21, 2014, at 12:11 PM, Mallikarjun K &lt;<a \
href="mailto:mallikarjun49@gmail.com">mallikarjun49@gmail.com</a>&gt; wrote:</div><br \
class="Apple-interchange-newline"><blockquote type="cite"><div \
dir="ltr">Hi,<div>&nbsp;I am trying observe the progressEvent by using AddObserver \
method of this filter but I couldn't. Could you check the below code \
once.</div><div><br></div><div>And one more thing,Could you guide me what exactly I \
have to do to Review the patch you have submitted.</div> <div><br></div><div>Thank \
you</div><div><br></div><div><br></div><div>///progress</div><div><br></div><div>#incl \
ude&lt;iostream&gt;</div><div>#include&lt;string&gt;</div><div><br></div><div>#include \
&lt;itkMeshFileWriter.h&gt;</div> <div>#include \
&lt;itkMeshFileReader.h&gt;</div><div>#include \
&lt;itkMeshIOFactory.h&gt;</div><div>#include \
&lt;itkMeshIOBase.h&gt;</div><div>#include "itkMesh.h"</div><div>#include \
"itkQuadEdgeMesh.h"</div> <div>#include "itkQuadEdgeMeshTraits.h"</div><div>#include \
"itkSmoothingQuadEdgeMeshFilter.h"</div><div>#include \
"itkCommand.h"</div><div><br></div><div>class MyCommand : public itk::Command</div> \
<div>{</div><div>&nbsp; public:</div><div>&nbsp; &nbsp; itkNewMacro( MyCommand \
);</div><div>&nbsp;</div><div>&nbsp; public:</div><div>&nbsp;</div><div>&nbsp; &nbsp; \
void Execute(itk::Object *caller, const itk::EventObject &amp; \
event)</div><div>&nbsp; &nbsp; {</div><div> &nbsp; &nbsp; &nbsp; Execute( (const \
itk::Object *)caller, event);</div><div>&nbsp; &nbsp; \
}</div><div>&nbsp;</div><div>&nbsp; &nbsp; void Execute(const itk::Object * object, \
const itk::EventObject &amp; event)</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; \
&nbsp; std::cout &lt;&lt; "Command called." &lt;&lt; std::endl;</div> \
<div><br></div><div><span class="" style="white-space:pre">	</span> &nbsp;if( typeid( \
itk::ProgressEvent ) == &nbsp;typeid( event ) )</div><div>&nbsp; &nbsp; &nbsp; \
&nbsp;{</div><div><span class="" style="white-space:pre">		</span> &nbsp; \
::itk::ProcessObject::ConstPointer &nbsp;process =&nbsp;</div> <div>&nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dynamic_cast&lt; const itk::ProcessObject *&gt;( \
object/*caller*/ );</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;const int value = static_cast&lt;int&gt;(process-&gt;GetProgress() * 100 \
);</div><div><span class="" style="white-space:pre">		</span> &nbsp; \
std::cout&lt;&lt;"progress:"&lt;&lt;value&lt;&lt;std::endl; &nbsp;&nbsp;</div> \
<div><span class="" style="white-space:pre">		</span> &nbsp;<span class="" \
style="white-space:pre">	</span> &nbsp;</div><div><br></div><div>&nbsp; &nbsp; \
&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;}</div><div><br></div><div>&nbsp; \
&nbsp; }</div><div>&nbsp;</div><div>};</div><div> <br></div><div>int main( int argc, \
char* argv[] )</div><div>{</div><div><br></div><div><span class="" \
style="white-space:pre">	</span>/*if( argc &lt; 2 )</div><div>&nbsp; &nbsp; \
{</div><div>&nbsp; &nbsp; std::cerr &lt;&lt; "Usage: " &lt;&lt; std::endl;</div> \
<div>&nbsp; &nbsp; std::cerr &lt;&lt; argv[0] &lt;&lt; " &nbsp;inputImageFile &nbsp; \
outputImageFile &nbsp; flipAxisX &nbsp; flipAxisY" &lt;&lt; \
std::endl;</div><div>&nbsp; &nbsp; return EXIT_FAILURE;</div><div>&nbsp; &nbsp; \
}*/</div><div><br></div><div><span class="" \
style="white-space:pre">	</span>std::string Inputfilename="D:<a \
href="smb://temp.vtk">\\temp.vtk</a>";</div> <div>&nbsp; typedef \
itk::QuadEdgeMeshTraits&lt;double, 3,double, double, double,double &gt; \
qetraits;&nbsp;</div><div>&nbsp; typedef itk::QuadEdgeMesh&lt; double, 3,qetraits \
&gt; MeshType;</div><div>&nbsp;&nbsp;</div><div>&nbsp; \
itk::OnesMatrixCoefficients&lt; MeshType &gt; coeff0;</div> <div>&nbsp; typedef \
itk::SmoothingQuadEdgeMeshFilter&lt; MeshType, MeshType \
&gt;SmoothingQuadEdgeMeshFilter;</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; \
&nbsp; SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = \
SmoothingQuadEdgeMeshFilter::New();</div> <div>&nbsp;</div><div>&nbsp; typedef \
itk::MeshFileReader&lt;MeshType&gt; MeshReaderType;</div><div>&nbsp; \
MeshReaderType::Pointer Meshreader = MeshReaderType::New();</div><div>&nbsp; \
Meshreader-&gt;SetFileName( Inputfilename.c_str()/*argv[1]*/ );</div> <div>&nbsp;// \
Meshreader-&gt;Update();</div><div>&nbsp;&nbsp;</div><div>&nbsp;&nbsp;</div><div>&nbsp; \
MyCommand::Pointer myCommand = MyCommand::New();</div><div><br></div><div>&nbsp; \
QEMeshSmoother-&gt;SetInput(Meshreader-&gt;GetOutput() );</div><div>&nbsp; \
QEMeshSmoother-&gt;SetNumberOfIterations( 1 );</div> <div>&nbsp; \
QEMeshSmoother-&gt;SetRelaxationFactor( 0.5 );</div><div>&nbsp; \
QEMeshSmoother-&gt;SetDelaunayConforming(true);</div><div>&nbsp; \
QEMeshSmoother-&gt;SetCoefficientsMethod( &amp;coeff0 );&nbsp;</div><div>&nbsp; \
QEMeshSmoother-&gt;AddObserver(itk::ProgressEvent, myCommand);</div> \
<div>&nbsp;&nbsp;</div><div>&nbsp;// QEMeshSmoother-&gt;Update();</div><div>&nbsp; \
std::string Outputfilename="D:<a \
href="smb://tempOut2.vtk">\\tempOut2.vtk</a>";</div><div>&nbsp; \
&nbsp;&nbsp;</div><div>&nbsp; typedef itk::MeshFileWriter&lt;MeshType&gt; \
MeshWriterType;</div><div>&nbsp; MeshWriterType::Pointer Meshwriter = \
MeshWriterType::New();</div> <div>&nbsp; \
Meshwriter-&gt;SetFileName(Outputfilename.c_str() /*argv[2]*/ );</div><div>&nbsp; \
Meshwriter-&gt;SetInput(QEMeshSmoother-&gt;GetOutput());</div><div><br></div><div>&nbsp; \
try</div><div>&nbsp; {</div><div>&nbsp; &nbsp; Meshwriter-&gt;Update();</div> \
<div>&nbsp; }</div><div>&nbsp; catch( itk::ExceptionObject&amp; e )</div><div>&nbsp; \
{</div><div>&nbsp; &nbsp; std::cerr &lt;&lt; e.what() &lt;&lt; \
std::endl;</div><div>&nbsp; }</div><div><br></div><div>&nbsp; return \
0;</div><div><br></div><div>&nbsp;&nbsp;</div><div> }&nbsp;</div></div><div \
class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 20, 2014 at 7:33 PM, \
Arnaud Gelas <span dir="ltr">&lt;<a href="mailto:arnaudgelas@gmail.com" \
target="_blank">arnaudgelas@gmail.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>I \
have just submitted this patch for the documentation, can you please review it?</div> \
<div><br></div><div><span style="white-space:pre-wrap">	</span><a \
href="http://review.source.kitware.com/#/c/16755/" \
target="_blank">http://review.source.kitware.com/#/c/16755/</a></div><div><br></div><div>I \
was running this code on Mac i5 with 4GB RAM, with both ITK and this program compiled \
in Debug…</div> <div><br></div><div>Best,</div><div>Arnaud</div><div><div \
class="h5"><br><div><div>On Aug 7, 2014, at 5:20 PM, Mallikarjun K &lt;<a \
href="mailto:mallikarjun49@gmail.com" target="_blank">mallikarjun49@gmail.com</a>&gt; \
wrote:</div> <br><blockquote type="cite"><div dir="ltr">Hi \
Arnaud,<div><br></div><div>Thanks,Can you please tell me your machine confuguration. \
I am running 4GB RAM,i3 &nbsp;on windows7.</div><div>I have downloaded your project \
and tried to execute it and it is still the same problem Which I was facing \
earlier.Any suggestions .....</div>

<div><br></div><div>thank you&nbsp;</div></div><div class="gmail_extra"><br><br><div \
class="gmail_quote">On Thu, Aug 7, 2014 at 8:10 PM, Arnaud Gelas <span \
dir="ltr">&lt;<a href="mailto:arnaudgelas@gmail.com" \
target="_blank">arnaudgelas@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div style="word-wrap:break-word">It takes 29s on my machine \
in debug to run 5 iterations with Delaunay conforming set to true<div>

<br></div><div><a href="https://gist.github.com/arnaudgelas/0f20ebdaf53956f79997" \
target="_blank">https://gist.github.com/arnaudgelas/0f20ebdaf53956f79997</a></div><div><br></div><div><br><div><div><div>On \
Aug 7, 2014, at 3:45 PM, Mallikarjun K &lt;<a href="mailto:mallikarjun49@gmail.com" \
target="_blank">mallikarjun49@gmail.com</a>&gt; wrote:</div>

<br></div><blockquote type="cite"><div><div dir="ltr">File path is correct.if it is \
'\'(backward slash) we have to add "D:\\" .since I used '/' it's not required to add \
"//".<div>

<br></div><div>please find the attached &nbsp;.vtk file&nbsp;</div>
<div><br></div><div>Thanks</div></div><div class="gmail_extra"><br><br><div \
class="gmail_quote">On Thu, Aug 7, 2014 at 7:01 PM, Arnaud Gelas <span \
dir="ltr">&lt;<a href="mailto:arnaudgelas@gmail.com" \
target="_blank">arnaudgelas@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div style="word-wrap:break-word">Shouldn't it be \
<a>D://temp.vtk</a> ? Isn't it missing one '/' ?<div>


<br></div><div>Can you send this vtk file?<div><br><div><br><div><div>On Aug 7, 2014, \
at 3:23 PM, Mallikarjun K &lt;<a href="mailto:mallikarjun49@gmail.com" \
target="_blank">mallikarjun49@gmail.com</a>&gt; wrote:</div>

<br><blockquote type="cite"><div dir="ltr">Hi Arnaud,<div><br></div><div>Kindly have \
a look in the below code ,the problem &nbsp;is that even after QEMeshFilter output is \
saved as .stl file ,the program is still running for long time.I have observed in my \
tests that MeshFileReader seems to be the culprit. Any suggestions ?</div>



<div><br></div><div>/////</div><div><div>#include&lt;iostream&gt;</div><div>#include&lt;string&gt;</div><div><br></div><div>#include \
&lt;vtkPolyDataWriter.h&gt;</div><div>#include \
&lt;vtkPolyDataReader.h&gt;</div><div>#include &lt;itkMeshFileWriter.h&gt;</div>



<div>#include &lt;itkMeshFileReader.h&gt;</div><div>#include \
&lt;itkMeshIOFactory.h&gt;</div><div>#include \
&lt;itkMeshIOBase.h&gt;</div><div>#include \
&lt;vtkTriangleFilter.h&gt;</div><div>#include &lt;vtkCleanPolyData.h&gt;</div>



<div>#include "itkMesh.h"</div><div>#include "itkQuadEdgeMesh.h"</div><div>#include \
"itkQuadEdgeMeshTraits.h"</div><div>#include \
"itkSmoothingQuadEdgeMeshFilter.h"</div><div>#include "vtkSTLWriter.h"</div>



<div>#include &lt;vtkSmartPointer.h&gt;</div><div><br></div><div>int \
main()</div><div>{</div><div><span style="white-space:pre-wrap">	</span>std::string \
Inputfilename="D:/temp.vtk"; &nbsp; //number of points of this mesh file is around \
78K</div>



<div><br></div><div><span style="white-space:pre-wrap">	</span>typedef \
itk::QuadEdgeMeshTraits&lt;double, 3,double, double, double,double &gt; \
qetraits;<span style="white-space:pre-wrap">	</span></div><div><span \
style="white-space:pre-wrap">	</span>typedef itk::QuadEdgeMesh&lt; \
vtkFloatingPointType, 3,qetraits &gt; MeshType;</div>



<div><span style="white-space:pre-wrap">	</span></div><div><span \
style="white-space:pre-wrap">	</span>itk::OnesMatrixCoefficients&lt; MeshType &gt; \
coeff0;</div><div><span style="white-space:pre-wrap">	</span>typedef \
itk::SmoothingQuadEdgeMeshFilter&lt; MeshType, MeshType \
&gt;SmoothingQuadEdgeMeshFilter;</div>



<div>&nbsp; &nbsp;&nbsp;</div><div><span \
style="white-space:pre-wrap">	</span>vtkSmartPointer&lt;vtkPolyDataWriter&gt; \
polyDatawriter=vtkSmartPointer&lt;vtkPolyDataWriter&gt;::New();</div><div><span \
style="white-space:pre-wrap">	</span>vtkSmartPointer&lt;vtkPolyDataReader&gt; \
polyDatareader=vtkSmartPointer&lt;vtkPolyDataReader&gt;::New();</div>



<div>&nbsp; &nbsp;</div><div>&nbsp; &nbsp; SmoothingQuadEdgeMeshFilter::Pointer \
QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New();</div><div><span \
style="white-space:pre-wrap">	</span></div><div>&nbsp; &nbsp;/* \
polyDatareader-&gt;SetFileName(Inputfilename.c_str() );</div>



<div><span style="white-space:pre-wrap">	</span>polyDatareader-&gt;ReleaseDataFlagOn();</div><div><span \
style="white-space:pre-wrap">	</span>polyDatareader-&gt;Update();*/</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>/*vtkSmartPointer&lt;vtkTriangleFilter&gt; \
triangleFilter =</div>



<div>&nbsp; &nbsp; vtkSmartPointer&lt;vtkTriangleFilter&gt;::New();</div><div>&nbsp; \
&nbsp; triangleFilter-&gt;SetInput(polyDatareader-&gt;GetOutput());</div><div>&nbsp; \
&nbsp; triangleFilter-&gt;Update();*/</div><div>&nbsp;&nbsp;</div><div><span \
style="white-space:pre-wrap">	</span>//</div>



<div><span style="white-space:pre-wrap">	</span>/* \
vtkSmartPointer&lt;vtkCleanPolyData&gt; clean = \
vtkSmartPointer&lt;vtkCleanPolyData&gt;::New();</div><div><span \
style="white-space:pre-wrap">	</span>#if (VTK_MAJOR_VERSION &lt; 6)</div>



<div><span style="white-space:pre-wrap">	</span> \
clean-&gt;SetInput(triangleFilter-&gt;GetOutput() );</div><div><span \
style="white-space:pre-wrap">	</span>#else</div><div>&nbsp; &nbsp; &nbsp; \
&nbsp;clean-&gt;SetInputData(triangleFilter-&gt;GetOutput() );</div>



<div><span style="white-space:pre-wrap">	</span>#endif</div><div><span \
style="white-space:pre-wrap">	</span></div><div>&nbsp; &nbsp; \
clean-&gt;ConvertPolysToLinesOff();</div><div>&nbsp; &nbsp; \
clean-&gt;ConvertLinesToPointsOff();</div> <div>&nbsp; &nbsp; \
clean-&gt;Update();</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>std::string \
Inputfilename2="D:/cleaned.vtk";*/</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>////</div>



<div><span style="white-space:pre-wrap">	</span>/*polyDatawriter-&gt;SetInput(clean-&gt;GetOutput());<span \
style="white-space:pre-wrap">	</span></div><div><span \
style="white-space:pre-wrap">	</span>polyDatawriter-&gt;SetFileName(Inputfilename2.c_str());</div>




<div><span style="white-space:pre-wrap">	</span>polyDatawriter-&gt;ReleaseDataFlagOn();</div><div><span \
style="white-space:pre-wrap">	</span>polyDatawriter-&gt;Write(); \
*/&nbsp;</div><div>&nbsp;&nbsp;</div><div><span \
style="white-space:pre-wrap">	</span>typedef itk::MeshFileReader&lt;MeshType&gt; \
MeshReaderType;</div>



<div><span style="white-space:pre-wrap">	</span>MeshReaderType::Pointer Meshreader = \
MeshReaderType::New();</div><div>&nbsp; &nbsp; &nbsp; \
&nbsp;Meshreader-&gt;SetFileName(Inputfilename.c_str( ));</div><div><span \
style="white-space:pre-wrap">	</span>Meshreader-&gt;Update();</div>



<div><br></div><div><span style="white-space:pre-wrap">	</span>/*MeshType::Pointer \
mesh = &nbsp;Meshreader-&gt;GetOutput();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;mesh-&gt;DisconnectPipeline();*/</div><div><span \
style="white-space:pre-wrap">	</span></div>



<div><br></div><div><span \
style="white-space:pre-wrap">	</span>QEMeshSmoother-&gt;SetInput(Meshreader-&gt;GetOutput()/*mesh*/ \
);</div><div><span style="white-space:pre-wrap">	</span>QEMeshSmoother-&gt;SetNumberOfIterations(1 \
);</div>



<div><span style="white-space:pre-wrap">	</span>QEMeshSmoother-&gt;SetRelaxationFactor( \
0.5 );</div><div><span \
style="white-space:pre-wrap">	</span>QEMeshSmoother-&gt;SetDelaunayConforming(true);</div><div><span \
style="white-space:pre-wrap">	</span>QEMeshSmoother-&gt;SetCoefficientsMethod( \
&amp;coeff0 );</div>



<div><br></div><div><span \
style="white-space:pre-wrap">	</span>QEMeshSmoother-&gt;ReleaseDataFlagOn();</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>QEMeshSmoother-&gt;Update();<span \
style="white-space:pre-wrap">	</span></div>



<div>&nbsp; &nbsp;&nbsp;</div><div><span \
style="white-space:pre-wrap">	</span>std::string \
Outputfilename="D:/tempOut.vtk";</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>typedef itk::MeshFileWriter&lt;MeshType&gt; \
MeshWriterType;</div>



<div><span style="white-space:pre-wrap">	</span>MeshWriterType::Pointer Meshwriter = \
MeshWriterType::New();</div><div>&nbsp; &nbsp; &nbsp; \
&nbsp;Meshwriter-&gt;SetFileName(Outputfilename.c_str( ));</div><div><span \
style="white-space:pre-wrap">	</span>Meshwriter-&gt;SetInput(QEMeshSmoother-&gt;GetOutput());</div>




<div>&nbsp; &nbsp; &nbsp; &nbsp;Meshwriter-&gt;Update();<span \
style="white-space:pre-wrap">	</span></div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>polyDatareader-&gt;SetFileName(Outputfilename.c_str() \
);</div><div> <span style="white-space:pre-wrap">	</span>polyDatareader-&gt;ReleaseDataFlagOn();</div><div><span \
style="white-space:pre-wrap">	</span>polyDatareader-&gt;Update();</div><div><br></div><div><span \
style="white-space:pre-wrap">	</span>vtkSmartPointer&lt;vtkSTLWriter&gt; \
stlWriter=vtkSmartPointer&lt;vtkSTLWriter&gt;::New();</div>



<div><span style="white-space:pre-wrap">	</span></div><div><span \
style="white-space:pre-wrap">	</span>stlWriter-&gt;SetInput( \
polyDatareader-&gt;GetOutput());</div><div><span \
style="white-space:pre-wrap">	</span>stlWriter-&gt;SetFileName("D:/QEoutput.stl");</div>




<div><span style="white-space:pre-wrap">	</span>stlWriter-&gt;SetFileTypeToASCII();</div><div><span \
style="white-space:pre-wrap">	</span>stlWriter-&gt;Write();</div><div><span \
style="white-space:pre-wrap">	</span></div> <div><span \
style="white-space:pre-wrap">	</span>//Here it stops and taking long \
time&nbsp;</div><div><br></div><div><span style="white-space:pre-wrap">	</span>return \
0;</div><div><br></div><div><span style="white-space:pre-wrap">	</span></div>



<div>}</div></div><div>////</div><div><br></div></div><div \
class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 7, 2014 at 3:39 PM, \
Mallikarjun K <span dir="ltr">&lt;<a href="mailto:mallikarjun49@gmail.com" \
target="_blank">mallikarjun49@gmail.com</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hi Arnaud,<div><br></div><div>Thanks for your \
reply and valuable suggestions.</div><div class="gmail_extra">



<br></div><div class="gmail_extra">Number of points in my input mesh are 78928.In my \
pipeline I am already cleaning the polydata using vtkCleanPolyData filter.I will \
check the speed improvement and results with delaunay conforming turned OFF.</div>




<div class="gmail_extra"><br></div><div class="gmail_extra">Thank you</div><div \
class="gmail_extra"><div><br><br><div class="gmail_quote">On Thu, Aug 7, 2014 at 2:22 \
PM, Arnaud Gelas <span dir="ltr">&lt;<a href="mailto:arnaudgelas@gmail.com" \
target="_blank">arnaudgelas@gmail.com</a>&gt;</span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div \
style="word-wrap:break-word">Hi Malik,<div><br></div>




<div>First of all, I would recommend using MeshFileReader instead of \
VTKPolyDataReader (I guess VTKPolyDataReader will be deprecated in near \
future?).</div><div><br></div><div>Regarding now the smoothing procedure in itself. \
This class definitively misses some documentation and I will be adding some in the \
next few days (mainly extracted from the corresponding insight journal).</div>




<div><br></div><div>At the end of each iteration, when the delaunay conforming flag \
is turned ON, the conformation is performed. So depending on the mesh configuration, \
mesh size and number of iterations, it can take ages…</div>




<div>How large is your input mesh (number of points)?</div><div><br></div><div>You \
can also check results, by running first a smoothing without delaunay conforming, \
then apply a delaunay conforming on the output. Results won't be as nice, but you \
should get significant speed improvement.</div>




<div>Another possibility is to first do a clean poly data in vtk, with a small \
threshold to remove small edges in the input meshes (which results in lots of edge \
flipping after smoothing).</div><div><br></div><div>HTH</div>




<span><font color="#888888">Arnaud</font></span><div><div><br></div><div><br><div><div>On \
Aug 6, 2014, at 10:42 AM, Mallikarjun K &lt;<a href="mailto:mallikarjun49@gmail.com" \
target="_blank">mallikarjun49@gmail.com</a>&gt; wrote:</div>




<br><blockquote type="cite"><div dir="ltr">Hi All,<div><br></div><div>Can anyone \
suggest me if anything wrong I am doing in this below pipeline ,Where I used \
itkVtkPolydataReader to convert vtk Surface polydata to Itk QuadedgeMesh. Execution \
loop is being hung up for sometime(4 to 5 mins in release mode) at \
itkVtkPolydataReader .</div>





<div><br></div><div><br></div><div>////</div><div><br></div><div><div \
style="font-size:13px;font-family:arial,sans-serif">typedef \
itk::QuadEdgeMeshTraits&lt;double, 3,double, double, double,double &gt; \
qetraits;</div><div style="font-size:13px;font-family:arial,sans-serif">





<span style="white-space:pre-wrap">	</span><br></div><div \
style="font-size:13px;font-family:arial,sans-serif">typedef itk::QuadEdgeMesh&lt; \
vtkFloatingPointType, 3,qetraits &gt; MeshType;</div></div><div \
style="font-size:13px;font-family:arial,sans-serif">





<br></div><div style="font-size:13px;font-family:arial,sans-serif">itk::OnesMatrixCoefficients&lt; \
MeshType &gt; coeff0;<br></div><div><br><div><div>typedef itk::VTKPolyDataReader&lt; \
MeshType &gt;VTKPolyDataReaderType;</div>





<div>//typedef itk::VTKPolyDataWriter&lt; MeshType \
&gt;VTKPolyDataWriterType;</div><div><br></div><div><div>//VTKPolyDataWriterType::Pointer \
ItkToVtkWriter=VTKPolyDataWriterType::New();</div><div>VTKPolyDataReaderType::Pointer \
VtkToItkReader=VTKPolyDataReaderType::New();</div>





<div><br></div><div><div>VtkToItkReader-&gt;SetFileName("abc.vtk");</div><div>VtkToItkReader-&gt;Update();<span \
style="white-space:pre-wrap;font-family:arial,sans-serif;font-size:13px">	</span></div></div><div>





<div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">typedef \
itk::SmoothingQuadEdgeMeshFilter&lt; MeshType, MeshType &gt;</div><div \
style="font-family:arial,sans-serif;font-size:13px">SmoothingQuadEdgeMeshFilter;</div>






<div style="font-family:arial,sans-serif;font-size:13px"><div><br></div><div>&nbsp;SmoothingQuadEdgeMeshFilter::Pointer \
QEMeshSmoother = &nbsp; SmoothingQuadEdgeMeshFilter::New();</div><div><span \
style="white-space:pre-wrap">	</span></div>





<div><br></div><div>QEMeshSmoother-&gt;SetInput(<span \
style="font-family:arial;font-size:small">VtkToItkReader-&gt;GetOutPut()</span>);</div><div>QEMeshSmoother-&gt;SetNumberOfIterations(5 \
);</div><div>QEMeshSmoother-&gt;SetRelaxationFactor( 0.5 );</div>





<div>QEMeshSmoother-&gt;SetDelaunayConforming(true \
);</div><div>QEMeshSmoother-&gt;SetCoefficientsMethod( &amp;coeff0 );<span \
style="white-space:pre-wrap">	</span></div><div><span \
style="white-space:pre-wrap">	</span></div>





<div>QEMeshSmoother-&gt;Update();</div><div><br></div><div>////</div></div></div></div></div></div></div><div \
class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 1, 2014 at 4:36 PM, \
Mallikarjun K <span dir="ltr">&lt;<a href="mailto:mallikarjun49@gmail.com" \
target="_blank">mallikarjun49@gmail.com</a>&gt;</span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div \
dir="ltr">Thanks Bill for your answer.<div><br></div>




<div>The reason I am using this pipeline is that SmoothingQEMeshFilter has an \
additional parameter for smoothing which is delaunay conforming which helps to \
optimize aspect ratio of triangles while smoothing and thus produces better output.Is \
there anything similar filter in the vtk pipeline.I used \
vtkWindowedSincPolydatafilter which is not giving the output as good as \
QEMeshSmoothing filter.</div>






<div><br></div><div>Thanks for your help&nbsp;</div></div><div \
class="gmail_extra"><div><br><br><div class="gmail_quote">On Thu, Jul 31, 2014 at \
5:14 PM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com" \
target="_blank">bill.lorensen@gmail.com</a>&gt;</span> wrote:<br>






<blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">If \
you have it in vtk, I suggest using the vtk pipeline to smooth the data.<br>





<div><br>
On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K &lt;<a \
href="mailto:mallikarjun49@gmail.com" target="_blank">mallikarjun49@gmail.com</a>&gt; \
wrote:<br> &gt; Hi Bill,<br>
&gt; Thanks for the replay.<br>
&gt;<br>
&gt; Yes,I built both ITK and my app with Release ,I forgot to mention it in the<br>
&gt; previous post.Actually the data set is the output of<br>
&gt; vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I saved<br>
&gt; this marching cube's output as .vtk file and read it using<br>
&gt; itkVTKPolyDataReader and then I am giving this reader's output to<br>
&gt; itkSmoothingQuadEdgeMeshFilter's input.<br>
&gt;<br>
&gt; I checked the execution time of each step in the pipeline ,after<br>
&gt; SmothingQEMeshFilter has got it's input ,it is taking time to process the<br>
&gt; data.<br>
&gt;<br>
&gt; Thank you<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen &lt;<a \
href="mailto:bill.lorensen@gmail.com" \
target="_blank">bill.lorensen@gmail.com</a>&gt;<br> &gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; First, make sure you are building ITK and your app with Release. A<br>
&gt;&gt; Debug build can be 10-50 times slower.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K &lt;<a \
href="mailto:mallikarjun49@gmail.com" \
target="_blank">mallikarjun49@gmail.com</a>&gt;<br> &gt;&gt; wrote:<br>
&gt;&gt; &gt; Hi All,<br>
&gt;&gt; &gt; I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh<br>
&gt;&gt; &gt; smoothing.This<br>
&gt;&gt; &gt; filter is giving good results what I expected but taking more \
execution<br> &gt;&gt; &gt; time.can any one suggest me to reduce the execution time( \
multi<br> &gt;&gt; &gt; threading<br>
&gt;&gt; &gt; or any parameters to add/remove )?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Below is the code snippet<br>
&gt;&gt; &gt; ///////<br>
&gt;&gt; &gt; typedef itk::QuadEdgeMeshTraits&lt;double, 3,double, double, \
double,double<br> &gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; qetraits;<br>
&gt;&gt; &gt; typedef itk::QuadEdgeMesh&lt; vtkFloatingPointType, 3,qetraits &gt; \
MeshType;<br> &gt;&gt; &gt;<br>
&gt;&gt; &gt; //typedef itk::QuadEdgeMesh&lt; vtkFloatingPointType, 3 &gt; \
MeshType;<br> &gt;&gt; &gt;<br>
&gt;&gt; &gt; itk::OnesMatrixCoefficients&lt; MeshType &gt; coeff0;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; typedef itk::SmoothingQuadEdgeMeshFilter&lt; MeshType, MeshType \
&gt;<br> &gt;&gt; &gt; SmoothingQuadEdgeMeshFilter;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &nbsp; &nbsp; SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother =<br>
&gt;&gt; &gt; SmoothingQuadEdgeMeshFilter::New();<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; QEMeshSmoother-&gt;SetInput("abc.vtk");<br>
&gt;&gt; &gt; QEMeshSmoother-&gt;SetNumberOfIterations(5 );<br>
&gt;&gt; &gt; QEMeshSmoother-&gt;SetRelaxationFactor( 0.5 );<br>
&gt;&gt; &gt; QEMeshSmoother-&gt;SetDelaunayConforming(true );<br>
&gt;&gt; &gt; QEMeshSmoother-&gt;SetCoefficientsMethod( &amp;coeff0 );<br>
&gt;&gt; &gt; QEMeshSmoother-&gt;Update();<br>
&gt;&gt; &gt; ////<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; Regards:<br>
&gt;&gt; &gt; Mallik<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _____________________________________<br>
&gt;&gt; &gt; Powered by <a href="http://www.kitware.com/" \
target="_blank">www.kitware.com</a><br> &gt;&gt; &gt;<br>
&gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" \
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br> &gt;&gt; \
&gt;<br> &gt;&gt; &gt; Kitware offers ITK Training Courses, for more information \
visit:<br> &gt;&gt; &gt; <a href="http://www.kitware.com/products/protraining.php" \
target="_blank">http://www.kitware.com/products/protraining.php</a><br> &gt;&gt; \
&gt;<br> &gt;&gt; &gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt;&gt; &gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" \
target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br> &gt;&gt; &gt;<br>
&gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt; <a href="http://public.kitware.com/mailman/listinfo/insight-users" \
target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br> \
&gt;&gt; &gt;<br> &gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Unpaid intern in BillsBasement at noware dot com<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Regards:<br>
&gt; Mallik<br>
&gt;<br>
<br>
<br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
</div></blockquote></div><br><br clear="all"><div><br></div></div><span><font \
color="#888888">-- <br><div dir="ltr"><b \
style="font-family:tahoma,sans-serif">Regards:</b><br \
style="font-family:tahoma,sans-serif"> <span \
style="font-family:tahoma,sans-serif">Mallik</span><span \
style="font-family:tahoma,sans-serif"></span><div> <br></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><b \
style="font-family:tahoma,sans-serif">Regards:</b><br \
style="font-family:tahoma,sans-serif"><span \
style="font-family:tahoma,sans-serif">Mallik</span><span \
style="font-family:tahoma,sans-serif"></span><div>





<br></div></div>
</div>
_____________________________________<br>Powered by <a href="http://www.kitware.com/" \
target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects \
at<br><a href="http://www.kitware.com/opensource/opensource.html" \
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>




<br>Kitware offers ITK Training Courses, for more information visit:<br><a \
href="http://www.kitware.com/products/protraining.php" \
target="_blank">http://www.kitware.com/products/protraining.php</a><br><br>Please \
keep messages on-topic and check the ITK FAQ at:<br>




<a href="http://www.itk.org/Wiki/ITK_FAQ" \
target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to \
subscribe/unsubscribe:<br><a \
href="http://public.kitware.com/mailman/listinfo/insight-users" \
target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>




</blockquote></div><br></div></div></div></blockquote></div><br><br \
clear="all"><div><br></div></div><span><font color="#888888">-- <br><div dir="ltr"><b \
style="font-family:tahoma,sans-serif">Regards:</b><br \
style="font-family:tahoma,sans-serif">



<span style="font-family:tahoma,sans-serif">Mallik</span><span \
style="font-family:tahoma,sans-serif"></span><div> <br></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><b \
style="font-family:tahoma,sans-serif">Regards:</b><br \
style="font-family:tahoma,sans-serif"><span \
style="font-family:tahoma,sans-serif">Mallik</span><span \
style="font-family:tahoma,sans-serif"></span><div>



<br></div></div>
</div>
</blockquote></div><br></div></div></div></div></blockquote></div><br><br \
clear="all"><div><br></div>-- <br><div dir="ltr"><b \
style="font-family:tahoma,sans-serif">Regards:</b><br \
style="font-family:tahoma,sans-serif">

<span style="font-family:tahoma,sans-serif">Mallik</span><span \
style="font-family:tahoma,sans-serif"></span><div><br></div></div> </div>
</div><span>&lt;temp.vtk&gt;</span></blockquote></div><br></div></div></blockquote></div><br><br \
clear="all"><div><br></div>-- <br><div dir="ltr"><b \
style="font-family:tahoma,sans-serif">Regards:</b><br \
style="font-family:tahoma,sans-serif">

<span style="font-family:tahoma,sans-serif">Mallik</span><span \
style="font-family:tahoma,sans-serif"></span><div><br></div></div> </div>
</blockquote></div><br></div></div></div></blockquote></div><br><br \
clear="all"><div><br></div>-- <br><div dir="ltr"><b \
style="font-family:tahoma,sans-serif">Regards:</b><br \
style="font-family:tahoma,sans-serif"><span \
style="font-family:tahoma,sans-serif">Mallik</span><span \
style="font-family:tahoma,sans-serif"></span><div> <br></div></div>
</div>
</blockquote></div><br></div></div></blockquote></div><br></div></body></html>



_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic