| 421 | /// |
| 422 | template<typename TImageType> |
| 423 | void mitk::CLUtil::itkLogicalAndImages(const TImageType * image1, const mitk::Image::Pointer & image2, mitk::Image::Pointer & outimage) |
| 424 | { |
| 425 | |
| 426 | typename TImageType::Pointer itk_outimage = TImageType::New(); |
| 427 | itk_outimage->SetRegions(image1->GetLargestPossibleRegion()); |
| 428 | itk_outimage->SetDirection(image1->GetDirection()); |
| 429 | itk_outimage->SetOrigin(image1->GetOrigin()); |
| 430 | itk_outimage->SetSpacing(image1->GetSpacing()); |
| 431 | |
| 432 | itk_outimage->Allocate(); |
| 433 | itk_outimage->FillBuffer(0); |
| 434 | |
| 435 | typename TImageType::Pointer itk_image2; |
| 436 | mitk::CastToItkImage(image2,itk_image2); |
| 437 | |
| 438 | itk::ImageRegionConstIterator<TImageType> it1(image1, image1->GetLargestPossibleRegion()); |
| 439 | itk::ImageRegionConstIterator<TImageType> it2(itk_image2, itk_image2->GetLargestPossibleRegion()); |
| 440 | itk::ImageRegionIterator<TImageType> oit(itk_outimage,itk_outimage->GetLargestPossibleRegion()); |
| 441 | |
| 442 | while(!it1.IsAtEnd()) |
| 443 | { |
| 444 | if(it1.Value() == 0 || it2.Value() == 0) |
| 445 | { |
| 446 | oit.Set(0); |
| 447 | }else |
| 448 | oit.Set(it1.Value()); |
| 449 | ++it1; |
| 450 | ++it2; |
| 451 | ++oit; |
| 452 | } |
| 453 | |
| 454 | mitk::CastToMitkImage(itk_outimage, outimage); |
| 455 | } |
| 456 | |
| 457 | /// |
| 458 | /// \brief GaussianFilter |
nothing calls this directly
no test coverage detected