- // Store image filenames into AFDB
- writeImage<MaskImageType>(m_ListOfStations["2R"], "seg/Station2R.mhd");
- writeImage<MaskImageType>(m_ListOfStations["2L"], "seg/Station2L.mhd");
- GetAFDB()->SetImageFilename("Station2R", "seg/Station2R.mhd");
- GetAFDB()->SetImageFilename("Station2L", "seg/Station2L.mhd");
- WriteAFDB();
- }
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::ExtractLymphStationsFilter<ImageType>::
-ExtractStation_2RL_SI_Limits()
-{
- // Apex of the chest or Sternum & Carina.
- StartNewStep("[Station 2RL] Inf/Sup limits with Sternum and TopOfAorticArch/CaudalMarginOfLeftBrachiocephalicVein");
-
- /* Rod says: "For the inferior border, unlike in Atlas – UM, there
- is now a difference between 2R and 2L. 2R stops at the
- intersection of the caudal margin of the innominate vein with the
- trachea. 2L extends less inferiorly to the superior border of the
- aortic arch." */
-
- /* Get TopOfAorticArch and CaudalMarginOfLeftBrachiocephalicVein
- - TopOfAorticArch -> can be obtain from Aorta -> most sup part.
- - CaudalMarginOfLeftBrachiocephalicVein -> must inf part of BrachicephalicVein
- */
- MaskImagePointer Aorta = GetAFDB()->template GetImage<MaskImageType>("Aorta");
- MaskImagePointType p = Aorta->GetOrigin(); // initialise to avoid warning
- clitk::FindExtremaPointInAGivenDirection<MaskImageType>(Aorta, GetBackgroundValue(), 2, false, p);
- double TopOfAorticArchZ=p[2];
- GetAFDB()->SetDouble("TopOfAorticArchZ", TopOfAorticArchZ);
-
- MaskImagePointer BrachioCephalicVein = GetAFDB()->template GetImage<MaskImageType>("BrachioCephalicVein");
- clitk::FindExtremaPointInAGivenDirection<MaskImageType>(BrachioCephalicVein, GetBackgroundValue(), 2, true, p);
- double CaudalMarginOfLeftBrachiocephalicVeinZ=p[2];
- GetAFDB()->SetDouble("CaudalMarginOfLeftBrachiocephalicVeinZ", CaudalMarginOfLeftBrachiocephalicVeinZ);
-
- // First, cut on the most inferior part. Add one slice because this
- // inf slice should not be included.
- double inf = std::min(CaudalMarginOfLeftBrachiocephalicVeinZ, TopOfAorticArchZ) + m_Working_Support->GetSpacing()[2];
-
- // Get Sternum and search for the upper position
- MaskImagePointer Sternum = GetAFDB()->template GetImage<MaskImageType>("Sternum");
-
- // Search most sup point
- clitk::FindExtremaPointInAGivenDirection<MaskImageType>(Sternum, GetBackgroundValue(), 2, false, p);
- double m_SternumZ = p[2];
- // +Sternum->GetSpacing()[2]; // One more slice, because it is below this point // NOT HERE ?? WHY DIFFERENT FROM 3A ??
-
- //* Crop support :
- m_Working_Support =
- clitk::CropImageAlongOneAxis<MaskImageType>(m_Working_Support, 2,
- inf, m_SternumZ, true,
- GetBackgroundValue());
-
- StopCurrentStep<MaskImageType>(m_Working_Support);
- m_ListOfStations["2R"] = m_Working_Support;
- m_ListOfStations["2L"] = m_Working_Support;
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::ExtractLymphStationsFilter<ImageType>::
-ExtractStation_2RL_Ant_Limits()
-{
- // -----------------------------------------------------
- /* Rod says: "The anterior border, as with the Atlas – UM, is
- posterior to the vessels (right subclavian vein, left
- brachiocephalic vein, right brachiocephalic vein, left subclavian
- artery, left common carotid artery and brachiocephalic trunk).
- These vessels are not included in the nodal station. The anterior
- border is drawn to the midpoint of the vessel and an imaginary
- line joins the middle of these vessels. Between the vessels,
- station 2 is in contact with station 3a." */
-
- // -----------------------------------------------------
- StartNewStep("[Station 2RL] Ant limits with CommonCarotidArtery");
-
- // Get CommonCarotidArtery
- MaskImagePointer CommonCarotidArtery = GetAFDB()->template GetImage<MaskImageType>("CommonCarotidArtery");
-
- // Remove Ant to CommonCarotidArtery
- typedef SliceBySliceRelativePositionFilter<MaskImageType> SliceRelPosFilterType;
- typename SliceRelPosFilterType::Pointer sliceRelPosFilter = SliceRelPosFilterType::New();
- sliceRelPosFilter->VerboseStepFlagOff();
- sliceRelPosFilter->WriteStepFlagOff();
- sliceRelPosFilter->SetInput(m_Working_Support);
- sliceRelPosFilter->SetInputObject(CommonCarotidArtery);
- sliceRelPosFilter->SetDirection(2);
- sliceRelPosFilter->SetFuzzyThreshold(GetFuzzyThreshold("2RL", "CommonCarotidArtery"));
- sliceRelPosFilter->AddOrientationTypeString("NotAntTo");
- sliceRelPosFilter->IntermediateSpacingFlagOn();
- sliceRelPosFilter->SetIntermediateSpacing(2);
- sliceRelPosFilter->UniqueConnectedComponentBySliceOff();
- sliceRelPosFilter->UseASingleObjectConnectedComponentBySliceFlagOff();
- sliceRelPosFilter->AutoCropFlagOn();
- sliceRelPosFilter->IgnoreEmptySliceObjectFlagOn();
- sliceRelPosFilter->RemoveObjectFlagOff();
- sliceRelPosFilter->Update();
- m_Working_Support = sliceRelPosFilter->GetOutput();
-
- // End
- StopCurrentStep<MaskImageType>(m_Working_Support);