[Insight-users] image region intersection

Kevin H. Hobbs hobbsk at ohiou.edu
Wed Dec 8 13:16:58 EST 2010


Is there any method that will give me the region that is common between
two regions?

I wrote my own but I may have messed up...well I know I messed up
somewhere, but I can't track it down.

My image is broken up into many pieces, each piece is padded by a pixel,
the intersections of the pieces and padded pieces are communicated
between MPI processes.

The relevant chunk of code is between lines 73 and 215. Which is a lot
when what I wish I could do is ( in a sort of pseudo-code ):


  // Get The splits
  std::vector < RegionType > split_regions( mpi_size );
  std::vector < RegionType > padded_regions( mpi_size );
  for ( int split = 0; split < mpi_size; ++split )
    {
    split_regions[ split ]
      = splitter->GetSplit( split, mpi_size, input_region );
    padded_regions[ split ] = split_regions[ split ];
    padded_regions[ split ].PadByRadius( 1 );
    padded_regions[ split ]
      = padded_regions[ split ].INTERSECTWITH(input_region);
    }

  // Our send regions
  std::vector< RegionType > com_snd_regions( mpi_size );
  for ( int split = 0; split < mpi_size; ++split )
    {
    com_snd_regions[ split ]
      = split_regions[ mpi_rank ].INTERSECTWITH(
        padded_regions[ split ] );
    }

  // Our receive regions
  std::vector< RegionType > com_rcv_regions( mpi_size );
  for ( int split = 0; split < mpi_size; ++split )
    {
    com_rcv_regions[ split ]
      = padded_regions[ mpi_rank ].INTERSECTWITH(
        split_regions[ split ] );
    }

As far as I know the INTERSECTWITH method is fictional.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MPIVectorGradientAnisotropicDiffusionImageFilter.cxx
Type: text/x-c++src
Size: 17437 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101208/05b53967/attachment.cxx>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101208/05b53967/attachment.pgp>


More information about the Insight-users mailing list