X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkExtractLymphStation_2RL.txx;h=71298eb5397dfa605888f7b7b7a578757bfeae2c;hb=2db65b693062a7d5bb04df546be45f9b9513997f;hp=542540fb9511ef4ba338ed83e6abb352a317c031;hpb=aced463099d763ade982dfc8425b23ecd6784ccd;p=clitk.git diff --git a/segmentation/clitkExtractLymphStation_2RL.txx b/segmentation/clitkExtractLymphStation_2RL.txx index 542540f..71298eb 100644 --- a/segmentation/clitkExtractLymphStation_2RL.txx +++ b/segmentation/clitkExtractLymphStation_2RL.txx @@ -35,7 +35,7 @@ void HypercubeCorners(std::vector > & out) { std::vector > previous; HypercubeCorners(previous); out.resize(previous.size()*2); - for(uint i=0; i p; if (i & bounds) { // Get image max/min coordinates - const uint dim=ImageType::ImageDimension; + const unsigned int dim=ImageType::ImageDimension; typedef typename ImageType::PointType PointType; typedef typename ImageType::IndexType IndexType; PointType min_c, max_c; IndexType min_i, max_i; min_i = image->GetLargestPossibleRegion().GetIndex(); - for(uint i=0; iGetLargestPossibleRegion().GetSize()[i] + min_i[i]; + for(unsigned int i=0; iGetLargestPossibleRegion().GetSize()[i] + min_i[i]; image->TransformIndexToPhysicalPoint(min_i, min_c); image->TransformIndexToPhysicalPoint(max_i, max_c); // Get corners coordinates HypercubeCorners(bounds); - for(uint i=0; i:: ExtractStation_2RL_SetDefaultValues() { SetFuzzyThreshold("2RL", "CommonCarotidArtery", 0.7); - SetFuzzyThreshold("2RL", "BrachioCephalicTrunk", 0.7); + SetFuzzyThreshold("2RL", "BrachioCephalicArtery", 0.7); SetFuzzyThreshold("2RL", "BrachioCephalicVein", 0.3); SetFuzzyThreshold("2RL", "Aorta", 0.7); SetFuzzyThreshold("2RL", "SubclavianArteryRight", 0.5); @@ -208,17 +209,17 @@ ExtractStation_2RL_Ant_Limits() // ----------------------------------------------------- // Remove Ant to H line from the Ant most part of the // CommonCarotidArtery until we reach the first slice of - // BrachioCephalicTrunk + // BrachioCephalicArtery StartNewStep("[Station 2RL] Ant limits with CommonCarotidArtery, H line"); - // First, find the first slice of BrachioCephalicTrunk - MaskImagePointer BrachioCephalicTrunk = GetAFDB()->template GetImage("BrachioCephalicTrunk"); - MaskImagePointType p = BrachioCephalicTrunk->GetOrigin(); // initialise to avoid warning - clitk::FindExtremaPointInAGivenDirection(BrachioCephalicTrunk, GetBackgroundValue(), 2, false, p); - double TopOfBrachioCephalicTrunkZ=p[2] + BrachioCephalicTrunk->GetSpacing()[2]; // Add one slice + // First, find the first slice of BrachioCephalicArtery + MaskImagePointer BrachioCephalicArtery = GetAFDB()->template GetImage("BrachioCephalicArtery"); + MaskImagePointType p = BrachioCephalicArtery->GetOrigin(); // initialise to avoid warning + clitk::FindExtremaPointInAGivenDirection(BrachioCephalicArtery, GetBackgroundValue(), 2, false, p); + double TopOfBrachioCephalicArteryZ=p[2] + BrachioCephalicArtery->GetSpacing()[2]; // Add one slice // Remove CommonCarotidArtery below this point - CommonCarotidArtery = clitk::CropImageRemoveLowerThan(CommonCarotidArtery, 2, TopOfBrachioCephalicTrunkZ, true, GetBackgroundValue()); + CommonCarotidArtery = clitk::CropImageRemoveLowerThan(CommonCarotidArtery, 2, TopOfBrachioCephalicArteryZ, true, GetBackgroundValue()); // Find most Ant points std::vector ccaAntPositionA; @@ -242,26 +243,26 @@ ExtractStation_2RL_Ant_Limits() m_ListOfStations["2L"] = m_Working_Support; // ----------------------------------------------------- - // Ant limit with the BrachioCephalicTrunk - StartNewStep("[Station 2RL] Ant limits with BrachioCephalicTrunk line"); + // Ant limit with the BrachioCephalicArtery + StartNewStep("[Station 2RL] Ant limits with BrachioCephalicArtery line"); - // Remove Ant to BrachioCephalicTrunk + // Remove Ant to BrachioCephalicArtery m_Working_Support = - clitk::SliceBySliceRelativePosition(m_Working_Support, BrachioCephalicTrunk, 2, - GetFuzzyThreshold("2RL", "BrachioCephalicTrunk"), "NotAntTo", false, 2, true, false); + clitk::SliceBySliceRelativePosition(m_Working_Support, BrachioCephalicArtery, 2, + GetFuzzyThreshold("2RL", "BrachioCephalicArtery"), "NotAntTo", false, 2, true, false); // End StopCurrentStep(m_Working_Support); m_ListOfStations["2R"] = m_Working_Support; m_ListOfStations["2L"] = m_Working_Support; // ----------------------------------------------------- - // Ant limit with the BrachioCephalicTrunk H line - StartNewStep("[Station 2RL] Ant limits with BrachioCephalicTrunk, Horizontal line"); + // Ant limit with the BrachioCephalicArtery H line + StartNewStep("[Station 2RL] Ant limits with BrachioCephalicArtery, Horizontal line"); // Find most Ant points std::vector bctAntPositionA; std::vector bctAntPositionB; - clitk::SliceBySliceBuildLineSegmentAccordingToExtremaPosition(BrachioCephalicTrunk, + clitk::SliceBySliceBuildLineSegmentAccordingToExtremaPosition(BrachioCephalicArtery, GetBackgroundValue(), 2, 1, true, // Ant 0, // Horizontal line @@ -317,7 +318,7 @@ ExtractStation_2RL_Ant_Limits2() /* Here, we consider the vessels form a kind of anterior barrier. We link all vessels centroids and remove what is post to it. - select the list of structure - vessel1 = BrachioCephalicTrunk + vessel1 = BrachioCephalicArtery vessel2 = BrachioCephalicVein (warning several CCL, keep most at Right) vessel3 = CommonCarotidArtery vessel4 = SubclavianArtery @@ -332,7 +333,7 @@ ExtractStation_2RL_Ant_Limits2() */ // Read structures - MaskImagePointer BrachioCephalicTrunk = GetAFDB()->template GetImage("BrachioCephalicTrunk"); + MaskImagePointer BrachioCephalicArtery = GetAFDB()->template GetImage("BrachioCephalicArtery"); MaskImagePointer BrachioCephalicVein = GetAFDB()->template GetImage("BrachioCephalicVein"); MaskImagePointer CommonCarotidArtery = GetAFDB()->template GetImage("CommonCarotidArtery"); MaskImagePointer SubclavianArtery = GetAFDB()->template GetImage("SubclavianArtery"); @@ -341,8 +342,8 @@ ExtractStation_2RL_Ant_Limits2() MaskImagePointer Trachea = GetAFDB()->template GetImage("Trachea"); // Resize all structures like support - BrachioCephalicTrunk = - clitk::ResizeImageLike(BrachioCephalicTrunk, m_Working_Support, GetBackgroundValue()); + BrachioCephalicArtery = + clitk::ResizeImageLike(BrachioCephalicArtery, m_Working_Support, GetBackgroundValue()); CommonCarotidArtery = clitk::ResizeImageLike(CommonCarotidArtery, m_Working_Support, GetBackgroundValue()); SubclavianArtery = @@ -357,8 +358,8 @@ ExtractStation_2RL_Ant_Limits2() clitk::ResizeImageLike(Trachea, m_Working_Support, GetBackgroundValue()); // Extract slices - std::vector slices_BrachioCephalicTrunk; - clitk::ExtractSlices(BrachioCephalicTrunk, 2, slices_BrachioCephalicTrunk); + std::vector slices_BrachioCephalicArtery; + clitk::ExtractSlices(BrachioCephalicArtery, 2, slices_BrachioCephalicArtery); std::vector slices_BrachioCephalicVein; clitk::ExtractSlices(BrachioCephalicVein, 2, slices_BrachioCephalicVein); std::vector slices_CommonCarotidArtery; @@ -371,24 +372,24 @@ ExtractStation_2RL_Ant_Limits2() clitk::ExtractSlices(Aorta, 2, slices_Aorta); std::vector slices_Trachea; clitk::ExtractSlices(Trachea, 2, slices_Trachea); - uint n= slices_BrachioCephalicTrunk.size(); + unsigned int n= slices_BrachioCephalicArtery.size(); // Get the boundaries of one slice std::vector bounds; - ComputeImageBoundariesCoordinates(slices_BrachioCephalicTrunk[0], bounds); + ComputeImageBoundariesCoordinates(slices_BrachioCephalicArtery[0], bounds); // For all slices, for all structures, find the centroid and build the contour // List of 3D points (for debug) std::vector p3D; vtkSmartPointer append = vtkSmartPointer::New(); - for(uint i=0; i(slices_CommonCarotidArtery[i], GetBackgroundValue(), true, 1); slices_SubclavianArtery[i] = Labelize(slices_SubclavianArtery[i], GetBackgroundValue(), true, 1); - slices_BrachioCephalicTrunk[i] = Labelize(slices_BrachioCephalicTrunk[i], + slices_BrachioCephalicArtery[i] = Labelize(slices_BrachioCephalicArtery[i], GetBackgroundValue(), true, 1); slices_BrachioCephalicVein[i] = Labelize(slices_BrachioCephalicVein[i], GetBackgroundValue(), true, 1); @@ -407,7 +408,7 @@ ExtractStation_2RL_Ant_Limits2() std::vector centroids6; ComputeCentroids(slices_CommonCarotidArtery[i], GetBackgroundValue(), centroids1); ComputeCentroids(slices_SubclavianArtery[i], GetBackgroundValue(), centroids2); - ComputeCentroids(slices_BrachioCephalicTrunk[i], GetBackgroundValue(), centroids3); + ComputeCentroids(slices_BrachioCephalicArtery[i], GetBackgroundValue(), centroids3); ComputeCentroids(slices_Thyroid[i], GetBackgroundValue(), centroids4); ComputeCentroids(slices_Aorta[i], GetBackgroundValue(), centroids5); ComputeCentroids(slices_BrachioCephalicVein[i], GetBackgroundValue(), centroids6); @@ -420,17 +421,17 @@ ExtractStation_2RL_Ant_Limits2() } // BrachioCephalicVein -> when SubclavianArtery has 2 CCL - // (BrachioCephalicTrunk is divided) -> forget BrachioCephalicVein + // (BrachioCephalicArtery is divided) -> forget BrachioCephalicVein if ((centroids3.size() ==1) && (centroids2.size() > 2)) { centroids6.clear(); } - for(uint j=1; j(slices_Trachea[i], GetBackgroundValue(), centroids_trachea); typedef std::pair PointAngleType; std::vector angles; - for(uint j=0; j()); - for(uint j=0; j toadd; - uint index = 0; + unsigned int index = 0; double dmax = 5; while (index points3D; clitk::PointsUtils::Convert2DListTo3DList(points2D, i, m_Working_Support, points3D); - for(uint x=0; x mesh = Build3DMeshFrom2DContour(points3D);