ENH: Most of the redundant comments with the ShapeDetection example were removed.      New paramters values for generating the output images were added.

--- Examples/Segmentation/GeodesicActiveContourImageFilter.cxx
+++ Examples/Segmentation/GeodesicActiveContourImageFilter.cxx
@@ -18,31 +18,47 @@
 // Software Guide : BeginLatex
 //
 // The following example illustrates the use of the
-// \doxygen{GeodesicActiveContourImageFilter}.  The implementation of this filter
-// in ITK is based on the paper by Malladi \cite{Malladi1995}.  This filter
-// expects two inputs, the first is an initial Level Set in the form of an
-// \doxygen{Image}, the second input is an edge potential image which basically
-// follows the same rules applicable to the speed image used for the
-// \doxygen{FastMarchingImageFilter} discussed in
-// section~\ref{sec:FastMarchingImageFilter}.
+// \doxygen{GeodesicActiveContourImageFilter}.  The implementation of this
+// filter in ITK is based on the paper by Caselles \cite{Caselles1997}.  This
+// filter expects three inputs. The first is an initial Level Set in the form
+// of an \doxygen{Image}. The second input is an edge potential image which
+// basically follows the same rules used for the
+// \doxygen{ShapeDetectionLevelSetFilter} discussed in
+// section~\ref{sec:ShapeDetectionLevelSetFilter}. The third input is the
+// gradient image of the edge potential map. This third image is used to
+// improve the convergence of the zero set towards the edges of the eventual
+// structures present in the image. This filter also introduce an additional
+// factor on the forces driving the contours evolution. This new factor is an
+// inflation force that produce an effect similar to blowing up a ballon inside
+// the contour.
 //
-// In this example we use an \doxygen{FastMarchingImageFilter} for producing
-// the initial LevelSet as the the distance funcition to a set of user-provided
-// seeds. The \doxygen{FastMarchingImageFilter} is run with its option for a
-// constant speed value which allows to use this filter as a distance map
-// calculator.
+// The configuration of this example is quite similar to the example on the use
+// of the \doxygen{ShapeDetectionLevelSetFilter} in
+// section~\ref{sec:ShapeDetectionLevelSetFilter}. We omit most of the
+// redundant description. A look at the code will reveal the large similarity
+// between both examples.
 //
 // \begin{figure} \center
-// \includegraphics[width=15cm]{GeodesicActiveContourCollaborationDiagram1.eps}
-// \caption[GeodesicActiveContourImageFilter collaboration diagram]{Collaboration
-// diagram of the GeodesicActiveContourImageFilter applied to a segmentation task.}
-// \label{fig:GeodesicActiveContourCollaborationDiagram}
+// \includegraphics[width=15cm]{GeodesicActiveContoursCollaborationDiagram1.eps}
+// \caption[GeodesicActiveContourImageFilter collaboration
+// diagram]{Collaboration diagram of the GeodesicActiveContourImageFilter
+// applied to a segmentation task. Note the addition of the gradient filter
+// computing the derivative of the edge potential map.}
+// \label{fig:GeodesicActiveContoursCollaborationDiagram}
 // \end{figure}
 //
-// Figure~\ref{fig:GeodesicActiveContourCollaborationDiagram} shows the major
+// Figure~\ref{fig:GeodesicActiveContoursCollaborationDiagram} shows the major
 // components involved in the application of the
-// \doxygen{GeodesicActiveContourImageFilter} to a segmentation task. It involves a
-// first stage of smoothing using the
+// \doxygen{GeodesicActiveContourImageFilter} to a segmentation task. This
+// pipeline is quite similar to the one used by the
+// \doxygen{ShapeDetectionLevelSetFilter} in
+// section~\ref{sec:ShapeDetectionLevelSetFilter}. The most relevant change
+// here is the introduction of the
+// \doxygen{GradientRecursiveGaussianImageFilter} for computing the derivatives
+// of the edge potential map and passing it as input to the
+// \doxygen{GeodesicActiveContourImageFilter}.
+//
+// The pipeline involves a first stage of smoothing using the
 // \doxygen{CurvatureAnisotropicDiffusionImageFilter}. The smoothed image is
 // passed as the input for the
 // \doxygen{GradientMagnitudeRecursiveGaussianImageFilter} and then to the
@@ -63,28 +79,23 @@
 //
 // Software Guide : EndLatex

+
 // Software Guide : BeginCodeSnippet
+#include "itkImage.h"
+#include "itkGeodesicActiveContourImageFilter.h"
+// Software Guide : EndCodeSnippet
+
+
+
+
 #include "itkCurvatureAnisotropicDiffusionImageFilter.h"
 #include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"
 #include "itkSigmoidImageFilter.h"
-// Software Guide : EndCodeSnippet
-
-
-//  Software Guide : BeginLatex
-//
-//  We will need the \doxygen{Image} class, the
-//  \doxygen{FastMarchingImageFilter} class and the
-//  \doxygen{GeodesicActiveContourImageFilter} class. Hence we include their
-//  headers here.
-//
-//  Software Guide : EndLatex
-
-// Software Guide : BeginCodeSnippet
-#include "itkImage.h"
 #include "itkFastMarchingImageFilter.h"
-#include "itkGeodesicActiveContourImageFilter.h"
-// Software Guide : EndCodeSnippet
-
+#include "itkRescaleIntensityImageFilter.h"
+#include "itkBinaryThresholdImageFilter.h"
+#include "itkImageFileReader.h"
+#include "itkImageFileWriter.h"

@@ -109,49 +120,21 @@

-//  Software Guide : BeginLatex
-//
-//  The LevelSet resulting from the \doxygen{GeodesicActiveContourImageFilter} will
-//  be thresholded at the Zero level in order to get a binary image
-//  representing the segmented object. The \doxygen{BinaryThresholdImageFilter}
-//  is used for this purpose.
-//
-//  Software Guide : EndLatex
-
-// Software Guide : BeginCodeSnippet
-#include "itkBinaryThresholdImageFilter.h"
-// Software Guide : EndCodeSnippet
-
-
-
-
-//
-//  Reading and writing images will be done with the \doxygen{FileImageReader}
-//  and \doxygen{FileImageWriter}.
-//
-
-#include "itkImageFileReader.h"
-#include "itkImageFileWriter.h"
-
-
-//
-//  The RescaleIntensityImageFilter is used to renormailize the output
-//  of filters before sending them to files.
-//
-#include "itkRescaleIntensityImageFilter.h"
+

 int main( int argc, char **argv )
 {

-  if( argc < 10 )
+  if( argc < 11 )
     {
     std::cerr << "Missing Parameters " << std::endl;
     std::cerr << "Usage: " << argv[0];
     std::cerr << " inputImage  outputImage";
     std::cerr << " seedX seedY InitialDistance";
-    std::cerr << " Sigma SigmoidAlpha SigmoidBeta Iterations" << std::endl;
+    std::cerr << " Sigma SigmoidAlpha SigmoidBeta Iterations";
+    std::cerr << " InflationStrength"  << std::endl;
     return 1;
     }

@@ -204,59 +187,28 @@
   //  Software Guide : EndCodeSnippet

-  //  Software Guide : BeginLatex
-  //
-  //  The output image of the thresholding, on the other hand, is selected to be binary.
-  //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
+
+
+
+  //
+  //  The following lines instantiate the tresholding filter that will
+  //  process the final level set at the output of the GeodesicActiveContourImageFilter.
+  //
   typedef unsigned char OutputPixelType;

   typedef itk::Image< OutputPixelType, Dimension > OutputImageType;
-  // Software Guide : EndCodeSnippet
-
-
-
-
-
-  //  Software Guide : BeginLatex
-  //
-  //  The type of the \doxygen{BinaryThresholdImageFilter} filter is
-  //  instantiated below using the internal image type and the output image
-  //  type.
-  //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
+
   typedef itk::BinaryThresholdImageFilter<
                         InternalImageType,
                         OutputImageType    >    ThresholdingFilterType;

   ThresholdingFilterType::Pointer thresholder = ThresholdingFilterType::New();
-  // Software Guide : EndCodeSnippet

-
-
-
-  //  Software Guide : BeginLatex
-  //
-  //  The upper threshold of the \doxygen{BinaryThresholdImageFilter} is set up
-  //  to $0.0$ in order to make visible the zero set of the resulting level
-  //  set. The lower threshold is set to a large negative number in order to
-  //  ensure that all the interior of the segmented object will appear in the
-  //  inside of the binary region.
-  //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
   thresholder->SetLowerThreshold( -1000.0 );
   thresholder->SetUpperThreshold(     0.0 );

   thresholder->SetOutsideValue(  0  );
   thresholder->SetInsideValue(  255 );
-  // Software Guide : EndCodeSnippet
-

@@ -284,44 +236,22 @@
                                InternalImageType,
                                OutputImageType >   CastFilterType;

-  //  Software Guide : BeginLatex
-  //
   //
   //  The \doxygen{CurvatureAnisotropicDiffusionImageFilter} type is
   //  instantiated using the internal image type.
   //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
   typedef   itk::CurvatureAnisotropicDiffusionImageFilter<
                                InternalImageType,
                                InternalImageType >  SmoothingFilterType;
-  // Software Guide : EndCodeSnippet
-
-
-
-
-  //  Software Guide : BeginLatex
-  //
-  //  Then, the filter is created by invoking the \code{New()} method and
-  //  assigning the result to a \doxygen{SmartPointer}.
-  //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
+
   SmoothingFilterType::Pointer smoothing = SmoothingFilterType::New();
-  // Software Guide : EndCodeSnippet
-
-
-  //  Software Guide : BeginLatex
+
+
   //
   //  The types of the \doxygen{GradientMagnitudeRecursiveGaussianImageFilter} and
   //  \doxygen{SigmoidImageFilter} are instantiated using the internal
   //  image type.
   //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
   typedef   itk::GradientMagnitudeRecursiveGaussianImageFilter<
                                InternalImageType,
                                InternalImageType >  GradientFilterType;
@@ -329,26 +259,12 @@
   typedef   itk::SigmoidImageFilter<
                                InternalImageType,
                                InternalImageType >  SigmoidFilterType;
-  // Software Guide : EndCodeSnippet
-
-
-
-
-  //  Software Guide : BeginLatex
-  //
-  //  The corresponding filter objects are created with the method
-  //  \code{New()}.
-  //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
+
   GradientFilterType::Pointer  gradientMagnitude = GradientFilterType::New();

   SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New();
-  // Software Guide : EndCodeSnippet
-
-
-  //  Software Guide : BeginLatex
+
+
   //
   //  The minimum and maximum values of the \doxygen{SigmoidImageFilter} output
   //  are defined with the methods \code{SetOutputMinimum()} and
@@ -358,43 +274,27 @@
   //  \doxygen{SigmoidImageFilter} are presented in
   //  section~\ref{sec:IntensityNonLinearMapping}.
   //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
+
   sigmoid->SetOutputMinimum(  0.0  );
   sigmoid->SetOutputMaximum(  1.0  );
-  // Software Guide : EndCodeSnippet
-
-
-
-
-  //  Software Guide : BeginLatex
+
+
+
+
   //
   //  We declare now the type of the \doxygen{FastMarchingImageFilter} that
   //  will be used to generate the initial level set in the form of a distance
   //  map.
   //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
   typedef  itk::FastMarchingImageFilter<
                               InternalImageType,
                               InternalImageType >    FastMarchingFilterType;
-  // Software Guide : EndCodeSnippet
-
-
-
-
-
-  //  Software Guide : BeginLatex
+
+
   //
   //  then, we  construct one filter of this class using the \code{New()} method.
   //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
   FastMarchingFilterType::Pointer  fastMarching = FastMarchingFilterType::New();
-  // Software Guide : EndCodeSnippet

@@ -457,12 +357,31 @@
   // Software Guide : EndCodeSnippet

+
+  //  Software Guide : BeginLatex
+  //
+  //  The differential equation used by the
+  //  \doxygen{GeodesicActiveContourImageFilter} includes an inflation term.
+  //  This value drives a ballon-like force that help expand the contour. The
+  //  value of this factor is passed to the filter with the
+  //  \code{SetInflationStrength()} method. In our current example, we take
+  //  this value from the command line arguments.
+  //
+  //  \index{GeodesicActiveContourImageFilter!SetInflationStrength()}
+  //
+  //  Software Guide : EndLatex
+
+  const double inflationStrength = atof( argv[10] );
+
+  //  Software Guide : BeginCodeSnippet
+  geodesicActiveContour->SetInflationStrength( inflationStrength );
+  //  Software Guide : EndCodeSnippet

   //  Software Guide : BeginLatex
   //
   //  The filters are now connected in a pipeline indicated in
-  //  Figure~\ref{fig:GeodesicActiveContourCollaborationDiagram} using the following
+  //  Figure~\ref{fig:GeodesicActiveContoursCollaborationDiagram} using the following
   //  lines.
   //
   //  Software Guide : EndLatex
@@ -486,7 +405,6 @@

-  //  Software Guide : BeginLatex
   //
   //  The \doxygen{CurvatureAnisotropicDiffusionImageFilter} requires a couple
   //  of parameter to be defined. The following are typical values for $2D$
@@ -494,18 +412,14 @@
   //  noise present in the input image. This filter has been discussed in
   //  section~\ref{sec:GradientAnisotropicDiffusionImageFilter}.
   //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
+
   smoothing->SetTimeStep( 0.25 );
   smoothing->SetIterations(  5 );
   smoothing->SetConductanceParameter( 3.0 );
-  // Software Guide : EndCodeSnippet
-
-
-
-
-  //  Software Guide : BeginLatex
+
+
+
+
   //
   //  The \doxygen{GradientMagnitudeRecursiveGaussianImageFilter} performs the
   //  equivalent of a convolution with a Gaussian kernel, followed by a
@@ -513,40 +427,30 @@
   //  the range of influence of the image edges. This filter has been discussed
   //  in section~\ref{sec:GradientMagnitudeRecursiveGaussianImageFilter}
   //
-  //  \index{itk::GradientMagnitudeRecursiveGaussianImageFilter!SetSigma()}
-  //
-  //  Software Guide : EndLatex

   const double sigma = atof( argv[6] );

-  // Software Guide : BeginCodeSnippet
   gradientMagnitude->SetSigma(  sigma  );
-  // Software Guide : EndCodeSnippet
-
-
-
-  //  Software Guide : BeginLatex
+
+
+
   //
   //  The \doxygen{SigmoidImageFilter} requires two parameters that define the
   //  linear transformation to be applied to the sigmoid argument. This
   //  parameters have been discussed in sections~\ref{sec:SigmoidImageFilter}
   //  and \ref{sec:FastMarchingImageFilter}.
   //
-  //  Software Guide : EndLatex

   const double alpha =  atof( argv[7] );
   const double beta  =  atof( argv[8] );

-  // Software Guide : BeginCodeSnippet
   sigmoid->SetAlpha( alpha );
   sigmoid->SetBeta(  beta  );
-  // Software Guide : EndCodeSnippet
-
-
-
-
-  //  Software Guide : BeginLatex
+
+
+
+
   //
   //  The \doxygen{FastMarchingImageFilter} requires the user to provide a seed
   //  point from which the level set will be generated. The user can actually
@@ -555,24 +459,16 @@
   //  determination of an initial Level Set. We could have used the
   //  \doxygen{DanielssonDistanceMapImageFilter} in the same way.
   //
-  //  \index{itk::FastMarchingImageFilter!Multiple seeds}
   //
   //  The seeds are passed stored in a container. The type of this
   //  container is defined as \code{NodeContainer} among the
   //  \doxygen{FastMarchingImageFilter} traits.
   //
-  //  \index{itk::FastMarchingImageFilter!Nodes}
-  //  \index{itk::FastMarchingImageFilter!NodeContainer}
-  //  \index{itk::FastMarchingImageFilter!NodeType}
-  //
-  //  Software Guide : EndLatex
-
-  //  Software Guide : BeginCodeSnippet
+
   typedef FastMarchingFilterType::NodeContainer           NodeContainer;
   typedef FastMarchingFilterType::NodeType                NodeType;

   NodeContainer::Pointer seeds = NodeContainer::New();
-  //  Software Guide : EndCodeSnippet

   InternalImageType::IndexType  seedPosition;
@@ -581,7 +477,6 @@
   seedPosition[1] = atoi( argv[4] );

-  //  Software Guide : BeginLatex
   //
   //  Nodes are created as stack variables and initialized with a value and an
   //  \doxygen{Index} position. Note that here we assign the value of minus the
@@ -594,68 +489,48 @@
   //  value as the distance from the seed points at which he want the initial
   //  contour to be.
   //
-  //  \index{itk::FastMarchingImageFilter!Seed initialization}
-  //
-  //  Software Guide : EndLatex

   const double initialDistance = atof( argv[5] );

-  // Software Guide : BeginCodeSnippet
   NodeType node;

   const double seedValue = - initialDistance;

   node.SetValue( seedValue );
   node.SetIndex( seedPosition );
-  // Software Guide : EndCodeSnippet
-
-
-
-  //  Software Guide : BeginLatex
+
+
+
   //
   //  The list of nodes is initialized and then every node is inserted using
   //  the \code{InsertElement()}.
   //
-  //  Software Guide : EndLatex
-
-  //  Software Guide : BeginCodeSnippet
+
   seeds->Initialize();
-
   seeds->InsertElement( 0, node );
-  //  Software Guide : EndCodeSnippet
-
-
-
-
-  //  Software Guide : BeginLatex
+
+
+
+
   //
   //  The set of seed nodes is passed now to the
   //  \doxygen{FastMarchingImageFilter} with the method
   //  \code{SetTrialPoints()}.
   //
-  //  \index{itk::FastMarchingImageFilter!SetTrialPoints()}
-  //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
+
   fastMarching->SetTrialPoints(  seeds  );
-  // Software Guide : EndCodeSnippet
-
-
-
-
-  //  Software Guide : BeginLatex
+
+
+
+
   //
   //  Since the \doxygen{FastMarchingImageFilter} is used here just as a
   //  Distance Map generator. It does not require a speed image as input.
   //  Instead the constant value $1.0$ is passed using the
   //  \code{SetSpeedConstant()} method.
   //
-  //  Software Guide : EndLatex
-
-  //  Software Guide : BeginCodeSnippet
+
   fastMarching->SetSpeedConstant( 1.0 );
-  //  Software Guide : EndCodeSnippet

   //
@@ -707,7 +582,6 @@

-  //  Software Guide : BeginLatex
   //
   //  The \doxygen{FastMarchingImageFilter} requires the user to specify the
   //  size of the image to be produced as output. This is done using the
@@ -716,15 +590,11 @@
   //  only after the \code{Update()} methods of this filter has been called
   //  directly or indirectly.
   //
-  //  Software Guide : EndLatex
-
-  // Software Guide : BeginCodeSnippet
+
   fastMarching->SetOutputSize(
            reader->GetOutput()->GetBufferedRegion().GetSize() );
-  // Software Guide : EndCodeSnippet
-
-
-  //  Software Guide : BeginLatex
+
+
   //
   //  Several parameters should be set in the
   //  \doxygen{GeodesicActiveContourImageFilter}. In particular, the number of
@@ -741,27 +611,21 @@
   //  to stop the algorithm before the zero set leaks through the regions of
   //  low gradient in the contour of the anatomical structure to be segmented.
   //
-  //  \index{itk::GeodesicActiveContourImageFilter!SetTimeStepSize()}
-  //  \index{itk::GeodesicActiveContourImageFilter!SetNumberOfIterations()}
-  //  \index{itk::LevelSetImageFilter!SetTimeStepSize()}
-  //  \index{itk::LevelSetImageFilter!SetNumberOfIterations()}
-  //
-  //  Software Guide : EndLatex
-
+
   const unsigned int numberOfIterations = atoi( argv[ 9] );
-  //  Software Guide : BeginCodeSnippet
+
   geodesicActiveContour->SetNumberOfIterations(  numberOfIterations );

   geodesicActiveContour->SetTimeStepSize( 0.25 );
-  //  Software Guide : EndCodeSnippet
-
-
-
-
-  //  Software Guide : BeginLatex
-  //
-  //  In addition to that, we enable the option of using a narrow band
-  //  technique for computing th evolution of the contour.
+
+
+
+
+
+  //  Software Guide : BeginLatex
+  //
+  //  In order to speed up the computation, we enable the option of using a
+  //  narrow band technique for computing th evolution of the contour.
   //
   //  \index{itk::GeodesicActiveContourImageFilter!NarrowBandingOn()}
   //  \index{itk::LevelSetImageFilter!NarrowBandingOn()}
@@ -773,7 +637,6 @@
   //  Software Guide : EndCodeSnippet

-  derivativeFilter->Update();

   //  Software Guide : BeginLatex
@@ -839,51 +702,41 @@
   //  table presents the parameters used for some structures.
   //
   //  \begin{center}
-  //  \begin{tabular}{|l|c|c|c|c|c|c|c|}
+  //  \begin{tabular}{|l|c|c|c|c|c|c|c|c|}
   //  \hline
   //  Structure    & Seed Index &  Distance   &   $\sigma$  &
-  //  $\alpha$     &  $\beta$   & Iterations  & Output Image \\
+  //  $\alpha$     &  $\beta$   & Iterations  & Inflation & Output Image \\
   //  \hline
-  //  Left Ventricle  & $(81,114)$ & 5.0 & 1.0 & -0.5 & 3.0  & 150 & First  in Figure \ref{fig:GeodesicActiveContourImageFilterOutput2} \\
-  //  Right Ventricle & $(99,114)$ & 5.0 & 1.0 & -0.5 & 3.0  & 150 & Second in Figure \ref{fig:GeodesicActiveContourImageFilterOutput2} \\
-  //  White matter    & $(56, 92)$ & 5.0 & 1.0 & -0.3 & 2.0  & 800 & Third  in Figure \ref{fig:GeodesicActiveContourImageFilterOutput2} \\
-  //  Gray matter     & $(40, 90)$ & 5.0 & 0.5 & -0.3 & 2.0  & 200 & Fourth in Figure \ref{fig:GeodesicActiveContourImageFilterOutput2} \\
+  //  Left Ventricle  & $(81,114)$ & 5.0 & 1.0 & -0.5 & 3.0  & 100 & 3.0 & First  in Figure \ref{fig:GeodesicActiveContourImageFilterOutput2} \\
+  //  Right Ventricle & $(99,114)$ & 5.0 & 1.0 & -0.5 & 3.0  & 100 & 3.0 & Second in Figure \ref{fig:GeodesicActiveContourImageFilterOutput2} \\
+  //  White matter    & $(56, 92)$ & 5.0 & 1.0 & -0.3 & 2.0  & 500 & 3.0 & Third  in Figure \ref{fig:GeodesicActiveContourImageFilterOutput2} \\
+  //  Gray matter     & $(40, 90)$ & 5.0 & 0.5 & -0.3 & 2.0  & 200 & 3.0 & Fourth in Figure \ref{fig:GeodesicActiveContourImageFilterOutput2} \\
   //  \hline
   //  \end{tabular}
   //  \end{center}
   //
-  //  Figure~\ref{fig:GeodesicActiveContourImageFilterOutput} presents the intermediate
-  //  outputs of the pipeline illustrated in
-  //  Figure~\ref{fig:GeodesicActiveContourCollaborationDiagram}. They are from left
-  //  to right: the output of the anisotropic diffusing filter, the gradient
-  //  magnitude of the smoothed image and the sigmoid of the gradient magnitude
-  //  which is finally used as the edge potential for the
-  //  \doxygen{GeodesicActiveContourImageFilter}.
-  //
-  // \begin{figure} \center
-  // \includegraphics[width=6cm]{BrainProtonDensitySlice.eps}
-  // \includegraphics[width=6cm]{GeodesicActiveContourImageFilterOutput1.eps}
-  // \includegraphics[width=6cm]{GeodesicActiveContourImageFilterOutput2.eps}
-  // \includegraphics[width=6cm]{GeodesicActiveContourImageFilterOutput3.eps}
-  // \caption[GeodesicActiveContourImageFilter intermediate output]{Images generated by
-  // the segmentation process based on the GeodesicActiveContourImageFilter. From left
-  // to right and top to bottom: Input image to be segmented, image smoothed with an
-  // edge-preserving smoothing filter, gradient magnitude of the smoothed
-  // image, sigmoid of the gradient magnitude. This last image, the sigmoid, is
-  // used to compute the speed term for the front propagation }
-  // \label{fig:GeodesicActiveContourImageFilterOutput}
-  // \end{figure}
-  //
-  //  A larger number of iterations is reguired for segmenting large structures
-  //  since it takes longer for the front to propagate and cover the region to
-  //  be segmented.  It can be noticed that the gray matter is not being
-  //  completly segmented.  This drawback can be easily mitigated by setting
-  //  many seed points in the initialization of the
-  //  \doxygen{FastMarchingImageFilter}. This will generate an initial level
-  //  set much closer in shape to the object to be segmented and hence
-  //  requiring less iterations to fill in and reach out the edges of the
-  //  anatomical structure.
-  //
+  //  The intermediate outputs of this pipeline are identical to those of the
+  //  \doxygen{ShapDetectionImageFilter} presented in
+  //  Figure~\ref{fig:ShapDetectionImageFilterOutput}.
+  //
+  //  An interesting trade-off exists between the number of iterations to run,
+  //  the inflation strength and the contrast of the borders in the anatomical
+  //  structure. In principle we want to set the inflation strength as high as
+  //  possible since this will make the front propagate faster and hence less
+  //  iteration will be needed to move the contour to the structure edges.
+  //  However the inflation force may provoke a premature leaking of the
+  //  contour through the regions of weak contrast in the structure edges.
+  //  Unfortunately only experimentation can allow to determine the optimal
+  //  values for the inflation strength and the number of iterations. In a real
+  //  application we could imagine an interactive mechanism by which a human
+  //  operator identifies the regions of weak contrast in the object edges, and
+  //  from this value a reasonable guess of the inflation strength could be
+  //  made. Then the filter could be run for a certain number of iterations
+  //  stopping periodically in order to display intermediate results showing
+  //  the current position of the contour. In this setup, an operator will be
+  //  able to supervise the growth of the contour and make informed decisions
+  //  on whether new parameters are needed or simply more iterations are
+  //  required.
   //
   // \begin{figure} \center
   // \includegraphics[width=4cm]{GeodesicActiveContourImageFilterOutput5.eps}


取消静态音频刷新类

取消静态音频刷新类

--- YtxPlayer/app/src/main/cpp/src/AudioRefreshController.cpp
+++ YtxPlayer/app/src/main/cpp/src/AudioRefreshController.cpp
@@ -11,14 +11,14 @@
 #include <map>
 #include <unistd.h>

-//static std::map<SLAndroidSimpleBufferQueueItf,AudioRefreshController*>   audioEnMap;
-static AudioRefreshController* mAudioRefreshController;
+static std::map<SLAndroidSimpleBufferQueueItf,AudioRefreshController*>   audioEnMap;
+//static AudioRefreshController* mAudioRefreshController;
 AudioRefreshController::AudioRefreshController(VideoStateInfo* mVideoStateInfo)
 {
     ALOGI("AudioRefreshController()\n");
     this->mVideoStateInfo = mVideoStateInfo;
     mAudioEngine = new AudioEngine();
-    mAudioRefreshController = this;
+  //  mAudioRefreshController = this;
 }

@@ -42,7 +42,7 @@
     mAudioEngine->createEngine();
     mAudioEngine->createBufferQueueAudioPlayer(mVideoStateInfo->streamAudio->dec_ctx->sample_rate,960,mVideoStateInfo->out_channel_nb);
     ALOGI("AudioRefreshController::prepare pthread_self:%lu,bqPlayerBufferQueue=%#x\n", (long)pthread_self(), mAudioEngine->bqPlayerBufferQueue);
-   // audioEnMap.insert(std::pair<SLAndroidSimpleBufferQueueItf,AudioRefreshController*>(mAudioEngine->bqPlayerBufferQueue, this));
+    audioEnMap.insert(std::pair<SLAndroidSimpleBufferQueueItf,AudioRefreshController*>(mAudioEngine->bqPlayerBufferQueue, this));
     mAudioEngine->RegisterCallback(bqPlayerCallback);
     return true;
 }
@@ -100,26 +100,26 @@

 void AudioRefreshController::bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context)
 {
-//    AudioRefreshController* sAudioRefreshController = NULL;
-//
-//  //  ALOGI("AudioRefreshController::bqPlayerCallback pthread_self:%lu,bqPlayerBufferQueue=%#x\n", (long)pthread_self(), bq);
-//  //  ALOGI("AudioRefreshController::bqPlayerCallback pthread_self:%lu,getpid:%lu,gettid:%lu\n", (long)pthread_self(), (long)getpid(),(long)gettid());
-//    std::map<SLAndroidSimpleBufferQueueItf,AudioRefreshController*>::iterator l_it;
-//    l_it = audioEnMap.find(bq);
-//    if(l_it == audioEnMap.end()){
-//      //  ALOGI("AudioRefreshController::bqPlayerCallback we do not find");
-//
-//    } else {
-//      //  ALOGI("AudioRefreshController::bqPlayerCallback we find");
-//        sAudioRefreshController = l_it->second;
-//    }
+    AudioRefreshController* sAudioRefreshController = NULL;

-    assert(bq == mAudioRefreshController->mAudioEngine->bqPlayerBufferQueue);
+  //  ALOGI("AudioRefreshController::bqPlayerCallback pthread_self:%lu,bqPlayerBufferQueue=%#x\n", (long)pthread_self(), bq);
+  //  ALOGI("AudioRefreshController::bqPlayerCallback pthread_self:%lu,getpid:%lu,gettid:%lu\n", (long)pthread_self(), (long)getpid(),(long)gettid());
+    std::map<SLAndroidSimpleBufferQueueItf,AudioRefreshController*>::iterator l_it;
+    l_it = audioEnMap.find(bq);
+    if(l_it == audioEnMap.end()){
+        ALOGI("AudioRefreshController::bqPlayerCallback we do not find");
+
+    } else {
+      //  ALOGI("AudioRefreshController::bqPlayerCallback we find");
+        sAudioRefreshController = l_it->second;
+    }
+
+    assert(bq == sAudioRefreshController->mAudioEngine->bqPlayerBufferQueue);
     assert(NULL == context);

-    mAudioRefreshController->audioFrameProcess();
-    if(*mAudioRefreshController->mVideoStateInfo->mCurrentState == MEDIA_PLAYER_PAUSED){
-        mAudioRefreshController->mVideoStateInfo->waitOnNotify(MEDIA_PLAYER_PAUSED);
+    sAudioRefreshController->audioFrameProcess();
+    if(*sAudioRefreshController->mVideoStateInfo->mCurrentState == MEDIA_PLAYER_PAUSED){
+        sAudioRefreshController->mVideoStateInfo->waitOnNotify(MEDIA_PLAYER_PAUSED);

     }


BUG: a fix to the endian issue

BUG: a fix to the endian issue

--- Graphics/Testing/Cxx/TestIncrementalOctreePointLocator.cxx
+++ Graphics/Testing/Cxx/TestIncrementalOctreePointLocator.cxx
@@ -20,11 +20,6 @@
 #include "vtkUnstructuredGrid.h"
 #include "vtkUnstructuredGridReader.h"
 #include "vtkIncrementalOctreePointLocator.h"
-
-
-#define  MAX_INT_IN_DISKFILES  400000
-// NOTE: The two data fils are in little-endian binary format.
-// In case of re-generating the data files, please address the endian issues.

 // NOTE: ALL THE FOLLOWING FLAGS SHOULD BE OFF
@@ -89,7 +84,6 @@

   // variables
   int         r, t, m, i, j, k;
-  int         needSwap = 0;
   int         retValue = 0;
   int         numbPnts = 0;
   int         inserted = 0;
@@ -266,24 +260,19 @@
       // ---------------------------------------------------------------------
       // rapid point index-based verification
       fread(  &numInsrt,  sizeof( int ),  1,  diskFile  );
-      if ( numInsrt >  MAX_INT_IN_DISKFILES ||
-           numInsrt < -MAX_INT_IN_DISKFILES )
-      // this is an informal yet effective way for handling the two data files
-        {
-        needSwap = 1;
-        SwapForBigEndian
-          (  ( unsigned char * ) ( &numInsrt ),  sizeof( int ),  1  );
-        }
+      #ifdef VTK_WORDS_BIGENDIAN
+      SwapForBigEndian
+        (  ( unsigned char * ) ( &numInsrt ),  sizeof( int ),  1  );
+      #endif

       if (  numInsrt  ==  ptIdList->GetNumberOfIds()  )
         {
         int  samePtId = 1;
         fread(  truthIds,  sizeof( vtkIdType ),  numInsrt,  diskFile  );
-        if ( needSwap )
-          {
-          SwapForBigEndian
-            (  ( unsigned char * ) truthIds,  sizeof( vtkIdType ),  numInsrt  );
-          }
+        #ifdef VTK_WORDS_BIGENDIAN
+        SwapForBigEndian
+          (  ( unsigned char * ) truthIds,  sizeof( vtkIdType ),  numInsrt  );
+        #endif

         for (  i = 0;  ( i < numInsrt ) && ( samePtId == 1 );  i ++  )
           {
@@ -345,26 +334,24 @@
   pntsFile = fopen( fileName, "rb" );
   delete []  fileName;  fileName = NULL;
   fread(  &nLocPnts,  sizeof( int ),  1,  pntsFile  );
-  if ( needSwap )
-    {
-    SwapForBigEndian
-      (  ( unsigned char * ) ( &nLocPnts ),  sizeof( int ),  1  );
-    }
+  #ifdef VTK_WORDS_BIGENDIAN
+  SwapForBigEndian
+    (  ( unsigned char * ) ( &nLocPnts ),  sizeof( int ),  1  );
+  #endif
   pLocPnts = ( double * ) realloc( pLocPnts, sizeof( double ) * nLocPnts * 3 );
   minDist2 = ( double * ) realloc( minDist2, sizeof( double ) * nLocPnts     );
   maxDist2 = ( double * ) realloc( maxDist2, sizeof( double ) * nLocPnts     );
   fread( pLocPnts, sizeof( double ), nLocPnts * 3, pntsFile );
   fread( minDist2, sizeof( double ), nLocPnts,     pntsFile );
   fread( maxDist2, sizeof( double ), nLocPnts,     pntsFile );
-  if ( needSwap )
-    {
-    SwapForBigEndian
-      (  ( unsigned char * ) pLocPnts,  sizeof( double ),  nLocPnts * 3  );
-    SwapForBigEndian
-      (  ( unsigned char * ) minDist2,  sizeof( double ),  nLocPnts      );
-    SwapForBigEndian
-      (  ( unsigned char * ) maxDist2,  sizeof( double ),  nLocPnts      );
-    }
+  #ifdef VTK_WORDS_BIGENDIAN
+  SwapForBigEndian
+    (  ( unsigned char * ) pLocPnts,  sizeof( double ),  nLocPnts * 3  );
+  SwapForBigEndian
+    (  ( unsigned char * ) minDist2,  sizeof( double ),  nLocPnts      );
+  SwapForBigEndian
+    (  ( unsigned char * ) maxDist2,  sizeof( double ),  nLocPnts      );
+  #endif
   fclose( pntsFile );                pntsFile = NULL;

@@ -427,18 +414,16 @@
     // -----------------------------------------------------------------------
     // rapid point index-based verification
     fread( &nLocPnts,  sizeof( int       ),  1,         diskFile  );
-    if ( needSwap )
-      {
-      SwapForBigEndian
-        (  ( unsigned char * ) ( &nLocPnts ),  sizeof( int ),  1  );
-      }
+    #ifdef VTK_WORDS_BIGENDIAN
+    SwapForBigEndian
+      (  ( unsigned char * ) ( &nLocPnts ),  sizeof( int ),  1  );
+    #endif

     fread(  truthIds,  sizeof( vtkIdType ),  nLocPnts,  diskFile  );
-    if ( needSwap )
-      {
-      SwapForBigEndian
-        (  ( unsigned char * ) truthIds,  sizeof( vtkIdType ),  nLocPnts  );
-      }
+    #ifdef VTK_WORDS_BIGENDIAN
+    SwapForBigEndian
+      (  ( unsigned char * ) truthIds,  sizeof( vtkIdType ),  nLocPnts  );
+    #endif

     for (  i = 0;  ( i < nLocPnts ) && ( retValue == 0 );  i ++  )
       {
@@ -519,20 +504,18 @@
     // rapid point index-based verification
     #ifndef _BRUTE_FORCE_VERIFICATION_
     fread( &numInsrt,  sizeof( int ),  1,  diskFile  );
-    if ( needSwap )
-      {
-      SwapForBigEndian
-        (  ( unsigned char * ) ( &numInsrt ),  sizeof( int ),  1  );
-      }
+    #ifdef VTK_WORDS_BIGENDIAN
+    SwapForBigEndian
+      (  ( unsigned char * ) ( &numInsrt ),  sizeof( int ),  1  );
+    #endif

     truthIds = ( vtkIdType * )
                realloc(  truthIds,  sizeof( vtkIdType ) * numInsrt  );
     fread(  truthIds,  sizeof( vtkIdType ),  numInsrt,  diskFile  );
-    if ( needSwap )
-      {
-      SwapForBigEndian
-        (  ( unsigned char * ) truthIds,  sizeof( vtkIdType ),  numInsrt  );
-      }
+    #ifdef VTK_WORDS_BIGENDIAN
+    SwapForBigEndian
+      (  ( unsigned char * ) truthIds,  sizeof( vtkIdType ),  numInsrt  );
+    #endif

     for (  i = 0;  ( i < numInsrt ) && ( retValue == 0 );  i ++  )
       {
@@ -685,20 +668,18 @@
     // rapid point index-based verification
     #ifndef _BRUTE_FORCE_VERIFICATION_
     fread( &numInsrt,  sizeof( int ),  1,  diskFile  );
-    if ( needSwap )
-      {
-      SwapForBigEndian
-        (  ( unsigned char * ) ( &numInsrt ),  sizeof( int ),  1  );
-      }
+    #ifdef VTK_WORDS_BIGENDIAN
+    SwapForBigEndian
+      (  ( unsigned char * ) ( &numInsrt ),  sizeof( int ),  1  );
+    #endif

     truthIds = ( vtkIdType * )
                realloc(  truthIds,  sizeof( vtkIdType ) * numInsrt  );
     fread(  truthIds,  sizeof( vtkIdType ),  numInsrt,  diskFile  );
-    if ( needSwap )
-      {
-      SwapForBigEndian
-        (  ( unsigned char * ) truthIds,  sizeof( vtkIdType ),  numInsrt  );
-      }
+    #ifdef VTK_WORDS_BIGENDIAN
+    SwapForBigEndian
+      (  ( unsigned char * ) truthIds,  sizeof( vtkIdType ),  numInsrt  );
+    #endif

     vtkIdType * tmpPtIds = ptIdList->GetPointer( 0 );
     for (  i = 0;  ( i < numInsrt ) && ( retValue == 0 );  i ++  )
@@ -725,18 +706,16 @@
     truthIds = ( vtkIdType * )
                realloc( truthIds, sizeof( vtkIdType ) * nClzNpts * nLocPnts );
     fread( &numInsrt,  sizeof( int       ),  1,         diskFile  );
-    if ( needSwap )
-      {
-      SwapForBigEndian
-        (  ( unsigned char * ) ( &numInsrt ),  sizeof( int ),  1  );
-      }
+    #ifdef VTK_WORDS_BIGENDIAN
+    SwapForBigEndian
+      (  ( unsigned char * ) ( &numInsrt ),  sizeof( int ),  1  );
+    #endif

     fread(  truthIds,  sizeof( vtkIdType ),  numInsrt,  diskFile  );
-    if ( needSwap )
-      {
-      SwapForBigEndian
-        (  ( unsigned char * ) truthIds,  sizeof( vtkIdType ),  numInsrt  );
-      }
+    #ifdef VTK_WORDS_BIGENDIAN
+    SwapForBigEndian
+      (  ( unsigned char * ) truthIds,  sizeof( vtkIdType ),  numInsrt  );
+    #endif
     #endif

     // -----------------------------------------------------------------------


COMP: vtk6 changes

COMP: vtk6 changes

--- PrivateLibrary/fiberio.cxx
+++ PrivateLibrary/fiberio.cxx
@@ -4,7 +4,7 @@

 #include <itkSpatialObjectReader.h>
 #include <itkSpatialObjectWriter.h>
-
+#include <vtkVersionMacros.h>
 #include <vtkPolyData.h>
 #include <vtkPointData.h>
 #include <vtkPolyDataReader.h>
@@ -233,14 +233,14 @@
         {
         ++pindex;

-        vtkFloatingPointType* coordinates = points->GetPoint(j);
+        double * coordinates = points->GetPoint(j);
         DTIPointType          pt;
         // Convert from RAS to LPS for vtk
         pt.SetPosition(-coordinates[0], -coordinates[1], coordinates[2]);
         pt.SetRadius(0.5);
         pt.SetColor(0.0, 1.0, 0.0);

-        vtkFloatingPointType* vtktensor = fibtensordata->GetTuple9(pindex);
+        double * vtktensor = fibtensordata->GetTuple9(pindex);
         float                 floattensor[6];
         ITKTensorType         itktensor;


fixed missing state that caused the bboxes to stay always on top the volume in isosurface mode

git-svn-id: 83c4c97093aeea62ac982fbfd516bf9db27f5c99@1871 c36c8488-0289-0348-9b64-b301f74bd9a7

--- Renderer/GL/GLRenderer.cpp
+++ Renderer/GL/GLRenderer.cpp
@@ -2709,8 +2709,8 @@
   GPUState localState = m_BaseState;
   localState.enableTex[0] = TEX_2D;
   localState.enableTex[1] = TEX_2D;
+  localState.enableBlend = false;
   m_pContext->GetStateManager()->Apply(localState);
-

   m_pFBOIsoHit[iStereoID]->Read(0, 0);
   m_pFBOIsoHit[iStereoID]->Read(1, 1);


Add missing include.

Add missing include.

git-svn-id: 83c4c97093aeea62ac982fbfd516bf9db27f5c99@1919 c36c8488-0289-0348-9b64-b301f74bd9a7

--- Renderer/GL/GLRenderer.cpp
+++ Renderer/GL/GLRenderer.cpp
@@ -36,6 +36,7 @@

 #include <algorithm>
 #include <cstdarg>
+#include <iterator>
 #include <stdexcept>
 #include <typeinfo>
 #include "GLInclude.h"


Modifies the way cards are displayed by using ASCII symbols

--- Source/Card.cpp
+++ Source/Card.cpp
@@ -54,31 +54,31 @@
 void Card::createCardName ( ) {
 	switch (rank) {
 		case TWO:
-			cardName += "Two";
+			cardName += "2";
 			break;
 		case THREE:
-			cardName += "Three";
+			cardName += "3";
 			break;
 		case FOUR:
-			cardName += "Four";
+			cardName += "4";
 			break;
 		case FIVE:
-			cardName += "Five";
+			cardName += "5";
 			break;
 		case SIX:
-			cardName += "Six";
+			cardName += "6";
 			break;
 		case SEVEN:
-			cardName += "Seven";
+			cardName += "7";
 			break;
 		case EIGHT:
-			cardName += "Eight";
+			cardName += "8";
 			break;
 		case NINE:
-			cardName += "Nine";
+			cardName += "9";
 			break;
 		case TEN:
-			cardName += "Ten";
+			cardName += "10";
 			break;
 		case JACK:
 			cardName += "Jack";
@@ -96,22 +96,22 @@
 			cardName += "Joker";
 			break;
 	}
-	cardName += " of ";
+	cardName += " ";
 	switch (suit) {
 		case CLUB:
-			cardName += "Clubs";
+			cardName += '\6';
 			break;
 		case DIAMOND:
-			cardName += "Diamonds";
+			cardName += '\4';
 			break;
 		case HEART:
-			cardName += "Hearts";
+			cardName += '\3';
 			break;
 		case SPADE:
-			cardName += "Spades";
+			cardName += '\5';
 			break;
 		default:
-			cardName = "Jokers";
+			cardName = "?";
 			break;
 	}
 }


Remove dead functor that has been replaced by a lambda expression.

--- Source/Game.cpp
+++ Source/Game.cpp
@@ -588,21 +588,6 @@
     if( HostIsKeyDown( HOST_KEY_UP ) )
         MoveDrillVertically(-1);
 }
-
-#if 0
-class WavefieldFunctor {
-    const NimbleRequest request;
-    NimblePixMap subsurface;
-public:
-    WavefieldFunctor( const NimblePixMap& subsurface_, NimbleRequest request_ ) :
-       request(request_),
-       subsurface(subsurface_)
-    {}
-    void operator()() const {
-        WavefieldUpdateDraw( subsurface, request, ShowGeology, ShowSeismic, TheColorFunc );
-    }
-};
-#endif

 class ReservoirFunctor {
     const NimbleRequest request;


Fem3DSolutionComponentsTest.cpp: Removing investigational code

The MlcpPerformanceImprovement branch is being used to investigate
alternate formulations of matrix inversion and other linear algebra
components. This commit removes some test code that was inadvertently
left in the solution components test, prior to this code being merged
to master.

--- SurgSim/Physics/PerformanceTests/Fem3DSolutionComponentsTest.cpp
+++ SurgSim/Physics/PerformanceTests/Fem3DSolutionComponentsTest.cpp
@@ -177,11 +177,7 @@
 		// Inversion takes a long time. Only do it once.
 		for (int i = 0; i < 1; i++)
 		{
-			const auto&  mat = fem->getOdeSolver()->getSystemMatrix().toDense();
-			const auto& inv = mat.inverse();
-			EXPECT_TRUE((mat * inv).isApprox(Math::Matrix::Identity(mat.rows(),
-											 mat.cols()))) << "Mat: " << std::endl << mat <<
-													 std::endl << "Inverse: " << std::endl << inv << std::endl;
+			fem->getOdeSolver()->getLinearSolver()->getInverse();
 		}
 		totalTime.endFrame();
 		RecordProperty("Duration", boost::to_string(totalTime.getCumulativeTime()));


ENH: Added additional code coverage for Set/Get and Boolean macros. itkTypeMacro test coverage is incomplete.

--- Testing/Code/Review/itkBinaryImageToShapeLabelMapFilterTest1.cxx
+++ Testing/Code/Review/itkBinaryImageToShapeLabelMapFilterTest1.cxx
@@ -44,19 +44,63 @@

   typedef itk::ShapeLabelObject< unsigned char, dim > LabelObjectType;
   typedef itk::LabelMap< LabelObjectType >            LabelMapType;
-
+
+  //reading image to file
   typedef itk::ImageFileReader< ImageType > ReaderType;
   ReaderType::Pointer reader = ReaderType::New();
   reader->SetFileName( argv[1] );
-
+
+  //converting binary image to shape label map
   typedef itk::BinaryImageToShapeLabelMapFilter< ImageType, LabelMapType> I2LType;
   I2LType::Pointer i2l = I2LType::New();
   i2l->SetInput( reader->GetOutput() );
-  i2l->SetFullyConnected( true );

-  i2l->SetFullyConnected( atoi(argv[3]) );
-  i2l->SetInputForegroundValue( atoi(argv[4]) );
-  i2l->SetOutputBackgroundValue( atoi(argv[5]) );
+  //testing get/set FullyConnected macro
+  bool fullyConnected =  atoi(argv[3]);
+  i2l->SetFullyConnected( fullyConnected );
+  TEST_SET_GET_VALUE( fullyConnected, i2l->GetFullyConnected() );
+
+  //testing boolean FullyConnected macro
+  i2l->FullyConnectedOff();
+  TEST_SET_GET_VALUE( false, i2l->GetFullyConnected() );
+
+  i2l->FullyConnectedOn();
+  TEST_SET_GET_VALUE( true, i2l->GetFullyConnected() );
+
+  //testing get/set InputForegroundValue macro
+  int inputForegroundValue = ( atoi(argv[4]) );
+  i2l->SetInputForegroundValue( inputForegroundValue );
+  TEST_SET_GET_VALUE( inputForegroundValue, i2l->GetInputForegroundValue() );
+
+  //testing get/set OutputBackgroundValue macro
+  int outputBackgroundValue = ( atoi(argv[5]) );
+  i2l->SetOutputBackgroundValue( outputBackgroundValue );
+  TEST_SET_GET_VALUE( outputBackgroundValue, i2l->GetOutputBackgroundValue() );
+
+  //testing get/set ComputeFeretDiameter macro
+  bool computeFeretDiameter =  atoi(argv[6]);
+  i2l->SetComputeFeretDiameter( computeFeretDiameter );
+  TEST_SET_GET_VALUE( computeFeretDiameter, i2l->GetComputeFeretDiameter() );
+
+  //testing boolean ComputeFeretDiameter macro
+  i2l->ComputeFeretDiameterOff();
+  TEST_SET_GET_VALUE( false, i2l->GetComputeFeretDiameter() );
+
+  i2l->ComputeFeretDiameterOn();
+  TEST_SET_GET_VALUE( true, i2l->GetComputeFeretDiameter() );
+
+
+  //testing get/set ComputePerimeter macro
+  bool computePerimeter =  atoi(argv[6]);
+  i2l->SetComputePerimeter( computePerimeter );
+  TEST_SET_GET_VALUE( computePerimeter, i2l->GetComputePerimeter() );
+
+  //testing boolean ComputePerimeter macro
+  i2l->ComputePerimeterOff();
+  TEST_SET_GET_VALUE( false, i2l->GetComputePerimeter() );
+
+  i2l->ComputePerimeterOn();
+  TEST_SET_GET_VALUE( true, i2l->GetComputePerimeter() );

   typedef itk::LabelMapToLabelImageFilter< LabelMapType, ImageType> L2IType;
   L2IType::Pointer l2i = L2IType::New();


Removing all demand from OPIN/IPIN nodes

opin demand is used as the demand multiplier in Wotan.
Wotan can also keep path histories for selected types of nodes close to the source/sink;
these path histories are accounted for during the probability analysis step and the
associated probabilities are consequently removed.

In the case of input pin equivalent architectures there is only one opin per class.
Consequently all demand on it gets removed during probability analysis.

In the case of output (or inout) equivalent architectures there are 20 opins per class.
So during probability analysis the path history of only one of those 20 sub-sinks is removed.
Consequently at high demand multipliers routability evaluation is skewed unfairly away from
output-equivalent architectures.

The solution here was to remove demands on opins and ipins. Another possible solution could be
to disable path count histories.

--- SRC/analysis/enumerate.cxx
+++ SRC/analysis/enumerate.cxx
@@ -33,7 +33,7 @@
 	if (traversal_dir == FORWARD_TRAVERSAL){
 		/* increment node demand of all nodes except SOURCE & SINK */
 		e_rr_type node_type = rr_node[popped_node].get_rr_type();
-		if (node_type != SOURCE && node_type != SINK){
+		if (node_type != SOURCE && node_type != SINK     && node_type != OPIN && node_type != IPIN){
 			int node_weight = rr_node[popped_node].get_weight();
 			int dist_to_source = ss_distances[popped_node].get_source_distance();
 			float demand_contribution = node_topo_inf[popped_node].buckets.get_num_paths(node_weight, dist_to_source, max_path_weight);


remove that too

remove that too

--- selfdrive/camerad/cameras/camera_replay.cc
+++ selfdrive/camerad/cameras/camera_replay.cc
@@ -1,124 +0,0 @@
-#include "selfdrive/camerad/cameras/camera_replay.h"
-
-#include <cassert>
-#include <thread>
-
-#include "common/clutil.h"
-#include "common/util.h"
-
-extern ExitHandler do_exit;
-
-void camera_autoexposure(CameraState *s, float grey_frac) {}
-
-namespace {
-
-const char *BASE_URL = "https://commadataci.blob.core.windows.net/openpilotci/";
-
-const std::string road_camera_route = "0c94aa1e1296d7c6|2021-05-05--19-48-37";
-// const std::string driver_camera_route = "534ccd8a0950a00c|2021-06-08--12-15-37";
-
-std::string get_url(std::string route_name, const std::string &camera, int segment_num) {
-  std::replace(route_name.begin(), route_name.end(), '|', '/');
-  return util::string_format("%s%s/%d/%s.hevc", BASE_URL, route_name.c_str(), segment_num, camera.c_str());
-}
-
-void camera_init(VisionIpcServer *v, CameraState *s, int camera_id, unsigned int fps, cl_device_id device_id, cl_context ctx, VisionStreamType rgb_type, VisionStreamType yuv_type, const std::string &url) {
-  s->frame = new FrameReader();
-  if (!s->frame->load(url)) {
-    printf("failed to load stream from %s", url.c_str());
-    assert(0);
-  }
-
-  CameraInfo ci = {
-      .frame_width = (uint32_t)s->frame->width,
-      .frame_height = (uint32_t)s->frame->height,
-      .frame_stride = (uint32_t)s->frame->width * 3,
-  };
-  s->ci = ci;
-  s->camera_num = camera_id;
-  s->fps = fps;
-  s->buf.init(device_id, ctx, s, v, FRAME_BUF_COUNT, rgb_type, yuv_type);
-}
-
-void camera_close(CameraState *s) {
-  delete s->frame;
-}
-
-void run_camera(CameraState *s) {
-  uint32_t stream_frame_id = 0, frame_id = 0;
-  size_t buf_idx = 0;
-  std::unique_ptr<uint8_t[]> yuv_buf = std::make_unique<uint8_t[]>(s->frame->getYUVSize());
-  while (!do_exit) {
-    if (stream_frame_id == s->frame->getFrameCount()) {
-      // loop stream
-      stream_frame_id = 0;
-    }
-    if (s->frame->get(stream_frame_id++, yuv_buf.get())) {
-      s->buf.camera_bufs_metadata[buf_idx] = {.frame_id = frame_id};
-      auto &buf = s->buf.camera_bufs[buf_idx];
-      CL_CHECK(clEnqueueWriteBuffer(buf.copy_q, buf.buf_cl, CL_TRUE, 0, s->frame->getYUVSize(), yuv_buf.get(), 0, NULL, NULL));
-      s->buf.queue(buf_idx);
-      ++frame_id;
-      buf_idx = (buf_idx + 1) % FRAME_BUF_COUNT;
-    }
-    util::sleep_for(1000 / s->fps);
-  }
-}
-
-void road_camera_thread(CameraState *s) {
-  util::set_thread_name("replay_road_camera_thread");
-  run_camera(s);
-}
-
-// void driver_camera_thread(CameraState *s) {
-//   util::set_thread_name("replay_driver_camera_thread");
-//   run_camera(s);
-// }
-
-void process_road_camera(MultiCameraState *s, CameraState *c, int cnt) {
-  const CameraBuf *b = &c->buf;
-  MessageBuilder msg;
-  auto framed = msg.initEvent().initRoadCameraState();
-  fill_frame_data(framed, b->cur_frame_data);
-  framed.setImage(kj::arrayPtr((const uint8_t *)b->cur_yuv_buf->addr, b->cur_yuv_buf->len));
-  framed.setTransform(b->yuv_transform.v);
-  s->pm->send("roadCameraState", msg);
-}
-
-// void process_driver_camera(MultiCameraState *s, CameraState *c, int cnt) {
-//   MessageBuilder msg;
-//   auto framed = msg.initEvent().initDriverCameraState();
-//   framed.setFrameType(cereal::FrameData::FrameType::FRONT);
-//   fill_frame_data(framed, c->buf.cur_frame_data);
-//   s->pm->send("driverCameraState", msg);
-// }
-
-}  // namespace
-
-void cameras_init(VisionIpcServer *v, MultiCameraState *s, cl_device_id device_id, cl_context ctx) {
-  camera_init(v, &s->road_cam, CAMERA_ID_LGC920, 20, device_id, ctx,
-              VISION_STREAM_RGB_ROAD, VISION_STREAM_ROAD, get_url(road_camera_route, "fcamera", 0));
-  // camera_init(v, &s->driver_cam, CAMERA_ID_LGC615, 10, device_id, ctx,
-  //             VISION_STREAM_RGB_DRIVER, VISION_STREAM_DRIVER, get_url(driver_camera_route, "dcamera", 0));
-  s->pm = new PubMaster({"roadCameraState", "driverCameraState", "thumbnail"});
-}
-
-void cameras_open(MultiCameraState *s) {}
-
-void cameras_close(MultiCameraState *s) {
-  camera_close(&s->road_cam);
-  camera_close(&s->driver_cam);
-  delete s->pm;
-}
-
-void cameras_run(MultiCameraState *s) {
-  std::vector<std::thread> threads;
-  threads.push_back(start_process_thread(s, &s->road_cam, process_road_camera));
-  // threads.push_back(start_process_thread(s, &s->driver_cam, process_driver_camera));
-  // threads.push_back(std::thread(driver_camera_thread, &s->driver_cam));
-  road_camera_thread(&s->road_cam);
-
-  for (auto &t : threads) t.join();
-
-  cameras_close(s);
-}


Forgot a .get() because this is an OwnPtr

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@54869 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp
+++ WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp
@@ -863,7 +863,7 @@

 void MediaPlayerPrivate::notifySyncRequired(const GraphicsLayer*)
 {
-    GraphicsLayerCACF* videoGraphicsLayer = static_cast<GraphicsLayerCACF*>(m_qtVideoLayer);
+    GraphicsLayerCACF* videoGraphicsLayer = static_cast<GraphicsLayerCACF*>(m_qtVideoLayer.get());
     if (videoGraphicsLayer)
         videoGraphicsLayer->notifySyncRequired();
  }


notifier isn't actually called if the arg isn't passed

--- np-divs/cli.cpp
+++ np-divs/cli.cpp
@@ -63,12 +63,8 @@
     flann::SearchParams search_params;

     void parse_div_funcs(const vector<string> &names) {
-        if (names.size() == 0) {
-            div_funcs.push_back(div_func_from_str("l2"));
-        } else {
-            for (size_t i = 0; i < names.size(); i++) {
-                div_funcs.push_back(div_func_from_str(names[i]));
-            }
+        for (size_t i = 0; i < names.size(); i++) {
+            div_funcs.push_back(div_func_from_str(names[i]));
         }
     }

@@ -98,6 +94,10 @@
         return 1;

     size_t num_df = opts.div_funcs.size();
+    if (num_df == 0) {
+        cerr << "Error: at least one div func is required\n";
+        return 1;
+    }

     // load input bags
     // TODO - gracefully handle nonexisting files


fixed iterator deletion bug that caused crashes

--- moveit_ros/trajectory_execution_manager/src/trajectory_execution_manager.cpp
+++ moveit_ros/trajectory_execution_manager/src/trajectory_execution_manager.cpp
@@ -313,9 +313,9 @@
       while (uit != used_handles.end())
         if ((*uit)->getLastExecutionStatus() != moveit_controller_manager::ExecutionStatus::RUNNING)
         {
-          std::set<moveit_controller_manager::MoveItControllerHandlePtr>::iterator uit2 = ++uit;
-          used_handles.erase(uit);
-          uit = uit2;
+          std::set<moveit_controller_manager::MoveItControllerHandlePtr>::iterator toErase = uit;
+          ++uit;
+          used_handles.erase(toErase);
         }
         else
           ++uit;


COMP: Force continuous dartclients to run.

--- Modules/DiffusionImaging/MiniApps/TensorReconstruction.cpp
+++ Modules/DiffusionImaging/MiniApps/TensorReconstruction.cpp
@@ -26,9 +26,11 @@
 #include <itksys/SystemTools.hxx>

 using namespace mitk;
+
 /**
  * Convert files from one ending to the other
  */
+
 int main(int argc, char* argv[])
 {
     std::cout << "TensorReconstruction";


initialized variable

initialized variable

--- Modules/ImageStatistics/mitkMinMaxImageFilterWithIndex.hxx
+++ Modules/ImageStatistics/mitkMinMaxImageFilterWithIndex.hxx
@@ -33,7 +33,10 @@
   PixelType value;

   PixelType threadMin, threadMax;
-  IndexType threadMinIndex, threadMaxIndex;
+  IndexType threadMinIndex;
+  IndexType threadMaxIndex;
+  threadMinIndex.Fill(0);
+  threadMaxIndex.Fill(0);

   threadMin = std::numeric_limits<PixelType>::max();
   threadMax = std::numeric_limits<PixelType>::min();


Fix coping refereces to map

Fix coping refereces to map

--- Options/JPetOptionsGenerator/JPetOptionsGeneratorTools.cpp
+++ Options/JPetOptionsGenerator/JPetOptionsGeneratorTools.cpp
@@ -90,17 +90,17 @@
   }
   if (isOptionSet(controlSettings, "outputFileType_std::string")) {
     newOpts["inputFileType_std::string"] = getOptionAsString(controlSettings,
-      "outputFileType_std::string");
+                                           "outputFileType_std::string");
   }
   if (isOptionSet(controlSettings, "outputFile_std::string")) {
     newOpts["inputFile_std::string"] = getOptionAsString(controlSettings,
-      "outputFile_std::string");
+                                       "outputFile_std::string");
   }
   if (isOptionSet(controlSettings, "outputPath_std::string")) {
     auto outPath  = std::string(getOutputPath(controlSettings));
     if (!outPath.empty()) {
       newOpts.at("inputFile_std::string") = outPath
-        + JPetCommonTools::extractFileNameFromFullPath(getInputFile(newOpts));
+                                            + JPetCommonTools::extractFileNameFromFullPath(getInputFile(newOpts));
     }
   }
   return newOpts;
@@ -134,7 +134,7 @@
   transformationMap["range_std::vector<int>"].push_back(generateLowerEventBound);
   transformationMap["range_std::vector<int>"].push_back(generateHigherEventBound);
   addTransformFunction(transformationMap, "type_std::string",
-    jpet_options_tools::generateSetFileTypeTransformator(options));
+                       jpet_options_tools::generateSetFileTypeTransformator(options));
   return transformationMap;
 }

@@ -170,8 +170,8 @@
 }

 void addTransformFunction(TransformersMap& map,
-  const std::string& name,
-  Transformer transformFunction)
+                          const std::string& name,
+                          Transformer transformFunction)
 {
   map[name].push_back(transformFunction);
 }
@@ -186,7 +186,7 @@
   options.insert(optionsFromJson.begin(), optionsFromJson.end());
 }

-void setOutputFileType(OptsStrAny& options, const std::string& fileType)
+void setOutputFileType(OptsStrAny& options, const std::string fileType)
 {
   options["outputFileType_std::string"] = fileType;
 }
@@ -200,12 +200,12 @@
   options["resetEventRange_bool"] = isReset;
 }

-void setOutputFile(OptsStrAny& options, const std::string& file)
+void setOutputFile(OptsStrAny& options, const std::string file)
 {
   options["outputFile_std::string"] = file;
 }

-void setOutputPath(OptsStrAny& options, const std::string& path)
+void setOutputPath(OptsStrAny& options, const std::string path)
 {
   options["outputPath_std::string"] = path;
 }


fix in filling antiLambda histo

fix in filling antiLambda histo

--- PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskPOmegaPenne.cxx
+++ PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskPOmegaPenne.cxx
@@ -1069,7 +1069,7 @@
                 h2_CPA_pt_invMass[21]->Fill(vAntiLambda[i].GetPt(), CalculateInvMassLambda(vAntiLambda[i], true));
                 for (size_t j = i + 1; j < vAntiLambda.size(); j++)
                 {
-                    h2_CPA_pt_invMass[29]->Fill(vAntiLambda[i].GetPt(), CalculateInvMassLambda(vAntiLambda[i], true));
+                    h2_CPA_pt_invMass[29]->Fill(CalculateInvMassLambda(vAntiLambda[i], true, CalculateInvMassLambda(vAntiLambda[i], true));
                 }
             }
             vAntiLambda[i].SetUse(true);
@@ -1103,7 +1103,7 @@
                 h2_CPA_pt_invMass[22]->Fill(vAntiLambda[i].GetPt(), CalculateInvMassLambda(vAntiLambda[i], true));
                 for (size_t j = i + 1; j < vAntiLambda.size(); j++)
                 {
-                    h2_CPA_pt_invMass[30]->Fill(vAntiLambda[i].GetPt(), CalculateInvMassLambda(vAntiLambda[i], true));
+                    h2_CPA_pt_invMass[30]->Fill(CalculateInvMassLambda(vAntiLambda[i], true), CalculateInvMassLambda(vAntiLambda[i], true));
                 }
             }
             vAntiLambda[i].SetUse(true);


Fix path to the AddTaskPhysPHOSQA

Fix path to the AddTaskPhysPHOSQA

--- PWGGA/PHOSTasks/CaloCellQA/phys/macros/AddTaskPhysPHOSQA.C
+++ PWGGA/PHOSTasks/CaloCellQA/phys/macros/AddTaskPhysPHOSQA.C
@@ -1,6 +1,6 @@
 AliAnalysisTaskSE * AddTaskPhysPHOSQA()
 {
-  gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/PHOSTasks/CaloCellQA/macros/AddTaskCaloCellsPhysQA.C");
+  gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/PHOSTasks/CaloCellQA/phys/macros/AddTaskCaloCellsPhysQA.C");

   AliAnalysisTaskCaloCellsPhysQA *taskPHOSCellQA = AddTaskCaloCellsPhysQA(5, 1, "CaloCellsQA.root","PHOSCellsQA");
   taskPHOSCellQA->GetCaloCellsQA()->SetClusterEnergyCuts(0.3,0.3,1.0);
@@ -9,4 +9,4 @@
   qa->SetPhysicsClusterCut(0.3, 3, 12.5e-9);

   return taskPHOSCellQA;
-}+}


task update

task update

--- PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraAOD.cxx
+++ PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraAOD.cxx
@@ -146,7 +146,7 @@
     //check on centrality distribution
     fHistMan->GetPtHistogram("CentCheck")->Fill(fAOD->GetCentrality()->GetCentralityPercentile("V0M"),fAOD->GetHeader()->GetCentralityP()->GetCentralityPercentileUnchecked("V0M"));

-    if(fEventCuts->IsSelected(fAOD))return;//event selection
+    if(!fEventCuts->IsSelected(fAOD))return;//event selection

     //fill q distributions vs centrality, after all event selection
     fHistMan->GetqVecHistogram(kHistqVecPos)->Fill(qPos,fAOD->GetCentrality()->GetCentralityPercentile("V0M"));  // qVector distribution


Update thumnails for all template operations.

Change-Id: I7370e2ec459f64366277217b30875172104a72f6

--- sfx2/source/control/templatefolderview.cxx
+++ sfx2/source/control/templatefolderview.cxx
@@ -297,40 +297,29 @@

         sal_uInt16 nEntries = mpDocTemplates->GetCount(i);

-        if (nEntries)
-        {
-            /// Preview first 2 thumbnails for folder
-            pItem->maPreview1 = lcl_fetchThumbnail(mpDocTemplates->GetPath(i,0),
-                                                   THUMBNAIL_MAX_WIDTH*0.75,
-                                                   THUMBNAIL_MAX_HEIGHT*0.75);
-
-            if ( nEntries > 2 )
-                pItem->maPreview2 = lcl_fetchThumbnail(mpDocTemplates->GetPath(i,1),
-                                                       THUMBNAIL_MAX_WIDTH*0.75,
-                                                       THUMBNAIL_MAX_HEIGHT*0.75);
-
-            for (sal_uInt16 j = 0; j < nEntries; ++j)
+        for (sal_uInt16 j = 0; j < nEntries; ++j)
+        {
+            rtl::OUString aName = mpDocTemplates->GetName(i,j);
+            rtl::OUString aURL = mpDocTemplates->GetPath(i,j);
+            rtl::OUString aType = SvFileInformationManager::GetDescription(INetURLObject(aURL));
+
+            if ((sal_uInt32)aName.getLength() > mpItemAttrs->nMaxTextLenght)
             {
-                rtl::OUString aName = mpDocTemplates->GetName(i,j);
-                rtl::OUString aURL = mpDocTemplates->GetPath(i,j);
-                rtl::OUString aType = SvFileInformationManager::GetDescription(INetURLObject(aURL));
-
-                if ((sal_uInt32)aName.getLength() > mpItemAttrs->nMaxTextLenght)
-                {
-                    aName = aName.copy(0,mpItemAttrs->nMaxTextLenght-3);
-                    aName += "...";
-                }
-
-                TemplateViewItem *pTemplateItem = new TemplateViewItem(*mpItemView,mpItemView);
-                pTemplateItem->mnId = j+1;
-                pTemplateItem->maText = aName;
-                pTemplateItem->setPath(aURL);
-                pTemplateItem->setFileType(aType);
-                pTemplateItem->maPreview1 = lcl_fetchThumbnail(aURL,THUMBNAIL_MAX_WIDTH,THUMBNAIL_MAX_HEIGHT);
-
-                pItem->maTemplates.push_back(pTemplateItem);
+                aName = aName.copy(0,mpItemAttrs->nMaxTextLenght-3);
+                aName += "...";
             }
-        }
+
+            TemplateViewItem *pTemplateItem = new TemplateViewItem(*mpItemView,mpItemView);
+            pTemplateItem->mnId = j+1;
+            pTemplateItem->maText = aName;
+            pTemplateItem->setPath(aURL);
+            pTemplateItem->setFileType(aType);
+            pTemplateItem->maPreview1 = lcl_fetchThumbnail(aURL,THUMBNAIL_MAX_WIDTH,THUMBNAIL_MAX_HEIGHT);
+
+            pItem->maTemplates.push_back(pTemplateItem);
+        }
+
+        lcl_updateThumbnails(pItem);

         mItemList.push_back(pItem);
     }
@@ -486,9 +475,14 @@
                     pItem->maTemplates.erase(pIter);

                     mpItemView->RemoveItem(nItemId);
+
                     break;
                 }
             }
+
+            lcl_updateThumbnails(pItem);
+
+            CalculateItemPositions();

             break;
         }
@@ -609,6 +603,10 @@
         pTemplate->setFileType(SvFileInformationManager::GetDescription(INetURLObject(rPath)));

         pItem->maTemplates.push_back(pTemplate);
+
+        lcl_updateThumbnails(pItem);
+
+        CalculateItemPositions();
     }
 }

@@ -699,7 +697,7 @@
         }
         else
         {
-            pItem->maPreview1 = lcl_ScaleImg(pItem->maTemplates[i]->maPreview1,
+            pItem->maPreview2 = lcl_ScaleImg(pItem->maTemplates[i]->maPreview1,
                                             THUMBNAIL_MAX_WIDTH*0.75,
                                             THUMBNAIL_MAX_HEIGHT*0.75);
         }


Complete a task related to the answer of the second part of question 3.7

For more info, refer to issue #23 Update 4.