Esempio n. 1
0
InputParameters validParams<ImageFunction>()
{
  // Define the general parameters
  InputParameters params = validParams<Function>();
  params.addClassDescription("Function with values sampled from a given image stack");

  // Add parameters associated with file ranges
  addFileRangeParams(params);

  params.addParam<Point>("origin", "Origin of the image (defaults to mesh origin)");
  params.addParam<Point>("dimensions", "x,y,z dimensions of the image (defaults to mesh dimensions)");
  params.addParam<unsigned int>("component", "The image component to return, leaving this blank will result in a greyscale value "
                                             "for the image to be created. The component number is zero based, i.e. 0 returns the first component of the image");

  // Shift and Scale (application of these occurs prior to threshold)
  params.addParam<double>("shift", 0, "Value to add to all pixels; occurs prior to scaling");
  params.addParam<double>("scale", 1, "Multiplier to apply to all pixel values; occurs after shifting");
  params.addParamNamesToGroup("shift scale", "Rescale");

  // Threshold parameters
  params.addParam<double>("threshold", "The threshold value");
  params.addParam<double>("upper_value", "The value to set for data greater than the threshold value");
  params.addParam<double>("lower_value", "The value to set for data less than the threshold value");
  params.addParamNamesToGroup("threshold upper_value lower_value", "Threshold");

  // Flip image
  params.addParam<bool>("flip_x", false, "Flip the image along the x-axis");
  params.addParam<bool>("flip_y", false, "Flip the image along the y-axis");
  params.addParam<bool>("flip_z", false, "Flip the image along the z-axis");
  params.addParamNamesToGroup("flip_x flip_y flip_z", "Flip");

  return params;
}
Esempio n. 2
0
InputParameters validParams<ImageMesh>()
{
  InputParameters params = validParams<GeneratedMesh>();

  // Add parameters associated with file ranges
  addFileRangeParams(params);

  // Add ImageMesh-specific params
  params.addParam<bool>("scale_to_one", true, "Whether or not to scale the image so its max dimension is 1");
  params.addRangeCheckedParam<Real>("cells_per_pixel", 1.0, "cells_per_pixel<=1.0", "The number of mesh cells per pixel, must be <=1 ");

  return params;
}