From: David Sarrut Date: Tue, 18 Oct 2011 05:54:59 +0000 (+0200) Subject: Merge branch 'master' of /home/dsarrut/clitk3.server X-Git-Tag: v1.3.0~180^2~9 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=f2db63f3bfa350d3267598e5630af09c34edd79e;hp=30cb60d7b9e92db35fd20a9a3f6c793b0e881ec3;p=clitk.git Merge branch 'master' of /home/dsarrut/clitk3.server --- diff --git a/segmentation/clitkExtractLymphStation_1RL.txx b/segmentation/clitkExtractLymphStation_1RL.txx index 7fa72ef..6758ab8 100644 --- a/segmentation/clitkExtractLymphStation_1RL.txx +++ b/segmentation/clitkExtractLymphStation_1RL.txx @@ -44,10 +44,10 @@ ExtractStation_1RL() ExtractStation_1RL_Post_Limits(); m_Working_Support = m_ListOfStations["1R"]; Remove_Structures(" 1R", "ScaleneMuscleAnt"); - Remove_Structures(" 1R", "CommonCarotidArteryRight"); + Remove_Structures(" 1R", "RightCommonCarotidArtery"); m_Working_Support = m_ListOfStations["1L"]; Remove_Structures(" 1L", "ScaleneMuscleAnt"); - Remove_Structures(" 1L", "CommonCarotidArteryLeft"); + Remove_Structures(" 1L", "LeftCommonCarotidArtery"); // Generic RelativePosition processes m_ListOfStations["1R"] = this->ApplyRelativePositionList("Station_1R", m_ListOfStations["1R"]); diff --git a/segmentation/clitkExtractLymphStation_2RL.txx b/segmentation/clitkExtractLymphStation_2RL.txx index e31f2d5..7332dee 100644 --- a/segmentation/clitkExtractLymphStation_2RL.txx +++ b/segmentation/clitkExtractLymphStation_2RL.txx @@ -184,10 +184,10 @@ ExtractStation_2RL_Remove_Structures(std::string s) // m_Working_Support must be set Remove_Structures(s, "BrachioCephalicVein"); Remove_Structures(s, "BrachioCephalicArtery"); - Remove_Structures(s, "CommonCarotidArteryLeft"); - Remove_Structures(s, "CommonCarotidArteryRight"); - Remove_Structures(s, "SubclavianArteryLeft"); - Remove_Structures(s, "SubclavianArteryRight"); + Remove_Structures(s, "LeftCommonCarotidArtery"); + Remove_Structures(s, "RightCommonCarotidArtery"); + Remove_Structures(s, "LeftSubclavianArtery"); + Remove_Structures(s, "RightSubclavianArtery"); Remove_Structures(s, "Thyroid"); Remove_Structures(s, "Aorta"); } diff --git a/segmentation/clitkExtractLymphStation_3A.txx b/segmentation/clitkExtractLymphStation_3A.txx index 26e478b..e973ed0 100644 --- a/segmentation/clitkExtractLymphStation_3A.txx +++ b/segmentation/clitkExtractLymphStation_3A.txx @@ -207,11 +207,11 @@ clitk::ExtractLymphStationsFilter:: ExtractStation_3A_Remove_Structures() { Remove_Structures(" 3A", "Aorta"); - Remove_Structures(" 3A", "SubclavianArteryLeft"); - Remove_Structures(" 3A", "SubclavianArteryRight"); + Remove_Structures(" 3A", "LeftSubclavianArtery"); + Remove_Structures(" 3A", "RightSubclavianArtery"); Remove_Structures(" 3A", "Thyroid"); - Remove_Structures(" 3A", "CommonCarotidArteryLeft"); - Remove_Structures(" 3A", "CommonCarotidArteryRight"); + Remove_Structures(" 3A", "LeftCommonCarotidArtery"); + Remove_Structures(" 3A", "RightCommonCarotidArtery"); Remove_Structures(" 3A", "BrachioCephalicArtery"); // Remove_Structures("3A", "Bones"); --> should be in extractmediastinum // Remove_Structures("3A", "BrachioCephalicVein"); ? diff --git a/segmentation/clitkExtractLymphStation_3P.txx b/segmentation/clitkExtractLymphStation_3P.txx index 7120498..274fc86 100644 --- a/segmentation/clitkExtractLymphStation_3P.txx +++ b/segmentation/clitkExtractLymphStation_3P.txx @@ -26,8 +26,6 @@ ExtractStation_3P() m_ListOfStations["3P"] = m_Working_Support; StopCurrentStep(m_Working_Support); - // ExtractStation_3P_LR_inf_Limits(); // <-- done in RelPosList - // Generic RelativePosition processes m_ListOfStations["3P"] = this->ApplyRelativePositionList("Station_3P", m_ListOfStations["3P"]); m_Working_Support = m_ListOfStations["3P"]; @@ -39,6 +37,7 @@ ExtractStation_3P() // LR limits superiorly => not here for the moment because not clear in the def // ExtractStation_3P_LR_sup_Limits_2(); //TODO // ExtractStation_3P_LR_sup_Limits(); // old version to change + // ExtractStation_3P_LR_inf_Limits(); // <-- done in RelPosList // Store image filenames into AFDB writeImage(m_ListOfStations["3P"], "seg/Station3P.mhd"); @@ -94,8 +93,8 @@ ExtractStation_3P_LR_sup_Limits() Trachea = clitk::ResizeImageLike(Trachea, m_Working_Support, GetBackgroundValue()); SubclavianArtery = clitk::ResizeImageLike(SubclavianArtery, m_Working_Support, GetBackgroundValue()); - writeImage(Trachea, "tr.mhd"); - writeImage(SubclavianArtery, "sca.mhd"); + // writeImage(Trachea, "tr.mhd"); + // writeImage(SubclavianArtery, "sca.mhd"); // Get list of slices std::vector slices_support; diff --git a/segmentation/clitkExtractLymphStation_Supports.txx b/segmentation/clitkExtractLymphStation_Supports.txx index 1fb82f8..2cde97d 100644 --- a/segmentation/clitkExtractLymphStation_Supports.txx +++ b/segmentation/clitkExtractLymphStation_Supports.txx @@ -21,10 +21,10 @@ ExtractStationSupports() m_CarinaZ, true, GetBackgroundValue()); m_ListOfSupports["Support_Superior_to_Carina"] = m_Support_Superior_to_Carina; m_ListOfSupports["Support_Inferior_to_Carina"] = m_Support_Inferior_to_Carina; - writeImage(m_Support_Inferior_to_Carina, "seg/Support_Inf_Carina.mhd"); - this->GetAFDB()->SetImageFilename("Support_Inf_Carina", "seg/Support_Inf_Carina.mhd"); - writeImage(m_Support_Superior_to_Carina, "seg/Support_Sup_Carina.mhd"); - this->GetAFDB()->SetImageFilename("Support_Sup_Carina", "seg/Support_Sup_Carina.mhd"); + writeImage(m_Support_Inferior_to_Carina, "seg/Support_Inf_Carina.mha"); + this->GetAFDB()->SetImageFilename("Support_Inf_Carina", "seg/Support_Inf_Carina.mha"); + writeImage(m_Support_Superior_to_Carina, "seg/Support_Sup_Carina.mha"); + this->GetAFDB()->SetImageFilename("Support_Sup_Carina", "seg/Support_Sup_Carina.mha"); // S1RL Support_SupInf_S1RL(); @@ -57,45 +57,45 @@ ExtractStationSupports() m_ListOfSupports["S11"] = clitk::Clone(m_Support_Inferior_to_Carina); // Store image filenames into AFDB - writeImage(m_ListOfSupports["S1R"], "seg/Support_S1R.mhd"); - this->GetAFDB()->SetImageFilename("Support_S1R", "seg/Support_S1R.mhd"); - writeImage(m_ListOfSupports["S1L"], "seg/Support_S1L.mhd"); - this->GetAFDB()->SetImageFilename("Support_S1L", "seg/Support_S1L.mhd"); + writeImage(m_ListOfSupports["S1R"], "seg/Support_S1R.mha"); + this->GetAFDB()->SetImageFilename("Support_S1R", "seg/Support_S1R.mha"); + writeImage(m_ListOfSupports["S1L"], "seg/Support_S1L.mha"); + this->GetAFDB()->SetImageFilename("Support_S1L", "seg/Support_S1L.mha"); - writeImage(m_ListOfSupports["S2L"], "seg/Support_S2L.mhd"); - this->GetAFDB()->SetImageFilename("Support_S2L", "seg/Support_S2L.mhd"); - writeImage(m_ListOfSupports["S2R"], "seg/Support_S2R.mhd"); - this->GetAFDB()->SetImageFilename("Support_S2R", "seg/Support_S2R.mhd"); + writeImage(m_ListOfSupports["S2L"], "seg/Support_S2L.mha"); + this->GetAFDB()->SetImageFilename("Support_S2L", "seg/Support_S2L.mha"); + writeImage(m_ListOfSupports["S2R"], "seg/Support_S2R.mha"); + this->GetAFDB()->SetImageFilename("Support_S2R", "seg/Support_S2R.mha"); - writeImage(m_ListOfSupports["S3P"], "seg/Support_S3P.mhd"); - this->GetAFDB()->SetImageFilename("Support_S3P", "seg/Support_S3P.mhd"); - writeImage(m_ListOfSupports["S3A"], "seg/Support_S3A.mhd"); - this->GetAFDB()->SetImageFilename("Support_S3A", "seg/Support_S3A.mhd"); + writeImage(m_ListOfSupports["S3P"], "seg/Support_S3P.mha"); + this->GetAFDB()->SetImageFilename("Support_S3P", "seg/Support_S3P.mha"); + writeImage(m_ListOfSupports["S3A"], "seg/Support_S3A.mha"); + this->GetAFDB()->SetImageFilename("Support_S3A", "seg/Support_S3A.mha"); - writeImage(m_ListOfSupports["S4L"], "seg/Support_S4L.mhd"); - this->GetAFDB()->SetImageFilename("Support_S4L", "seg/Support_S4L.mhd"); - writeImage(m_ListOfSupports["S4R"], "seg/Support_S4R.mhd"); - this->GetAFDB()->SetImageFilename("Support_S4R", "seg/Support_S4R.mhd"); + writeImage(m_ListOfSupports["S4L"], "seg/Support_S4L.mha"); + this->GetAFDB()->SetImageFilename("Support_S4L", "seg/Support_S4L.mha"); + writeImage(m_ListOfSupports["S4R"], "seg/Support_S4R.mha"); + this->GetAFDB()->SetImageFilename("Support_S4R", "seg/Support_S4R.mha"); - writeImage(m_ListOfSupports["S5"], "seg/Support_S5.mhd"); - this->GetAFDB()->SetImageFilename("Support_S5", "seg/Support_S5.mhd"); - writeImage(m_ListOfSupports["S6"], "seg/Support_S6.mhd"); - this->GetAFDB()->SetImageFilename("Support_S6", "seg/Support_S6.mhd"); + writeImage(m_ListOfSupports["S5"], "seg/Support_S5.mha"); + this->GetAFDB()->SetImageFilename("Support_S5", "seg/Support_S5.mha"); + writeImage(m_ListOfSupports["S6"], "seg/Support_S6.mha"); + this->GetAFDB()->SetImageFilename("Support_S6", "seg/Support_S6.mha"); - writeImage(m_ListOfSupports["S7"], "seg/Support_S7.mhd"); - this->GetAFDB()->SetImageFilename("Support_S7", "seg/Support_S7.mhd"); + writeImage(m_ListOfSupports["S7"], "seg/Support_S7.mha"); + this->GetAFDB()->SetImageFilename("Support_S7", "seg/Support_S7.mha"); - writeImage(m_ListOfSupports["S8"], "seg/Support_S8.mhd"); - this->GetAFDB()->SetImageFilename("Support_S8", "seg/Support_S8.mhd"); + writeImage(m_ListOfSupports["S8"], "seg/Support_S8.mha"); + this->GetAFDB()->SetImageFilename("Support_S8", "seg/Support_S8.mha"); - writeImage(m_ListOfSupports["S9"], "seg/Support_S9.mhd"); - this->GetAFDB()->SetImageFilename("Support_S9", "seg/Support_S9.mhd"); + writeImage(m_ListOfSupports["S9"], "seg/Support_S9.mha"); + this->GetAFDB()->SetImageFilename("Support_S9", "seg/Support_S9.mha"); - writeImage(m_ListOfSupports["S10"], "seg/Support_S10.mhd"); - this->GetAFDB()->SetImageFilename("Support_S10", "seg/Support_S10.mhd"); + writeImage(m_ListOfSupports["S10"], "seg/Support_S10.mha"); + this->GetAFDB()->SetImageFilename("Support_S10", "seg/Support_S10.mha"); - writeImage(m_ListOfSupports["S11"], "seg/Support_S11.mhd"); - this->GetAFDB()->SetImageFilename("Support_S11", "seg/Support_S11.mhd"); + writeImage(m_ListOfSupports["S11"], "seg/Support_S11.mha"); + this->GetAFDB()->SetImageFilename("Support_S11", "seg/Support_S11.mha"); WriteAFDB(); } //-------------------------------------------------------------------- @@ -544,7 +544,7 @@ void clitk::ExtractLymphStationsFilter:: Support_S5() { - StartNewStep("[Support] Sup-Inf limits S5 with aorta"); + StartNewStep("[Support] Sup-Inf limits S5 with Aorta and MainPulmonaryArtery"); // Initial S5 support MaskImagePointer S5 = @@ -555,11 +555,11 @@ Support_S5() // Inf limits with "upper rim of the left main pulmonary artery" // For the moment only, it will change. - MaskImagePointer PulmonaryTrunk = this->GetAFDB()->template GetImage("PulmonaryTrunk"); + MaskImagePointer MainPulmonaryArtery = this->GetAFDB()->template GetImage("MainPulmonaryArtery"); MaskImagePointType p; p[0] = p[1] = p[2] = 0.0; // to avoid warning - clitk::FindExtremaPointInAGivenDirection(PulmonaryTrunk, GetBackgroundValue(), 2, false, p); - p[2] += PulmonaryTrunk->GetSpacing()[2]; + clitk::FindExtremaPointInAGivenDirection(MainPulmonaryArtery, GetBackgroundValue(), 2, false, p); + p[2] += MainPulmonaryArtery->GetSpacing()[2]; // Cut Sup/Inf S5 = clitk::CropImageAlongOneAxis(S5, 2, p[2], sup, true, GetBackgroundValue()); diff --git a/segmentation/clitkExtractLymphStationsFilter.txx b/segmentation/clitkExtractLymphStationsFilter.txx index 9051ec1..ec93c09 100644 --- a/segmentation/clitkExtractLymphStationsFilter.txx +++ b/segmentation/clitkExtractLymphStationsFilter.txx @@ -126,10 +126,10 @@ GenerateOutputInformation() { } // Extract Stations + ExtractStation_1RL(); + ExtractStation_2RL(); ExtractStation_3P(); ExtractStation_3A(); - ExtractStation_2RL(); - ExtractStation_1RL(); ExtractStation_4RL(); ExtractStation_5(); ExtractStation_6(); @@ -137,13 +137,13 @@ GenerateOutputInformation() { // ---------- TODO ----------------------- // Extract Station8 - ExtractStation_8(); + // ExtractStation_8(); // Extract Station7 - this->StartNewStep("Station 7"); - this->StartSubStep(); - ExtractStation_7(); - this->StopSubStep(); + //this->StartNewStep("Station 7"); + //this->StartSubStep(); + //ExtractStation_7(); + //this->StopSubStep(); } //-------------------------------------------------------------------- @@ -988,8 +988,8 @@ FindAntPostVesselsOLD() binarizedContour = clitk::CropImageAlongOneAxis(binarizedContour, 2, inf, sup, false, GetBackgroundValue()); // Update the AFDB - writeImage(binarizedContour, "seg/AntPostVesselsSeparation.mhd"); - this->GetAFDB()->SetImageFilename("AntPostVesselsSeparation", "seg/AntPostVesselsSeparation.mhd"); + writeImage(binarizedContour, "seg/AntPostVesselsSeparation.mha"); + this->GetAFDB()->SetImageFilename("AntPostVesselsSeparation", "seg/AntPostVesselsSeparation.mha"); this->WriteAFDB(); return binarizedContour; @@ -1076,10 +1076,10 @@ FindAntPostVessels2() typedef std::map::iterator MapIter; MapOfStructures["BrachioCephalicArtery"] = this->GetAFDB()->template GetImage("BrachioCephalicArtery"); MapOfStructures["BrachioCephalicVein"] = this->GetAFDB()->template GetImage("BrachioCephalicVein"); - MapOfStructures["CommonCarotidArteryLeft"] = this->GetAFDB()->template GetImage("CommonCarotidArteryLeft"); - MapOfStructures["CommonCarotidArteryRight"] = this->GetAFDB()->template GetImage("CommonCarotidArteryRight"); - MapOfStructures["SubclavianArteryLeft"] = this->GetAFDB()->template GetImage("SubclavianArteryLeft"); - MapOfStructures["SubclavianArteryRight"] = this->GetAFDB()->template GetImage("SubclavianArteryRight"); + MapOfStructures["CommonCarotidArteryLeft"] = this->GetAFDB()->template GetImage("LeftCommonCarotidArtery"); + MapOfStructures["CommonCarotidArteryRight"] = this->GetAFDB()->template GetImage("RightCommonCarotidArtery"); + MapOfStructures["SubclavianArteryLeft"] = this->GetAFDB()->template GetImage("LeftSubclavianArtery"); + MapOfStructures["SubclavianArteryRight"] = this->GetAFDB()->template GetImage("RightSubclavianArtery"); MapOfStructures["Thyroid"] = this->GetAFDB()->template GetImage("Thyroid"); MapOfStructures["Aorta"] = this->GetAFDB()->template GetImage("Aorta"); MapOfStructures["Trachea"] = this->GetAFDB()->template GetImage("Trachea"); @@ -1347,8 +1347,8 @@ FindAntPostVessels2() false, GetBackgroundValue()); // Update the AFDB - writeImage(binarizedContour, "seg/AntPostVesselsSeparation.mhd"); - this->GetAFDB()->SetImageFilename("AntPostVesselsSeparation", "seg/AntPostVesselsSeparation.mhd"); + writeImage(binarizedContour, "seg/AntPostVesselsSeparation.mha"); + this->GetAFDB()->SetImageFilename("AntPostVesselsSeparation", "seg/AntPostVesselsSeparation.mha"); this->WriteAFDB(); return binarizedContour; diff --git a/segmentation/clitkExtractMediastinalVesselsFilter.txx b/segmentation/clitkExtractMediastinalVesselsFilter.txx index 29709f4..1781948 100644 --- a/segmentation/clitkExtractMediastinalVesselsFilter.txx +++ b/segmentation/clitkExtractMediastinalVesselsFilter.txx @@ -213,7 +213,7 @@ GenerateOutputInformation() { // Build the final 3D image from the previous slice by slice processing m_SoughtVessel = clitk::JoinSlices(m_slice_recon, m_Mask, 2); - writeImage(m_SoughtVessel, "recon2.mhd"); + // writeImage(m_SoughtVessel, "recon2.mhd"); // Set binary image, (remove other labels). m_SoughtVessel = @@ -600,7 +600,7 @@ TrackVesselsFromPoint(MaskImagePointer & recon, do { // Debug - std::cout << std::endl; + //std::cout << std::endl; //DD(currentSlice); ImagePointType c; clitk::PointsUtils::Convert2DTo3D(previousCentroid, m_Mask, currentSlice-1, c); diff --git a/segmentation/clitkExtractMediastinumFilter.txx b/segmentation/clitkExtractMediastinumFilter.txx index 312fd14..b3e17bf 100644 --- a/segmentation/clitkExtractMediastinumFilter.txx +++ b/segmentation/clitkExtractMediastinumFilter.txx @@ -54,7 +54,7 @@ ExtractMediastinumFilter(): SetForegroundValueLeftLung(1); SetForegroundValueRightLung(2); SetDistanceMaxToAnteriorPartOfTheVertebralBody(10); - SetOutputMediastinumFilename("mediastinum.mhd"); + SetOutputMediastinumFilename("mediastinum.mha"); UseBonesOff(); } //-------------------------------------------------------------------- @@ -250,9 +250,9 @@ GenerateOutputInformation() { left_lung = clitk::SetBackground(left_lung, left_lung, 2, 1, false); right_lung = clitk::ResizeImageLike(right_lung, output, this->GetBackgroundValue()); left_lung = clitk::ResizeImageLike(left_lung, output, this->GetBackgroundValue()); - this->GetAFDB()->template SetImage("RightLung", "seg/RightLung.mhd", + this->GetAFDB()->template SetImage("RightLung", "seg/RightLung.mha", right_lung, true); - this->GetAFDB()->template SetImage("LeftLung", "seg/LeftLung.mhd", + this->GetAFDB()->template SetImage("LeftLung", "seg/LeftLung.mha", left_lung, true); this->GetAFDB()->Write(); this->template StopCurrentStep(output); @@ -319,12 +319,12 @@ GenerateOutputInformation() { bones_post = roiFilter->GetOutput(); // writeImage(bones_post, "b_post.mhd"); - // Now, insert this image in the AFDB - this->GetAFDB()->template SetImage("Bones_Post", "seg/Bones_Post.mhd", + // Now, insert this image in the AFDB ==> (needed because used in the RelativePosition config file) + this->GetAFDB()->template SetImage("Bones_Post", "seg/Bones_Post.mha", bones_post, true); - this->GetAFDB()->template SetImage("Bones_Ant", "seg/Bones_Ant.mhd", + this->GetAFDB()->template SetImage("Bones_Ant", "seg/Bones_Ant.mha", bones_ant, true); - this->GetAFDB()->Write(); + this->GetAFDB()->Write(); this->template StopCurrentStep(output); } diff --git a/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx b/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx index 6e3e594..bec6b9e 100644 --- a/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx +++ b/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx @@ -45,7 +45,7 @@ void clitk::FilterWithAnatomicalFeatureDatabaseManagement::LoadAFDB() try { GetAFDB()->Load(); } catch (clitk::ExceptionObject e) { - std::cout << "Could not read '" << GetAFDBFilename() << "', create one AFDB." << std::endl; + std::cout << "******* Could not read '" << GetAFDBFilename() << "', create one AFDB. ********" << std::endl; GetAFDB(); } }