<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><base href="x-msg://1269/"><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Segoe UI Symbol";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Sprechblasentext Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.SprechblasentextZchn
        {mso-style-name:"Sprechblasentext Zchn";
        mso-style-priority:99;
        mso-style-link:Sprechblasentext;
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hello Bradley,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>yes the Min and Max is set this way:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'> </span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:blue'>typedef</span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> itk::Statistics::ImageToHistogramFilter< InputImageType > ImageToHistogramFilterType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> ImageToHistogramFilterType::HistogramType::MeasurementVectorType lowerBound(numberOfBins);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> lowerBound.Fill(min);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> ImageToHistogramFilterType::HistogramType::MeasurementVectorType upperBound(numberOfBins);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> upperBound.Fill(max) ;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> ImageToHistogramFilterType::HistogramType::SizeType size(1);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> size.Fill(numberOfBins);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> ImageToHistogramFilterType::Pointer imageToHistogramFilter = ImageToHistogramFilterType::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> imageToHistogramFilter->SetInput(image);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> imageToHistogramFilter->SetHistogramBinMinimum(lowerBound);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> imageToHistogramFilter->SetHistogramBinMaximum(upperBound);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> </span><span style='font-size:9.5pt;font-family:Consolas'>imageToHistogramFilter->SetHistogramSize(size);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'>And i looked at the task manager, and all 4 threads seem to work.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Bradley Lowekamp [mailto:blowekamp@mail.nih.gov] <br><b>Gesendet:</b> Mittwoch, 15. Mai 2013 19:21<br><b>An:</b> Arikan Mustafa<br><b>Cc:</b> insight-users@itk.org Users<br><b>Betreff:</b> Re: [Insight-users] Histogram calculation performance between ScalarImageToHistogramGenerator, ImageToHistogramFilter and vtkImageAccumulate<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hello,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Are you manually setting the MinMax for the ImageToHistogramFilter?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Have you looked at threading?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>How do these methods scale as the number of threads increase? You can just set the environment variable ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS for ITK. I am wondering if there is a concurrency issue in <o:p></o:p></p></div><div><p class=MsoNormal>ITK.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Brad<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On May 15, 2013, at 12:50 PM, Arikan Mustafa <<a href="mailto:Mustafa.Arikan@fh-wels.at">Mustafa.Arikan@fh-wels.at</a>> wrote:<o:p></o:p></p></div><p class=MsoNormal><br><br><o:p></o:p></p><div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Calibri","sans-serif"'>Thanks for the quick response.</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Calibri","sans-serif"'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Calibri","sans-serif"'>This is done in release mode. Like this:</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-family:"Calibri","sans-serif"'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span class=apple-converted-space> </span><span style='color:blue'>int</span><span class=apple-converted-space> </span>nTimeStart = GetMilliCount();</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> imageAccumulate->Update();</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span class=apple-converted-space> </span></span><span style='font-size:9.5pt;font-family:Consolas;color:blue'>int</span><span class=apple-converted-space><span style='font-size:9.5pt;font-family:Consolas'> </span></span><span style='font-size:9.5pt;font-family:Consolas'>nTimeElapsed = GetMilliSpan( nTimeStart );</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> …</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:9.5pt;font-family:Consolas'> <span class=apple-converted-space> </span></span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:blue'>int</span><span class=apple-converted-space><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> </span></span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'>nTimeStart2 = GetMilliCount();</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> imageToHistogramFilter->Update();</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span class=apple-converted-space> </span><span style='color:blue'>int</span><span class=apple-converted-space> </span>nTimeElapsed2 = GetMilliSpan( nTimeStart2 );</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> …</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:9.5pt;font-family:Consolas'> <span class=apple-converted-space> </span></span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:blue'>int</span><span class=apple-converted-space><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> </span></span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'>nTimeStart3 = GetMilliCount();</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> scalarImageToHistogramGenerator->Compute();</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span class=apple-converted-space> </span></span><span style='font-size:9.5pt;font-family:Consolas;color:blue'>int</span><span class=apple-converted-space><span style='font-size:9.5pt;font-family:Consolas'> </span></span><span style='font-size:9.5pt;font-family:Consolas'>nTimeElapsed3 = GetMilliSpan( nTimeStart3 );</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><div><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span class=apple-converted-space><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> </span></span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>David Cole [mailto:dlrdave@<a href="http://aol.com"><span style='color:purple'>aol.com</span></a>]<span class=apple-converted-space> </span><br><b>Gesendet:</b><span class=apple-converted-space> </span>Mittwoch, 15. Mai 2013 17:31<br><b>An:</b><span class=apple-converted-space> </span><a href="mailto:insight-users@itk.org"><span style='color:purple'>insight-users@itk.org</span></a>; Arikan Mustafa<br><b>Betreff:</b><span class=apple-converted-space> </span>Re: [Insight-users] Histogram calculation performance between ScalarImageToHistogramGenerator, ImageToHistogramFilter and vtkImageAccumulate</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> <o:p></o:p></span></p></div><div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>Is this on Windows, with a Debug build using the Microsoft compiler?</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>If so, re-do the timings with a Release build.</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>The Debug memory allocator has serious performance issues because of the tracking of allocations that they do in the runtime. Release builds are frequently 100x faster in scenarios with lots of small allocations.</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>If this is not MS Debug build on Windows, then just delete this message...<span class=apple-converted-space> </span></span><span style='font-family:"Segoe UI Symbol","sans-serif"'>😊</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>D</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'> </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div></div><p class=MsoNormal><span lang=EN-US style='font-size:13.5pt;font-family:"Helvetica","sans-serif"'>_____________________________________<br>Powered by </span><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif"'><a href="http://www.kitware.com"><span lang=EN-US>www.kitware.com</span></a></span><span lang=EN-US style='font-size:13.5pt;font-family:"Helvetica","sans-serif"'><br><br>Visit other Kitware open-source projects at<br></span><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif"'><a href="http://www.kitware.com/opensource/opensource.html"><span lang=EN-US>http://www.kitware.com/opensource/opensource.html</span></a></span><span lang=EN-US style='font-size:13.5pt;font-family:"Helvetica","sans-serif"'><br><br>Kitware offers ITK Training Courses, for more information visit:<br></span><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif"'><a href="http://www.kitware.com/products/protraining.php"><span lang=EN-US>http://www.kitware.com/products/protraining.php</span></a></span><span lang=EN-US style='font-size:13.5pt;font-family:"Helvetica","sans-serif"'><br><br>Please keep messages on-topic and check the ITK FAQ at:<br></span><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif"'><a href="http://www.itk.org/Wiki/ITK_FAQ"><span lang=EN-US>http://www.itk.org/Wiki/ITK_FAQ</span></a></span><span lang=EN-US style='font-size:13.5pt;font-family:"Helvetica","sans-serif"'><br><br>Follow this link to subscribe/unsubscribe:<br></span><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif"'><a href="http://www.itk.org/mailman/listinfo/insight-users"><span lang=EN-US>http://www.itk.org/mailman/listinfo/insight-users</span></a></span><span lang=EN-US style='font-size:13.5pt;font-family:"Helvetica","sans-serif"'><o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></div></body></html>