class ExtractImageFilterGeneric !!!185858.cpp!!! Process() : void bbtkDebugMessageInc("Core",9, "bbitk::ExtractImageFilterGeneric::Process<" <()<<">()"< FilterType; // Allocate the filter typename FilterType::Pointer f = FilterType::New("Temp"); // Set the input In of the filter // Here we : // 1) Get **OUR** input 'In' by bbGetInputIn() // It is a anyImagePointer // 2) We **KNOW** that the actual type stored by the anyImagePointer // is ImageType* hence we get the value stored using the // unsafe_get method (which is a template method on the return type) f->bbSetInputIn( this->bbGetInputIn().unsafe_get() ); // The same for the ImageRegion except that we use 'get' and not // 'unsafe get' because the region dimension passed by the user may not be // compatible with the image dimension. // If get fails it throws an exception which must be caught outside f->bbSetInputExtractionRegion ( this->bbGetInputRegion().get() ); // Execute the filter f->bbExecute(); // Register its output or it will be deleted we delete the filter f->bbGetOutputOut()->Register(); // Set OUR output this->bbSetOutputOut( f->bbGetOutputOut() ); // Delete the temporary filter f->bbDelete(); bbtkDebugDecTab("Core",9);