Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/stnava/ANTs
Browse files Browse the repository at this point in the history
  • Loading branch information
ntustison committed Nov 3, 2015
2 parents 826b087 + df095dd commit a5e1e41
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 172 deletions.
2 changes: 1 addition & 1 deletion ANTS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ endif()

option( ${PROJECT_NAME}_BUILD_DISTRIBUTE "Remove '-g#####' from version. ( for official distribution only )" OFF )
mark_as_advanced( ${PROJECT_NAME}_BUILD_DISTRIBUTE )
if( NOT ${PROJECT_NAME}_BUILD_DISTRIBUTE )
if( NOT ${PROJECT_NAME}_BUILD_DISTRIBUTE AND NOT ${PROJECT_NAME}_VERSION_HASH STREQUAL "GITDIR-NOTFOUND")
set(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION}-g${${PROJECT_NAME}_VERSION_HASH}")
endif()

Expand Down
4 changes: 1 addition & 3 deletions CMake/ProjectSourceVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFVAR _GIT_VERSION_HASH)

# if there is not git directory we should be in a distributed package
# which should contain this additional cmake file with the
# _GIT_VERSION variables
# we will use version provided in Version.cmake
if(_GIT_VERSION_HASH STREQUAL "GITDIR-NOTFOUND")
include( "${CMAKE_CURRENT_SOURCE_DIR}/CMake/ProjectSourceVersionVars.cmake" )
return()
endif()

Expand Down
64 changes: 33 additions & 31 deletions Examples/antsJointFusion.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ int antsJointFusion( itk::ants::CommandLineParser *parser )
typename FusionFilterType::Pointer fusionFilter = FusionFilterType::New();
typedef typename LabelImageType::PixelType LabelType;


// Get the alpha and beta parameters

RealType alpha = 0.1;
Expand All @@ -137,45 +136,48 @@ int antsJointFusion( itk::ants::CommandLineParser *parser )
// Get the search and patch radii
typename OptionType::Pointer searchRadiusOption = parser->GetOption( "search-radius" );

// try reading the search radius as an image first.
try
{
std::string searchRadiusString = searchRadiusOption->GetFunction( 0 )->GetName();
typedef typename FusionFilterType::RadiusImageType RadiusImageType;
typename RadiusImageType::Pointer searchRadiusImage;
ReadImage<RadiusImageType>( searchRadiusImage, searchRadiusString.c_str() );

fusionFilter->SetSearchNeighborhoodRadiusImage( searchRadiusImage );
}
catch( ... )
if( searchRadiusOption && searchRadiusOption->GetNumberOfFunctions() )
{
std::vector<unsigned int> searchRadius;
searchRadius.push_back( 3 );
if( searchRadiusOption && searchRadiusOption->GetNumberOfFunctions() )
// try reading the search radius as an image first.
try
{
searchRadius = parser->ConvertVector<unsigned int>( searchRadiusOption->GetFunction( 0 )->GetName() );
std::string searchRadiusString = searchRadiusOption->GetFunction( 0 )->GetName();
typedef typename FusionFilterType::RadiusImageType RadiusImageType;
typename RadiusImageType::Pointer searchRadiusImage;
ReadImage<RadiusImageType>( searchRadiusImage, searchRadiusString.c_str() );

fusionFilter->SetSearchNeighborhoodRadiusImage( searchRadiusImage );
}
if( searchRadius.size() == 1 )
catch( ... )
{
for( unsigned int d = 1; d < ImageDimension; d++ )
std::vector<unsigned int> searchRadius;
searchRadius.push_back( 3 );
if( searchRadiusOption && searchRadiusOption->GetNumberOfFunctions() )
{
searchRadius.push_back( searchRadius[0] );
searchRadius = parser->ConvertVector<unsigned int>( searchRadiusOption->GetFunction( 0 )->GetName() );
}
}
if( searchRadius.size() != ImageDimension )
{
if( verbose )
if( searchRadius.size() == 1 )
{
std::cerr << "Search radius specified incorrectly. Please see usage options." << std::endl;
for( unsigned int d = 1; d < ImageDimension; d++ )
{
searchRadius.push_back( searchRadius[0] );
}
}
return EXIT_FAILURE;
}
typename FusionFilterType::NeighborhoodRadiusType searchNeighborhoodRadius;
for( unsigned int d = 0; d < ImageDimension; d++ )
{
searchNeighborhoodRadius[d] = searchRadius[d];
if( searchRadius.size() != ImageDimension )
{
if( verbose )
{
std::cerr << "Search radius specified incorrectly. Please see usage options." << std::endl;
}
return EXIT_FAILURE;
}
typename FusionFilterType::NeighborhoodRadiusType searchNeighborhoodRadius;
for( unsigned int d = 0; d < ImageDimension; d++ )
{
searchNeighborhoodRadius[d] = searchRadius[d];
}
fusionFilter->SetSearchNeighborhoodRadius( searchNeighborhoodRadius );
}
fusionFilter->SetSearchNeighborhoodRadius( searchNeighborhoodRadius );
}

std::vector<unsigned int> patchRadius;
Expand Down
6 changes: 3 additions & 3 deletions ExternalApplications/MALF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ project(PICSL_MALF)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_executable(jointfusion ./JointFusion/LabelFusion.cxx)
add_executable(sa ./CorrectiveLearning/segAdapter.cxx)
add_executable(adaBoostSegmentationRefinement ./CorrectiveLearning/segAdapter.cxx)
add_executable(bl ./CorrectiveLearning/BiasLearn.cxx)

target_link_libraries(jointfusion antsUtilities ${ITK_LIBRARIES} )
target_link_libraries(sa ${ITK_LIBRARIES} )
target_link_libraries(adaBoostSegmentationRefinement ${ITK_LIBRARIES} )
target_link_libraries(bl ${ITK_LIBRARIES} )


install(TARGETS jointfusion sa bl
install(TARGETS jointfusion adaBoostSegmentationRefinement bl
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
6 changes: 3 additions & 3 deletions ExternalApplications/MALF/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ make
to complie and build the executable files. Our program uses ITK's I/O functions to handle image input
and output. Hence, it requries prebuilt ITK. The following three executable files will be built,

jointfusion : joint label fusion
bl : learning classifiers for correcting systematic errors
sa : apply the learned classifiers to correct systematic segmentation errors on testing images
jointfusion : joint label fusion
bl : learning classifiers for correcting systematic errors
adaBoostSegmentationRefinement : apply the learned classifiers to correct systematic segmentation errors on testing images

Type each command to see details on how to use them.

Expand Down
117 changes: 0 additions & 117 deletions ProjectSourceVersion.cmake

This file was deleted.

14 changes: 0 additions & 14 deletions ProjectSourceVersion.cmake.in

This file was deleted.

0 comments on commit a5e1e41

Please sign in to comment.