Dear Users,<div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><font class="Apple-style-span" face="arial"><span class="Apple-style-span" style="font-size: small;"><br>
</span></font></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;">I want to change the orientation of 4D image and OrientImageFilter works only for 3D image.</span></font></div>
<div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;">I extrapolate 3D images with <span class="Apple-style-span" style="color: rgb(209, 44, 37); ">ExtractImageFilter<span class="Apple-style-span" style="color: rgb(0, 0, 0); ">, apply the Filter on OrientImageFilter and then I paste the 3D image on 4D image with <span class="Apple-style-span" style="color: rgb(209, 44, 37); ">PasteImageFilter.</span></span></span></span></font></div>
<div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><span class="Apple-style-span" style="color: rgb(209, 44, 37); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span class="Apple-style-span" style="color: rgb(209, 44, 37); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">The final 4D image is empty and I don't understand where the error is.</span></span></span></span></span></font></div>
<div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><span class="Apple-style-span" style="color: rgb(209, 44, 37); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span class="Apple-style-span" style="color: rgb(209, 44, 37); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">Could somebody give me a help please?</span></span></span></span></span></font></div>
<div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br>
</span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;">This is the code:</span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br>
</span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo">
regionPasteM.SetIndex( Origin );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>regionPasteM.SetSize( m_file1_reader->GetOutput()->GetLargestPossibleRegion().GetSize());<span style="color: #00841c">/</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>pasteimageINM->SetRegions( regionPasteM ); </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>pasteimageINM->Allocate(); </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>pasteimageINM->SetSpacing( m_file1_reader->GetOutput()->GetSpacing() ); </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>pasteimageINM->SetOrigin( m_file1_reader->GetOutput()->GetOrigin()); </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>pasteimageINM->FillBuffer( <span style="color: #2a2bd3">0</span> ); </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #00841c"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>pasterM->SetInput(pasteimageINM); </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>pasterM->SetSourceImage(m_file1_reader->GetOutput()); </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>pasterM->SetDestinationImage(pasteimageINM);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">        </span> </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #bb2b9f">for</span>(<span style="color: #bb2b9f">unsigned</span> <span style="color: #bb2b9f">int</span> i=<span style="color: #2a2bd3">0</span>;i<m_file1_reader->GetOutput()->GetLargestPossibleRegion().GetSize()[<span style="color: #2a2bd3">3</span>];i++)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>std::cout<<<span style="color: #d12c25">"i: "</span><<i<<std::endl;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>InputImageType::IndexType start;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>InputImageType::SizeType size;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>start[<span style="color: #2a2bd3">0</span>] =<span style="color: #2a2bd3">0</span> ;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>start[<span style="color: #2a2bd3">1</span>] =<span style="color: #2a2bd3">0</span> ;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>start[<span style="color: #2a2bd3">2</span>] =<span style="color: #2a2bd3">0</span> ;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>start[<span style="color: #2a2bd3">3</span>] =i;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">                </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>size[<span style="color: #2a2bd3">0</span>] =m_file1_reader->GetOutput()->GetLargestPossibleRegion().GetSize()[<span style="color: #2a2bd3">0</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>size[<span style="color: #2a2bd3">1</span>] =m_file1_reader->GetOutput()->GetLargestPossibleRegion().GetSize()[<span style="color: #2a2bd3">1</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>size[<span style="color: #2a2bd3">2</span>] =m_file1_reader->GetOutput()->GetLargestPossibleRegion().GetSize()[<span style="color: #2a2bd3">2</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>size[<span style="color: #2a2bd3">3</span>] =<span style="color: #2a2bd3">0</span>; </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">                </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>InputImageType::RegionType desiredRegion;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>desiredRegion.SetSize( size );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>desiredRegion.SetIndex( start );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>m_extractfilter->SetExtractionRegion(desiredRegion );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>m_extractfilter->SetInput(m_file1_reader->GetOutput()); </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">                </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>orienter->SetInput( m_extractfilter->GetOutput() );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>orienter->SetUseImageDirection(<span style="color: #bb2b9f">true</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>orienter->SetDesiredCoordinateOrientation(itk::SpatialOrientation:: ITK_COORDINATE_ORIENTATION_RPI);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>orienter->Update();</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">                </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>pasterM->SetDestinationIndex( start);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>sourceregionM.SetSize( size );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #00841c"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                </span>sourceregionM.SetIndex( start);</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>pasterM->SetSourceRegion(sourceregionM);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>pasterM->Update(); </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">                </span>pasteimageINM=pasterM->GetOutput();<span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span>}<span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><br></p></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px; "><br>
</span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br>
</span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><span class="Apple-style-span" style="color: rgb(209, 44, 37); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span class="Apple-style-span" style="color: rgb(209, 44, 37); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">Thank you very much in advance.</span></span></span></span></span></font></div>
<div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><span class="Apple-style-span" style="color: rgb(209, 44, 37); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span class="Apple-style-span" style="color: rgb(209, 44, 37); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">Serena.</span></span></span></span></span></font></div>
<div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br>
</span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><span class="Apple-style-span" style="color: rgb(209, 44, 37); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span class="Apple-style-span" style="color: rgb(209, 44, 37); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "> </span></span></span></span></span></font></div>