X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkExtractLymphStation_3P.txx;h=1c9fdc0f81d82ffe0001331f3e13a0ee05cf4a2b;hb=df1fe7da56a47ca087ca20ff5bb3c5b74abaad01;hp=d1be71047093fb38dce38b1c25d571ff878a6230;hpb=a339bdc482ea9752ec53195bc9a47e8b05dba582;p=clitk.git diff --git a/segmentation/clitkExtractLymphStation_3P.txx b/segmentation/clitkExtractLymphStation_3P.txx index d1be710..1c9fdc0 100644 --- a/segmentation/clitkExtractLymphStation_3P.txx +++ b/segmentation/clitkExtractLymphStation_3P.txx @@ -1,7 +1,4 @@ -#include -#include - //-------------------------------------------------------------------- template void @@ -65,23 +62,13 @@ ExtractStation_3P_Remove_Structures() StartNewStep("[Station 3P] Remove some structures."); - MaskImagePointer Aorta = GetAFDB()->template GetImage("Aorta"); - clitk::AndNot(m_Working_Support, Aorta, GetBackgroundValue()); - - MaskImagePointer VertebralBody = GetAFDB()->template GetImage("VertebralBody"); - clitk::AndNot(m_Working_Support, VertebralBody); - - MaskImagePointer SubclavianArtery = GetAFDB()->template GetImage("SubclavianArtery"); - clitk::AndNot(m_Working_Support, SubclavianArtery); - - MaskImagePointer Esophagus = GetAFDB()->template GetImage("Esophagus"); - clitk::AndNot(m_Working_Support, Esophagus); - - MaskImagePointer AzygousVein = GetAFDB()->template GetImage("AzygousVein"); - clitk::AndNot(m_Working_Support, AzygousVein); - - MaskImagePointer Thyroid = GetAFDB()->template GetImage("Thyroid"); - clitk::AndNot(m_Working_Support, Thyroid); + Remove_Structures("3P", "Aorta"); + Remove_Structures("3P", "VertebralBody"); + Remove_Structures("3P", "SubclavianArtery"); + Remove_Structures("3P", "Esophagus"); + Remove_Structures("3P", "Azygousvein"); + Remove_Structures("3P", "Thyroid"); + Remove_Structures("3P", "VertebralArtery"); StopCurrentStep(m_Working_Support); m_ListOfStations["3P"] = m_Working_Support; @@ -430,6 +417,29 @@ ExtractStation_3P_LR_sup_Limits() } //-------------------------------------------------------------------- +//-------------------------------------------------------------------- +template +void +clitk::ExtractLymphStationsFilter:: +ExtractStation_3P_LR_sup_Limits_2() +{ + /* + Use VertebralArtery to limit. + + + StartNewStep("[Station 3P] Left/Right limits with VertebralArtery"); + + // Load structures + MaskImagePointer VertebralArtery = GetAFDB()->template GetImage("VertebralArtery"); + + clitk::AndNot(m_Working_Support, VertebralArtery); + + StopCurrentStep(m_Working_Support); + m_ListOfStations["3P"] = m_Working_Support; + */ +} +//-------------------------------------------------------------------- + //-------------------------------------------------------------------- template void @@ -444,10 +454,11 @@ ExtractStation_3P_LR_inf_Limits() inf : not Right to Azygousvein */ - StartNewStep("[Station 3P] Left/Right limits (inferior part) "); + StartNewStep("[Station 3P] Left/Right limits (inferior part) with Azygousvein and Aorta"); // Load structures MaskImagePointer AzygousVein = GetAFDB()->template GetImage("AzygousVein"); + MaskImagePointer Aorta = GetAFDB()->template GetImage("Aorta"); typedef clitk::AddRelativePositionConstraintToLabelImageFilter RelPosFilterType; typename RelPosFilterType::Pointer relPosFilter = RelPosFilterType::New(); @@ -465,6 +476,19 @@ ExtractStation_3P_LR_inf_Limits() relPosFilter->Update(); m_Working_Support = relPosFilter->GetOutput(); + writeImage(m_Working_Support, "before-L-aorta.mhd"); + relPosFilter->SetInput(m_Working_Support); + relPosFilter->SetInputObject(Aorta); + relPosFilter->AddOrientationTypeString("L"); + relPosFilter->SetInverseOrientationFlag(true); + // relPosFilter->SetIntermediateSpacing(3); + relPosFilter->SetIntermediateSpacingFlag(false); + relPosFilter->SetFuzzyThreshold(0.7); + relPosFilter->AutoCropFlagOn(); + relPosFilter->Update(); + m_Working_Support = relPosFilter->GetOutput(); + writeImage(m_Working_Support, "after-L-aorta.mhd"); + StopCurrentStep(m_Working_Support); m_ListOfStations["3P"] = m_Working_Support; }