<div dir="ltr">You haven't created the MinimumImageFilter:<div><br><div>typename MinimumImageFilterType::Pointer MinimumImageFilter = <span style="font-size:12.8px">MinimumImageFilterType::New()</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 4, 2017 at 8:48 AM, Jonas Teuwen <span dir="ltr"><<a href="mailto:jonasteuwen@gmail.com" target="_blank">jonasteuwen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I wish to apply a filter slice by slice, for which I use SliceBySliceImageFilter (after the appropriate definitions):</div><div><br></div><div>"""</div><div><div>  typedef itk::<wbr>LaplacianSharpeningImageFilter <ImageType3D, FloatImageType3D> LaplacianSharpeningImageFilter<wbr>Type;</div><div>  LaplacianSharpeningImageFilter<wbr>Type::Pointer LaplacianSharpeningImageFilter = LaplacianSharpeningImageFilter<wbr>Type::New();</div><div>  LaplacianSharpeningImageFilter<wbr>->SetInput(reader->GetOutput()<wbr>);</div><div>  LaplacianSharpeningImageFilter<wbr>->Update();</div><div><br></div><div>  typedef itk::FlatStructuringElement<2> StructuringElementType;</div><div>  StructuringElementType::<wbr>RadiusType AnnulusRadius;</div><div>  AnnulusRadius.Fill(10);</div><div>  StructuringElementType StructuringElement = StructuringElementType::<wbr>Annulus(AnnulusRadius, Thickness, false, false);</div><div><br></div><div>  typedef itk::SliceBySliceImageFilter<<wbr>FloatImageType3D, FloatImageType3D> SliceFilterType;</div><div>  SliceFilterType::Pointer SliceFilter = SliceFilterType::New();</div><div><br></div><div>  typedef itk::<wbr>GrayscaleDilateImageFilter<<wbr>SliceFilterType::<wbr>InternalInputImageType,</div><div>                                          SliceFilterType::<wbr>InternalOutputImageType, StructuringElementType> GrayscaleDilateImageFilterType<wbr>;</div><div>  GrayscaleDilateImageFilterType<wbr>::Pointer GrayscaleDilateImageFilter = GrayscaleDilateImageFilterType<wbr>::New();</div><div>  GrayscaleDilateImageFilter-><wbr>SetKernel(StructuringElement);</div><div>  </div><div>  SliceFilter->SetInput(<wbr>LaplacianSharpeningImageFilter<wbr>->GetOutput());</div><div>  SliceFilter->SetFilter(<wbr>GrayscaleDilateImageFilter);</div><div>"""</div><div>If I write the output of SliceFilter to a file, I get what I expact, but I do want to compute the minimum between the result and the sharpened image:</div><div><br></div><div>  typedef itk::MinimumImageFilter<<wbr>FloatImageType3D, FloatImageType3D, FloatImageType3D> MinimumImageFilterType;</div><div>  typename MinimumImageFilterType::<wbr>Pointer MinimumImageFilter;</div><div>  MinimumImageFilter->SetInput(<wbr>0, SliceFilter->GetOutput());</div></div><div>  MinimumImageFilter->SetInput(<wbr>1, LaplacianSharpeningImageFilter<wbr>->GetOutput());<br></div><div><br></div><div>But that immediately segfaults, even before the output is written to disk. Whichever order, gdb tells me the program crashes at any ->SetInput in the MinimumImageFilter.</div><div>If I on the other hand input a 2D image, and I do not use the SliceBySliceImageFilter, the program seems to work as expected.</div><div><br></div><div>Are there any debugging steps which I could try to find the flaw?</div><div><br></div><div>Best,</div><div>Jonas</div><div><br></div><div><br></div><div><br></div></div>
<br>______________________________<wbr>_______<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_<wbr>FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>