]> Creatis software - clitk.git/blob - segmentation/clitkExtractLymphStation_3A.txx
changes in license header
[clitk.git] / segmentation / clitkExtractLymphStation_3A.txx
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================*/
18
19 #include <itkBinaryDilateImageFilter.h>
20 #include <itkMirrorPadImageFilter.h>
21
22 //--------------------------------------------------------------------
23 template <class ImageType>
24 void 
25 clitk::ExtractLymphStationsFilter<ImageType>::
26 ExtractStation_3A_SetDefaultValues()
27 {
28 }
29 //--------------------------------------------------------------------
30
31
32 //--------------------------------------------------------------------
33 template <class ImageType>
34 void 
35 clitk::ExtractLymphStationsFilter<ImageType>::
36 ExtractStation_3A_SI_Limits() 
37 {
38   // Apex of the chest or Sternum & Carina.
39   StartNewStep("[Station 3A] Inf/Sup limits with Sternum and Carina");
40
41   // Get Carina position (has been determined in Station8)
42   m_CarinaZ = GetAFDB()->GetDouble("CarinaZ");
43   
44   // Get Sternum and search for the upper position
45   MaskImagePointer Sternum = GetAFDB()->template GetImage<MaskImageType>("Sternum");
46
47   // Search most sup point
48   MaskImagePointType ps = Sternum->GetOrigin(); // initialise to avoid warning 
49   clitk::FindExtremaPointInAGivenDirection<MaskImageType>(Sternum, GetBackgroundValue(), 2, false, ps);
50   double m_SternumZ = ps[2]+Sternum->GetSpacing()[2]; // One more slice, because it is below this point
51
52   //* Crop support :
53   m_Working_Support = 
54     clitk::CropImageAlongOneAxis<MaskImageType>(m_Working_Support, 2, 
55                                                 m_CarinaZ, m_SternumZ, true,
56                                                 GetBackgroundValue());
57
58   StopCurrentStep<MaskImageType>(m_Working_Support);
59   m_ListOfStations["3A"] = m_Working_Support;
60 }
61 //--------------------------------------------------------------------
62
63
64 //--------------------------------------------------------------------
65 template <class ImageType>
66 void 
67 clitk::ExtractLymphStationsFilter<ImageType>::
68 ExtractStation_3A_Ant_Limits() 
69 {
70   StartNewStep("[Station 3A] Ant limits with Sternum");
71
72   // Get Sternum, keep posterior part.
73   MaskImagePointer Sternum = GetAFDB()->template GetImage<MaskImageType>("Sternum");
74   m_Working_Support = 
75     clitk::SliceBySliceRelativePosition<MaskImageType>(m_Working_Support, Sternum, 2, 
76                                                        0.5, "PostTo", 
77                                                        false, 3, true, false);
78   StopCurrentStep<MaskImageType>(m_Working_Support);
79   m_ListOfStations["3A"] = m_Working_Support;
80 }
81 //--------------------------------------------------------------------
82
83