X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkExtractLymphStationsGenericFilter.txx;h=9dfa850f67eb7e20683f6f38521b78ef2e5231d9;hb=dad240d633996ba10087d96ece317415086f5a59;hp=2644c1fc99153a50c7694150e8c91dabcc39de35;hpb=e008d74b0ecdc4ca2eaae8c429901a78f9ef5c31;p=clitk.git diff --git a/segmentation/clitkExtractLymphStationsGenericFilter.txx b/segmentation/clitkExtractLymphStationsGenericFilter.txx index 2644c1f..9dfa850 100644 --- a/segmentation/clitkExtractLymphStationsGenericFilter.txx +++ b/segmentation/clitkExtractLymphStationsGenericFilter.txx @@ -28,7 +28,7 @@ clitk::ExtractLymphStationsGenericFilter::ExtractLymphStationsGene { // Default values cmdline_parser_clitkExtractLymphStations_init(&mArgsInfo); - InitializeImageType<3>(); + InitializeImageType<3>(); // Only for 3D images } //-------------------------------------------------------------------- @@ -38,10 +38,7 @@ template template void clitk::ExtractLymphStationsGenericFilter::InitializeImageType() { - ADD_IMAGE_TYPE(Dim, uchar); - // ADD_IMAGE_TYPE(Dim, short); - // ADD_IMAGE_TYPE(Dim, int); - // ADD_IMAGE_TYPE(Dim, float); + ADD_IMAGE_TYPE(Dim, short); // Can add float later } //-------------------------------------------------------------------- @@ -53,9 +50,23 @@ void clitk::ExtractLymphStationsGenericFilter::SetArgsInfo(const A mArgsInfo=a; SetIOVerbose(mArgsInfo.verbose_flag); if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes(); - if (mArgsInfo.mediastinum_given) AddInputFilename(mArgsInfo.mediastinum_arg); - if (mArgsInfo.trachea_given) AddInputFilename(mArgsInfo.trachea_arg); - if (mArgsInfo.output_given) AddOutputFilename(mArgsInfo.output_arg); + if (mArgsInfo.input_given) AddInputFilename(mArgsInfo.input_arg); + if (mArgsInfo.output_given) AddOutputFilename(mArgsInfo.output_arg); +} +//-------------------------------------------------------------------- + + +//-------------------------------------------------------------------- +template +template +void +clitk::ExtractLymphStationsGenericFilter:: +SetOptionsFromArgsInfoToFilter(FilterType * f) +{ + f->SetVerboseOption(mArgsInfo.verbose_flag); + f->SetVerboseStep(mArgsInfo.verboseStep_flag); + f->SetWriteStep(mArgsInfo.writeStep_flag); + f->SetAFDBFilename(mArgsInfo.afdb_arg); } //-------------------------------------------------------------------- @@ -68,31 +79,24 @@ template void clitk::ExtractLymphStationsGenericFilter::UpdateWithInputImageType() { // Reading input - typename ImageType::Pointer mediastinum = this->template GetInput(0); - typename ImageType::Pointer trachea = this->template GetInput(1); + typename ImageType::Pointer input = this->template GetInput(0); // Create filter typedef clitk::ExtractLymphStationsFilter FilterType; typename FilterType::Pointer filter = FilterType::New(); // Set global Options - filter->SetInputMediastinumLabelImage(mediastinum, 0); // change 0 with BG - filter->SetInputTracheaLabelImage(trachea, 0); // change 0 with BG - filter->SetArgsInfo(mArgsInfo); + filter->SetInput(input); + SetOptionsFromArgsInfoToFilter(filter); // Go ! filter->Update(); - - // Check if error - if (filter->HasError()) { - SetLastError(filter->GetLastError()); - // No output - return; - } // Write/Save results - typename ImageType::Pointer output = filter->GetOutput(); - this->template SetNextOutput(output); + typedef uchar MaskImagePixelType; + typedef itk::Image OutputImageType; + typename OutputImageType::Pointer output = filter->GetOutput(); + this->template SetNextOutput(output); } //--------------------------------------------------------------------