Skip to content

Commit 80bc4cc

Browse files
committed
ENH: Add VerifyPreconditions and VerifyInputInformation
1 parent 36acd9a commit 80bc4cc

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

SoftwareGuide/Latex/DevelopmentGuidelines/WriteAFilter.tex

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,26 @@ \subsubsection{UpdateOutputInformation()}
321321
\label{sec:UpdateOutputInformation}
322322
\index{pipeline!UpdateOutputInformation}
323323

324-
The \code{UpdateOutputInformation()} method determines the pipeline modified
325-
time. It may set the RequestedRegion and the LargestPossibleRegion depending
326-
on how the filters are configured. (The RequestedRegion is set to process all
327-
the data, i.e., the LargestPossibleRegion, if it has not been set.) The
328-
UpdateOutputInformation() propagates upstream through the entire pipeline and
329-
terminates at the sources.
324+
The \code{UpdateOutputInformation()} method first calls the
325+
\code{VerifyPreconditions} to check that all required inputs
326+
are set and all parameters are valid and consistent. This enables quick
327+
failure of a filter when not configure correctly. The default
328+
implementation checks that all required pipeline inputs are set.
329+
330+
Next the pipeline modified time is determined. The RequestedRegion is
331+
set to process all the data, i.e., the LargestPossibleRegion, if
332+
neither \code{UpdateLargestPossibleRegion} was called nor
333+
RequestedRegion has not been set. The \code{UpdateOutputInformation()}
334+
propagates upstream through the entire pipeline and terminates at the
335+
sources.
336+
337+
After the upstream inputs have completed their
338+
\Code{UpdateOutputInformation} the metadata of inputs are
339+
available. The \code{VerifyInputInformation} is then called. The
340+
default implementation in \code{ImageToImageFilter} checks that all
341+
input images occupy the same physical space. This may need to be
342+
overridden if the filter does not require the image's voxels occupy the
343+
same physical space.
330344

331345
During \code{UpdateOutputInformation()}, filters have a chance to override the
332346
\code{ProcessObject::GenerateOutputInformation()} method

0 commit comments

Comments
 (0)