<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Bill,<div><br></div><div>I just have my external modules in the "ITK/Modules/External" directory. I manually manage the git process. Just do:</div><div><br></div><div>cd ITK/Modules/External</div><div>git clone <a href="https://github.com/blowekamp/itkOBBLabelMap.git">https://github.com/blowekamp/itkOBBLabelMap.git</a></div><div><br></div><div>When you run ccmake the "<span style="font-family: Menlo; font-size: 11px;">ITKOBBLabelMap" module should show up where you can enable it.</span></div><div><span style="font-family: Menlo; font-size: 11px;"><br></span></div><div><span style="font-family: Menlo; font-size: 11px;">HTH,</span></div><div><span style="font-family: Menlo; font-size: 11px;">Brad</span></div><div><br><div><div>On Apr 7, 2015, at 2:51 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Brad,<br><br>I don't see a remote.cmake file for your external module.<br><br>Bill<br><br>On Tue, Apr 7, 2015 at 5:37 AM, Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:<br><blockquote type="cite">Hello,<br><br>I have a much improved version of the algorithm to compute oriented bounding boxes here:<br><br><a href="https://github.com/blowekamp/itkOBBLabelMap">https://github.com/blowekamp/itkOBBLabelMap</a><br><br>It is correctly accounts for the image's physical spacing, origin, and direction cosines, significantly faster,  and more memory efficient. Here would be a close to turn-key test/example for this task:<br><br>https://github.com/blowekamp/itkOBBLabelMap/blob/master/test/itkOrientedBoundingBoxImageLabelMapFilterTest2.cxx<br><br>HTH,<br>Brad<br><br>On Apr 7, 2015, at 1:38 AM, Bill Lorensen <bill.lorensen@gmail.com> wrote:<br><br><blockquote type="cite">I have a 2D example that fails when the origin is not 0.0. Now I'll<br>try to find the bug.<br><br><br>On Mon, Apr 6, 2015 at 10:13 AM, Bill Lorensen <bill.lorensen@gmail.com> wrote:<br><blockquote type="cite">Could be a bug. Need to find a smaller test case that fails. Maybe<br>because of non-zero origin. I'll take a look.<br><br><br>On Mon, Apr 6, 2015 at 9:55 AM, Thomas Seidel <seidel@cvrti.utah.edu> wrote:<br><blockquote type="cite">I tried it again. I am quite sure there is nothing wrong with my input<br>files because the filter apparently creates correct output measures for<br>all labels (e.g. eigenvalues, bounding box, volume, etc).<br>But the orientedlabelimages are all zero, except for label 0 (which is my<br>background). The dimension of these images corresponds to the size<br>(length, width, depth) of the oriented bounding boxes.<br><br>I think the image origins are all messed up. May there something be wrong<br>with the center of rotation?<br><br>E.g.: label 0, which is background, has the same bounding box size as the<br>input label image.<br>Input LabelImage:<br>dimensions: 512 1024 130 (in pixels)<br>origin: [102.273, 0, 5.96985] (in physical size)<br><br>oriented image of label 0:<br>dimensions: 1026 515 131<br>origin: [-51.2878, 50.6859, -0.132971]<br><br><br>Is this a bug, or did I forget to set a parameter?<br><br>Thanks,<br>Thomas<br><br><br><br><br><br>On 4/6/15 12:02 AM, "Bill Lorensen" <bill.lorensen@gmail.com> wrote:<br><br><blockquote type="cite">Thomas,<br><br>I compiled your program and ran it on one of my labeled images and it<br>produces the expected output.<br><br>On Sun, Apr 5, 2015 at 2:52 PM, Thomas Seidel <seidel@cvrti.utah.edu><br>wrote:<br><blockquote type="cite">Hi Bill,<br><br>Thanks for your answer. Here is (part of the) source I am using.<br>Do you need the image or source files?<br><br><br><br><br>#include "itkImage.h"<br>#include "itkImageFileReader.h"<br>#include "itkImageFileWriter.h"<br>#include "itkLabelGeometryImageFilter.h"<br><br>#include "itksys/SystemTools.hxx"<br><br>#include <sstream><br><br><br>int main(int argc, char * argv[])<br>{<br> // Verify command line arguments<br> if( argc < 2 )<br>   {<br>   std::cerr << "Usage: " << std::endl;<br>   std::cerr << argv[0] << " InputImageFile [-intensity<br><IntensityImageFile>]" << std::endl;<br>   return EXIT_FAILURE;<br>   }<br> std::string inputFilename = argv[1];<br> std::string intensityFile;<br> bool calcIntensity = false;<br><br><br>   int argcounter = 2;<br> while (argc>argcounter)<br> {<br>       if (!strncmp(argv[argcounter],"-intensity",10) ) {intensityFile<br>=<br>argv[argcounter + 1]; calcIntensity = true; }<br>       argcounter++;<br> }<br><br> // Setup types<br> typedef itk::Image<unsigned int, 3> IntImageType;<br> typedef itk::Image<float, 3> FloatImageType;<br> typedef itk::ImageFileReader<IntImageType>               ReaderType;<br> typedef itk::ImageFileReader<FloatImageType><br>FloatReaderType;<br><br> ReaderType::Pointer reader = ReaderType::New();<br> reader->SetFileName( inputFilename );<br> FloatReaderType::Pointer FloatReader = FloatReaderType::New();<br><br><br><br>  typedef itk::LabelGeometryImageFilter< IntImageType, FloatImageType ><br>LabelGeometryImageFilterType;<br>  LabelGeometryImageFilterType::Pointer labelGeometryImageFilter =<br>LabelGeometryImageFilterType::New();<br>  labelGeometryImageFilter->SetInput( reader->GetOutput() );<br><br><br>  if (calcIntensity)<br>  {<br>       FloatReader->SetFileName(intensityFile);<br>       FloatReader->Update();<br><br>labelGeometryImageFilter->SetIntensityInput(FloatReader->GetOutput());<br>labelGeometryImageFilter->CalculateOrientedIntensityRegionsOn();<br><br>  }<br><br><br>    labelGeometryImageFilter->CalculatePixelIndicesOn();<br> labelGeometryImageFilter->CalculateOrientedBoundingBoxOn();<br>   labelGeometryImageFilter->CalculateOrientedLabelRegionsOn();<br><br> labelGeometryImageFilter->Update();<br><br>  LabelGeometryImageFilterType::LabelsType allLabels =<br>labelGeometryImageFilter->GetLabels();<br> LabelGeometryImageFilterType::LabelsType::iterator allLabelsIt;<br> std::cout << "Number of labels: " <<<br>labelGeometryImageFilter->GetNumberOfLabels() << std::endl;<br> std::cout << std::endl;<br><br><br><br> for( allLabelsIt = allLabels.begin(); allLabelsIt != allLabels.end();<br>allLabelsIt++ )<br>   {<br><br>       LabelGeometryImageFilterType::LabelPixelType labelValue =<br>*allLabelsIt;<br><br><br>       std::ostringstream stream;<br>       stream << labelValue << ".vtk";<br>       typedef itk::ImageFileWriter<IntImageType> WriterType;<br>       WriterType::Pointer writer = WriterType::New();<br>       writer->SetFileName(stream.str());<br><br>writer->SetInput(labelGeometryImageFilter->GetOrientedLabelImage(labelVal<br>u<br>e));<br>       writer->Update();<br><br>       std::ostringstream stream2;<br>       stream2 << labelValue << "-intensity.vtk";<br><br>       if (calcIntensity) {<br>               typedef itk::ImageFileWriter<FloatImageType><br>FloatWriterType;<br>               FloatWriterType::Pointer Floatwriter =<br>FloatWriterType::New();<br>               Floatwriter->SetFileName(stream2.str());<br><br>Floatwriter->SetInput(labelGeometryImageFilter->GetOrientedIntensityImage<br>(labelValue));<br>               Floatwriter->Update();<br>       }<br>   }<br><br><br><br><br><br><br> return EXIT_SUCCESS;<br>}<br><br><br><br><br><br><br>On 4/5/15 12:10 PM, "Bill Lorensen" <bill.lorensen@gmail.com> wrote:<br><br><blockquote type="cite">Do you have a small, compilable example that illustrates the problem?<br><br>On Sun, Apr 5, 2015 at 10:09 AM, Thomas Seidel <seidel@cvrti.utah.edu><br>wrote:<br><blockquote type="cite">Hi all,<br><br>I am using the itkLabelGeometryImageFilter to get information about<br>the<br>orientation of labeled objects.<br>I provide a LabelImage and a IntensityImage.<br>I set CalculateOrientedLabelRegionsOn() and<br>CalculateOrientedIntensityRegionsOn().<br><br>However, when I use<br>writer->SetInput(filter->GetOrientedLabelImage());<br>writer->Update();<br>or<br>writer->SetInput(filter->GetOrientedIntensityImage());<br>writer->Update();<br><br>it just generates empty images (all values 0) with the size of the<br>oriented<br>bounding box.<br><br>Is this how the filter is supposed to work?? I was expecting the<br>rotated<br>labels and the rotated region of the intensity image defined by the<br>oriented<br>bounding box, respectively.<br><br>Thanks,<br>Thomas<br><br>_____________________________________<br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at<br>http://www.kitware.com/opensource/opensource.html<br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://www.kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://public.kitware.com/mailman/listinfo/insight-users<br><br></blockquote><br><br><br>--<br>Unpaid intern in BillsBasement at noware dot com<br></blockquote><br><br><br></blockquote><br><br><br>--<br>Unpaid intern in BillsBasement at noware dot com<br></blockquote><br><br><br></blockquote><br><br><br>--<br>Unpaid intern in BillsBasement at noware dot com<br></blockquote><br><br><br>--<br>Unpaid intern in BillsBasement at noware dot com<br>_____________________________________<br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at<br>http://www.kitware.com/opensource/opensource.html<br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://www.kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://public.kitware.com/mailman/listinfo/insight-users<br></blockquote><br></blockquote><br><br><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br></blockquote></div><br></div></body></html>