itkImageType* im = bbGetInputIn().get<itkImageType*>();
unsigned int dim = im->GetImageDimension();
-
bbSetOutputTypeName(bbtk::TypeName<typename itkImageType::PixelType>());
bbSetOutputDimension(dim);
const typename itkImageType::RegionType& r =im->GetLargestPossibleRegion();
bbSetOutputLargestPossibleRegion(r);
-
+
const typename itkImageType::IndexType& ind = r.GetIndex();
std::vector<int> vind;
for (unsigned int i=0;i<dim;++i)
std::vector<int> vsz;
for (unsigned int i=0;i<dim;++i)
vsz.push_back(sz[i]);
-
+
// brute hack to avoid failure of most black boxes that expects 3D images. // JPR
if (dim==2)
vsz.push_back(1);
bbSetOutputSize(vsz);
+
+ const typename itkImageType::PointType& orgn = im->GetOrigin();
+ std::vector<float> vog;
+ for (unsigned int i=0;i<dim;++i)
+ vog.push_back(orgn[i]);
+
+ // brute hack to avoid failure of most black boxes that expects 3D images. // EC
+ if (dim==2)
+ vog.push_back(1.0);
+
+ bbSetOutputOrigin(vog);
typename itkImageType::SpacingType sp = im->GetSpacing();
std::vector<double> vsp;
vminmax.push_back( (float) (minMaxCalculator->GetMinimum()) );
vminmax.push_back( (float) (minMaxCalculator->GetMaximum()) );
bbSetOutputMinMax(vminmax);
-
- bbtkDebugDecTab("Core",9);
+
+ bbtkDebugDecTab("Core",9);
}
-}
-// eo namespace bbtk
+
+
+} // eo namespace bbtk
#endif