<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;">Gaëtan,<br><br>This is my suggestion for fitting each label object to a model defined by an arbitrary function (eg Gaussian):<br><br>(1) A model can be described by an ITK spatial object, eg itk::GaussianSpatialObject.<br><br>(2) Following the example given in \binaryAttributeMorphology\generic_attribute.cxx, in your IJ article, we can iterate over each label and access the pixels.<br><br>(3) Following the example given in \Testing\Code\Numerics\itkLevenbergMarquardtOptimizerTest.cxx, we may use the non-linear Levenberg-Marquardt optimiser<br>to fit the model given in (1) to the image obtained in (2).<br><br><br>Does this seem feasible to you? Any suggestions to improve it?<br></div><br>&gt; <br>&gt; Le 18 oct. 07 à 01:04, Ali - a écrit :<br>&gt; <br>&gt; &gt; Gaëtan,<br>&gt; &gt;<br>&gt; &gt; What would be the best way of iterating over a 'label map'<br>&gt; <br>&gt; you can iterate over simply by using their labels :<br>&gt; <br>&gt; labelMap = filter.GetOutput()<br>&gt; for label in range(0, labelMap.GetNumberOfLabelObjects()+1 ):<br>&gt;    labelObject = labelMap.GetLabelObject(label)<br>&gt; <br>&gt; &gt; and fit each indivdual object to a know model (eg 2D Gaussian) and  <br>&gt; &gt; then adding the attributes of the fitting (eg the sigma of the  <br>&gt; &gt; Gaussian fit) to the corresponding object? I guess this could be a  <br>&gt; &gt; good extention of your binary attribute morphology classes.<br>&gt; <br>&gt; I don't know how to fit a 2D gaussian. It may be an interesting  <br>&gt; feature though.<br>&gt; If you can provide some informations about that, and if that's not  <br>&gt; much difficult, I would be pleased to add it :-)<br>&gt; <br>&gt; Regards,<br>&gt; <br>&gt; Gaëtan<br>&gt; <br>&gt; <br><br><br /><hr />Play Movie Mash-up and win  <a href='https://www.moviemashup.co.uk' target='_new'>BIG prizes! </a></body>
</html>