[Insight-developers] an itkImage "Hello world"
Ross Whitaker
whitaker@cs.utah.edu
Fri, 13 Apr 2001 13:57:23 -0600
> I like the style of using ::New with no arguments, then
> calling SetSize, it is more clear than figuring out what the
> arguments to a constructor mean.
>
Perhaps, but in the very least the image should be able to take a "size" parameter and then set
reasonable values for the various regions from that. Furthermore, if 99 times out of 100, the first
thing people do with an image is "allocate" it, then that should be the default, and we should have
other mechanisms for manipulating size parameters without an implicit allocation.
This would give:
int main()
{
typedef itk::BloxImage<itk::BloxPixel,3> Blox3D;
Blox3D::Pointer image = Blox3D::New();
image->SetSize(Blox3D::SizeType({10, 10, 10}));
}
which is starting to look reasonable, I think.
Regards,
Ross
--
Ross T. Whitaker, Assistant Professor
50 S. Central Campus Drive, Rm. 3190
University of Utah
Salt Lake City, UT 84112-9205
voice: 801/587-9549, fax: 801/581-5843
web: www.cs.utah.edu/~whitaker