Commit 970469ef authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED code indentation

parent 63d5fed8
......@@ -23,103 +23,103 @@
* $CAMITK_LICENCE_END$
****************************************************************************/
vtkSmartPointer<vtkImageData> RegionGrowing::implementProcess(vtkSmartPointer<vtkImageData> img)
{
vtkSmartPointer<vtkImageData> result = NULL;
if (img == NULL)
return result;
int * dims = img->GetDimensions();
int dim = 0;
if (dims[2] == 0)
dim = 2;
else
dim = 3;
int scalarType = img->GetScalarType();
switch (scalarType)
{
case VTK_CHAR :
if (dim == 2)
result = itkProcess<char, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<char, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_CHAR :
if (dim == 2)
result = itkProcess<unsigned char, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned char, unsigned char, 3>(img);
break;
case VTK_SIGNED_CHAR :
if (dim == 2)
result = itkProcess<signed char, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<signed char, unsigned char, 3>(img);
break;
case VTK_SHORT :
if (dim == 2)
result = itkProcess<short, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<short, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_SHORT :
if (dim == 2)
result = itkProcess<unsigned short, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned short, unsigned char, 3>(img);
break;
case VTK_INT :
if (dim == 2)
result = itkProcess<int, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<int, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_INT :
if (dim == 2)
result = itkProcess<unsigned int, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned int, unsigned char, 3>(img);
break;
case VTK_LONG :
if (dim == 2)
result = itkProcess<long, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<long, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_LONG :
if (dim == 2)
result = itkProcess<unsigned long, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned long, unsigned char, 3>(img);
break;
case VTK_FLOAT :
if (dim == 2)
result = itkProcess<float, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<float, unsigned char, 3>(img);
break;
case VTK_DOUBLE :
if (dim == 2)
result = itkProcess<double, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<double, unsigned char, 3>(img);
break;
default :
break;
}
return result;
}
vtkSmartPointer<vtkImageData> RegionGrowing::implementProcess(vtkSmartPointer<vtkImageData> img) {
vtkSmartPointer<vtkImageData> result = NULL;
if (img == NULL)
return result;
int* dims = img->GetDimensions();
int dim = 0;
if (dims[2] == 0)
dim = 2;
else
dim = 3;
int scalarType = img->GetScalarType();
switch (scalarType) {
case VTK_CHAR :
if (dim == 2)
result = itkProcess<char, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<char, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_CHAR :
if (dim == 2)
result = itkProcess<unsigned char, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned char, unsigned char, 3>(img);
break;
case VTK_SIGNED_CHAR :
if (dim == 2)
result = itkProcess<signed char, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<signed char, unsigned char, 3>(img);
break;
case VTK_SHORT :
if (dim == 2)
result = itkProcess<short, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<short, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_SHORT :
if (dim == 2)
result = itkProcess<unsigned short, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned short, unsigned char, 3>(img);
break;
case VTK_INT :
if (dim == 2)
result = itkProcess<int, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<int, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_INT :
if (dim == 2)
result = itkProcess<unsigned int, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned int, unsigned char, 3>(img);
break;
case VTK_LONG :
if (dim == 2)
result = itkProcess<long, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<long, unsigned char, 3>(img);
break;
case VTK_UNSIGNED_LONG :
if (dim == 2)
result = itkProcess<unsigned long, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<unsigned long, unsigned char, 3>(img);
break;
case VTK_FLOAT :
if (dim == 2)
result = itkProcess<float, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<float, unsigned char, 3>(img);
break;
case VTK_DOUBLE :
if (dim == 2)
result = itkProcess<double, unsigned char, 2>(img);
else // if dim == 3
result = itkProcess<double, unsigned char, 3>(img);
break;
default :
break;
}
return result;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment