<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thanks Tim,<div class=""><br class=""></div><div class="">according to the documentation, RegionOfInterestImageFilter should do what you say, that is why I tried to used it. Unfortunately, it seems not to keep the original <u class="">logical</u> references...</div><div class=""><br class=""></div><div class="">I am not sure I can efficiently do what you suggest with SimpleITK, but if it turns out to be the only way, I guess I will need to switch to the original ITK. I hoped there was a way to do it without a pixel by pixel copy…</div><div class=""><br class=""></div><div class="">Any other suggestions?</div><div class=""><div class=""><br class=""></div><div class="">Thanks!</div><div class="">Alberto</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 26 Jan 2016, at 11:31, Timothee Evain <<a href="mailto:tevain@telecom-paristech.fr" class="">tevain@telecom-paristech.fr</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hello Alberto,<br class=""><br class="">If I remember well, the RegionOfInterestImageFilter keeps the subparts in the same physical space, i.e. a same index will get you the same pixel/voxel in the ROI as in the original. So I would use an iterator to create your full mask image. Something like :<br class=""><br class="">itk::Image<Type,Dim>::Pointer FullMask=itk::Image<Type,Dim>::New();<br class="">FullMask->SetRegions(OriginalImage->GetLargestPossibleRegion());<br class="">FullMask->Allocate();<br class=""><br class="">itk::ImageRegionIteratorWithIndex<itk::Image<Type,Dim>> Iter(FullMask,FullMask->GetLargestPossibleRegion());<br class="">Iter.GoToBegin();<br class=""><br class="">while(!Iter.IsAtEnd())<br class="">{<br class="">  itk::Index<Dim> CurrentPoint=Iter.GetIndex();<br class="">  if(//There you test the index to know from which subimage it belong//)<br class="">  {<br class="">    Iter.Set(SubImage->GetPixel(CurrentPoint));<br class="">  }<br class="">  ++Iter;<br class="">}<br class=""><br class="">HTH,<br class=""><br class="">Tim<br class=""><br class="">----- Mail original -----<br class="">De: "Alberto Bert" <<a href="mailto:bert.alberto@gmail.com" class="">bert.alberto@gmail.com</a>><br class="">À: "ITK Users" <<a href="mailto:insight-users@itk.org" class="">insight-users@itk.org</a>><br class="">Envoyé: Mardi 26 Janvier 2016 11:07:49<br class="">Objet: [ITK] [ITK-users] Merging segmentation masks in different region<span class="Apple-tab-span" style="white-space:pre">        </span>of<span class="Apple-tab-span" style="white-space:pre">  </span>interests<br class=""><br class="">Hi,<br class=""><br class="">I have several rectangular regions of interest from a single image (extracted using RegionOfInterestImageFilter), and I am processing one at a time to extract from each of them a segmentation masks (image of labels with 0 or 1). Finally, I would need to “merge” (i.e. “combine” or “and”) the various ROI masks (different size and origin) in a single mask having the same size and origin of the original image. Let’s say I would need to “put back in the right place” the ROI masks.<br class=""><br class="">The AndImageFilter does not allow me to combine the various ROI masks ("Inputs do not occupy the same physical space!”). I browsed the documentation but I could not find a viable solution...<br class=""><br class="">I am currently using SimpleITK.<br class=""><br class="">Can you help me please?<br class=""><br class="">Thanks a lot!<br class="">Best<br class="">Alberto<br class="">_____________________________________<br class="">Powered by <a href="http://www.kitware.com" class="">www.kitware.com</a><br class=""><br class="">Visit other Kitware open-source projects at<br class=""><a href="http://www.kitware.com/opensource/opensource.html" class="">http://www.kitware.com/opensource/opensource.html</a><br class=""><br class="">Kitware offers ITK Training Courses, for more information visit:<br class="">http://www.kitware.com/products/protraining.php<br class=""><br class="">Please keep messages on-topic and check the ITK FAQ at:<br class="">http://www.itk.org/Wiki/ITK_FAQ<br class=""><br class="">Follow this link to subscribe/unsubscribe:<br class="">http://public.kitware.com/mailman/listinfo/insight-users<br class="">_______________________________________________<br class="">Community mailing list<br class="">Community@itk.org<br class="">http://public.kitware.com/mailman/listinfo/community<br class=""></div></blockquote></div><br class=""></div></div></body></html>