[vtkusers] read raw data columnwise from vtkimageData

ankitramani ankitvtk at googlemail.com
Mon Jun 25 07:31:26 EDT 2012


Hello,

method 1
for(int i = 0; i<dim[0]; i++)
	{
		for(int j = 0; j&lt;dim[1]; j++)
		{
			for(int k = 0; k&lt;dim[2]; k++)
			{
                double v =
this->imageDataMandibular->GetScalarComponentAsDouble(i,j,k,0);
				value[i*dim[1]*dim[2]+j*dim[2]+k] = v;
			}
		}
	}

method 2
	double *data = new double[tuples];
	for (int i = 0; i<tuples; i++)
	{
		double val = imageArray->GetTuple1(i);
		data[i] = val;
	}

I am reading full data into double array. number of tuples is 22564000.
method 2 is alternative of method 1.

but, I want to read data columnwise from the vtkimagedata and then i wanted
to process these data to get my result.

please help me.

Thanx.

--
View this message in context: http://vtk.1045678.n5.nabble.com/read-raw-data-columnwise-from-vtkimageData-tp5714194.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list