cmtk-3.0.0/ 0000755 0001777 0000017 00000000000 12263615446 011520 5 ustar torsten man cmtk-3.0.0/cmtkIncludeDirectories.cmake 0000644 0001777 0000017 00000003325 11613631712 017154 0 ustar torsten man ##
## Copyright 1997-2009 Torsten Rohlfing
##
## Copyright 2004-2010 SRI International
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 3281 $
##
## $LastChangedDate: 2011-07-26 14:38:18 -0700 (Tue, 26 Jul 2011) $
##
## $LastChangedBy: torstenrohlfing $
##
#-----------------------------------------------------------------------------
# Include directories for other projects installed on the system.
SET(CMTK_INCLUDE_DIRS_SYSTEM
${QT_INCLUDE_DIR}
${QT_INCLUDE_PATH}
)
#-----------------------------------------------------------------------------
# Include directories from the build tree.
SET(CMTK_INCLUDE_DIRS_BUILD_TREE ${CMTK_BINARY_DIR})
# These directories are always needed.
SET(CMTK_INCLUDE_DIRS_BUILD_TREE ${CMTK_INCLUDE_DIRS_BUILD_TREE}
${DCMTK_INCLUDE_DIRS}
${NRRD_INCLUDE_DIRS}
${MXML_INCLUDE_DIR}
${SQLITE_INCLUDE_DIR}
${ZCONF_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
${CMTK_SOURCE_DIR}/libs
)
cmtk-3.0.0/testing/ 0000755 0001777 0000017 00000000000 12263615446 013175 5 ustar torsten man cmtk-3.0.0/testing/CMakeLists.txt 0000644 0001777 0000017 00000002251 11544266330 015730 0 ustar torsten man ##
## Copyright 1997-2009 Torsten Rohlfing
##
## Copyright 2004-2011 SRI International
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 3071 $
##
## $LastChangedDate: 2011-03-28 22:23:36 -0700 (Mon, 28 Mar 2011) $
##
## $LastChangedBy: torsten_at_home $
##
IF(BUILD_APPS)
SUBDIRS(apps)
ENDIF(BUILD_APPS)
IF(BUILD_GUI)
SUBDIRS(gui)
ENDIF(BUILD_GUI)
SUBDIRS(libs)
cmtk-3.0.0/testing/libs/ 0000755 0001777 0000017 00000000000 12263615446 014126 5 ustar torsten man cmtk-3.0.0/testing/libs/CMakeLists.txt 0000644 0001777 0000017 00000002433 12207731365 016665 0 ustar torsten man ##
## Copyright 1997-2009 Torsten Rohlfing
##
## Copyright 2004-2010, 2013 SRI International
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 4802 $
##
## $LastChangedDate: 2013-08-29 13:45:41 -0700 (Thu, 29 Aug 2013) $
##
## $LastChangedBy: torstenrohlfing $
##
# ==========================================
# Delegate testing to separate subdirs for each library
SUBDIRS(System)
SUBDIRS(Registration)
SUBDIRS(IO)
SUBDIRS(Base)
IF(CMTK_USE_CUDA)
SUBDIRS(GPU)
ENDIF(CMTK_USE_CUDA)
cmtk-3.0.0/testing/libs/GPU/ 0000755 0001777 0000017 00000000000 12263615446 014561 5 ustar torsten man cmtk-3.0.0/testing/libs/GPU/CMakeLists.txt 0000644 0001777 0000017 00000003736 11414730166 017324 0 ustar torsten man ##
## Copyright 1997-2009 Torsten Rohlfing
##
## Copyright 2004-2010 SRI International
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 1960 $
##
## $LastChangedDate: 2010-07-06 15:38:46 -0700 (Tue, 06 Jul 2010) $
##
## $LastChangedBy: torstenrohlfing $
##
# ==========================================
# Setup binary test drivers
SET(CMTK_LIBRARIES "cmtkGPU;cmtkBase;cmtkNumerics;cmtkSystem")
SET(DRIVERS libGPUTests)
FOREACH(D ${DRIVERS})
CUDA_ADD_EXECUTABLE(${D} ${D}.cxx)
TARGET_LINK_LIBRARIES(${D} ${CMTK_LIBRARIES} ${CMTK_SYSTEM_LIBRARIES})
ENDFOREACH(D ${DRIVERS})
IF(CMTK_USE_CUDA)
# ==========================================
# Tests for "cmtk::DeviceHistogram" class
SET(Tests ${Tests}
DeviceHistogramEntropy
DeviceHistogramPopulate
DeviceHistogramPopulateLog)
# ==========================================
# Tests for "cmtk::DeviceMemory" class
SET(Tests ${Tests}
DeviceMemory)
# ==========================================
# Tests for "cmtk::UniformVolume" class
SET(Tests ${Tests}
DeviceUniformVolume)
ENDIF(CMTK_USE_CUDA)
FOREACH(T ${Tests})
ADD_TEST(${T} ${EXECUTABLE_OUTPUT_PATH}/libGPUTests ${T})
ENDFOREACH(T Tests)
cmtk-3.0.0/testing/libs/GPU/cmtkDeviceMemoryTests.txx 0000644 0001777 0000017 00000006345 11452717235 021626 0 ustar torsten man /*
//
// Copyright 2010 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2398 $
//
// $LastChangedDate: 2010-10-05 14:54:37 -0700 (Tue, 05 Oct 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
// test "DeviceMemory" class
int
testDeviceMemory()
{
size_t memFreeBefore, memTotalBefore;
cudaError_t status = cudaMemGetInfo( &memFreeBefore, &memTotalBefore );
if ( status != cudaSuccess )
{
std::cerr << "Call to cudaMemGetInfo() failed with error " << cudaGetErrorString( status ) << std::endl;
return 1;
}
try
{
float floatHost[100];
cmtk::DeviceMemory::SmartPtr floatDevice = cmtk::DeviceMemory::Create( 100 );
floatDevice->CopyToDevice( floatHost, 100 );
floatDevice->CopyToHost( floatHost, 100 );
int intHost[100];
cmtk::DeviceMemory::SmartPtr intDevice = cmtk::DeviceMemory::Create( 100 );
intDevice->CopyToDevice( intHost, 100 );
intDevice->CopyToHost( intHost, 100 );
char charHost[100];
cmtk::DeviceMemory::SmartPtr charDevice = cmtk::DeviceMemory::Create( 100 );
charDevice->CopyToDevice( charHost, 100 );
charDevice->CopyToHost( charHost, 100 );
cmtk::DeviceMemory::SmartPtr float2Device = cmtk::DeviceMemory::Create( 100 );
float2Device->CopyOnDevice( *floatDevice, 100 );
size_t memFreeAfter, memTotalAfter;
if ( cudaMemGetInfo( &memFreeAfter, &memTotalAfter ) != cudaSuccess )
{
std::cerr << "Second call to cudaMemGetInfo() failed." << std::endl;
return 1;
}
if ( memFreeBefore == memFreeAfter )
{
std::cerr << "Free device memory constant despite allocation at" << memFreeBefore << std::endl;
return 1;
}
}
catch ( std::bad_alloc )
{
std::cerr << "Caught bad_alloc()" << std::endl;
return 1;
}
size_t memFreeAfter, memTotalAfter;
if ( cudaMemGetInfo( &memFreeAfter, &memTotalAfter ) != cudaSuccess )
{
std::cerr << "Third call to cudaMemGetInfo() failed." << std::endl;
return 1;
}
if ( memTotalBefore != memTotalAfter )
{
std::cerr << "Total device memory changed by " << (memTotalBefore - memTotalAfter) << std::endl;
return 1;
}
if ( memFreeBefore != memFreeAfter )
{
std::cerr << "Free device memory changed by" << (memFreeBefore - memFreeAfter) << std::endl;
return 1;
}
return 0;
}
cmtk-3.0.0/testing/libs/GPU/cmtkDeviceUniformVolumeTests.txx 0000644 0001777 0000017 00000004151 12220370626 023147 0 ustar torsten man /*
//
// Copyright 2010, 2012, 2013 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 4876 $
//
// $LastChangedDate: 2013-09-24 13:09:58 -0700 (Tue, 24 Sep 2013) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
// test "DeviceUniformVolume" class
int
testDeviceUniformVolume()
{
try
{
const int dims[3] = { 10, 10, 10 };
const float size[3] = { 9, 9, 9 };
cmtk::UniformVolume volume( (cmtk::FixedVector<3,int>::FromPointer( dims )), cmtk::FixedVector<3,float>::FromPointer( size ) );
// first, try to create representation of actually empty volume.
cmtk::DeviceUniformVolume::SmartPtr volumeDevice = cmtk::DeviceUniformVolume::Create( volume );
// second, allocate pixel data and create another device instance.
volume.CreateDataArray( cmtk::TYPE_INT );
cmtk::DeviceUniformVolume::SmartPtr volumeDevice2 = cmtk::DeviceUniformVolume::Create( volume );
// third, change pixel data to double precision float and create another device instance.
volume.CreateDataArray( cmtk::TYPE_DOUBLE );
cmtk::DeviceUniformVolume::SmartPtr volumeDevice3 = cmtk::DeviceUniformVolume::Create( volume );
}
catch ( std::bad_alloc )
{
std::cerr << "Caught bad_alloc()" << std::endl;
return 1;
}
return 0;
}
cmtk-3.0.0/testing/libs/GPU/libGPUTests.cxx 0000644 0001777 0000017 00000003465 11452717235 017460 0 ustar torsten man /*
//
// Copyright 2004-2010 SRI International
//
// Copyright 1997-2009 Torsten Rohlfing
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2398 $
//
// $LastChangedDate: 2010-10-05 14:54:37 -0700 (Tue, 05 Oct 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
#include
#include "cmtkDeviceHistogramTests.txx"
#include "cmtkDeviceMemoryTests.txx"
#include "cmtkDeviceUniformVolumeTests.txx"
int
main( const int argc, const char* argv[] )
{
cmtk::TestFunctionMap map;
map.AddTest( "DeviceHistogramEntropy", &testDeviceHistogramEntropy );
map.AddTest( "DeviceHistogramPopulate", &testDeviceHistogramPopulate );
map.AddTest( "DeviceHistogramPopulateLog", &testDeviceHistogramPopulateLog );
map.AddTest( "DeviceMemory", &testDeviceMemory );
map.AddTest( "DeviceUniformVolume", &testDeviceUniformVolume );
// is test name given on command line?
if ( argc < 2 )
{
}
else
{
return map.RunTestByName( argv[1] );
}
}
cmtk-3.0.0/testing/libs/GPU/cmtkDeviceHistogramTests.txx 0000644 0001777 0000017 00000015565 11452717235 022317 0 ustar torsten man /*
//
// Copyright 2010 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2398 $
//
// $LastChangedDate: 2010-10-05 14:54:37 -0700 (Tue, 05 Oct 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
#include
#include
int
checkEntropy( const std::string& testName, const float hData[100], cmtk::DeviceHistogram& dHist, const float baseline )
{
dHist.GetDataOnDevice().CopyToDevice( hData, 100 );
const float entropy = dHist.GetEntropy();
if ( fabs( entropy - baseline ) > 1e-5 )
{
std::cerr << "Test " << testName << " entropy " << entropy << " deviates from baseline " << baseline << std::endl;
return 1;
}
return 0;
}
// test "DeviceHistogram" class
int
testDeviceHistogramEntropy()
{
try
{
cmtk::DeviceHistogram::SmartPtr histogram100 = cmtk::DeviceHistogram::Create( 100 );
cmtk::DeviceHistogram::SmartPtr histogram200 = cmtk::DeviceHistogram::Create( 200 );
float floatHost[100];
// compute entropy for all-zeros
for ( size_t i = 0; i < 100; ++i )
floatHost[i] = 0;
if ( checkEntropy( "AllZeros100", floatHost, *histogram100, 0 ) || checkEntropy( "AllZeros200", floatHost, *histogram200, 0 ) )
return 1;
// compute entropy for single non-zero bin
floatHost[0] = 1;
if ( checkEntropy( "SingleBin100", floatHost, *histogram100, 0 ) || checkEntropy( "SingleBin200", floatHost, *histogram200, 0 ) )
return 1;
// compute entropy for all-ones
for ( size_t i = 0; i < 100; ++i )
floatHost[i] = 1;
if ( checkEntropy( "AllOnes100", floatHost, *histogram100, 4.60517 ) || checkEntropy( "AllOnes200", floatHost, *histogram200, 4.60517 ) )
return 1;
// compute entropy for 50x 0, 50x 1
for ( size_t i = 0; i < 50; ++i )
floatHost[i] = 0;
if ( checkEntropy( "50One50Zero100", floatHost, *histogram100, 3.91202 ) || checkEntropy( "50One50Zero200", floatHost, *histogram200, 3.91202 ) )
return 1;
// compute entropy for 50x "0 1" alternating
for ( size_t i = 0; i < 50; ++i )
{
floatHost[i<<1] = 1;
floatHost[1+(i<<1)] = 0;
}
if ( checkEntropy( "50OneZeroPairs100", floatHost, *histogram100, 3.91202 ) || checkEntropy( "50OneZeroPairs200", floatHost, *histogram200, 3.91202 ) )
return 1;
}
catch ( std::bad_alloc )
{
std::cerr << "Caught bad_alloc()" << std::endl;
return 1;
}
return 0;
}
template
int
compareHistogramToBaseline( const cmtk::DeviceHistogram& histD, const float* base )
{
cmtk::FixedVector histogram;
histD.GetDataOnDevice().CopyToHost( &histogram[0], NBINS );
for ( size_t j = 0; j < NBINS; ++j )
{
if ( histogram[j] != base[j] )
{
std::cerr << "actual\tbaseline" << std::endl;
for ( size_t i = 0; i < NBINS; ++i )
{
std::cerr << histogram[i] << "\t" << base[i] << std::endl;
}
std::cerr << std::endl;
return 1;
}
}
return 0;
}
int
testDeviceHistogramPopulate()
{
try
{
cmtk::DeviceHistogram::SmartPtr histogramD = cmtk::DeviceHistogram::Create( 4 );
const float data[10] = { 0, 6, 3, 7, 2, 2, 8, 8, 1, 10 };
cmtk::DeviceMemory::SmartPtr dataD = cmtk::DeviceMemory::Create( 10, data );
// reset histogram
histogramD->Reset();
const float baseline0[4] = { 0, 0, 0, 0 };
if ( compareHistogramToBaseline<4>( *histogramD, baseline0 ) )
return 1;
// populate histogram from data
histogramD->Populate( *dataD, 0.0 /*rangeFrom*/, 10.0 /*rangeTo*/ );
const float baseline1[4] = { 5, 1, 3, 1 };
if ( compareHistogramToBaseline<4>( *histogramD, baseline1 ) )
return 1;
// add same data to histogram second time without reset
histogramD->Populate( *dataD, 0.0 /*rangeFrom*/, 10.0 /*rangeTo*/ );
const float baseline2[4] = { 10, 2, 6, 2 };
if ( compareHistogramToBaseline<4>( *histogramD, baseline2 ) )
return 1;
// reset and populate histogram using mask
const int mask[10] = { 0, 0, 1, 1, 0, 0, 0, 1, 1, 1 };
cmtk::DeviceMemory::SmartPtr maskD = cmtk::DeviceMemory::Create( 10, mask );
histogramD->Reset();
histogramD->Populate( *dataD, *maskD, 0.0 /*rangeFrom*/, 10.0 /*rangeTo*/ );
const float baseline3[4] = { 2, 0, 2, 1 };
if ( compareHistogramToBaseline<4>( *histogramD, baseline3 ) )
return 1;
}
catch ( std::bad_alloc )
{
std::cerr << "Caught bad_alloc()" << std::endl;
return 1;
}
return 0;
}
int
testDeviceHistogramPopulateLog()
{
try
{
cmtk::DeviceHistogram::SmartPtr histogramD = cmtk::DeviceHistogram::Create( 4 );
const float data[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
cmtk::DeviceMemory::SmartPtr dataD = cmtk::DeviceMemory::Create( 10, data );
// reset histogram
histogramD->Reset();
const float baseline0[4] = { 0, 0, 0, 0 };
if ( compareHistogramToBaseline<4>( *histogramD, baseline0 ) )
return 1;
// populate histogram from data
histogramD->Populate( *dataD, 0.0 /*rangeFrom*/, 9.0 /*rangeTo*/, true /*logScale*/ );
const float baseline1[4] = { 4, 3, 3, 0 };
if ( compareHistogramToBaseline<4>( *histogramD, baseline1 ) )
return 1;
// add same data to histogram second time without reset
histogramD->Populate( *dataD, 0.0 /*rangeFrom*/, 9.0 /*rangeTo*/, true /*logScale*/ );
const float baseline2[4] = { 8, 6, 6, 0 };
if ( compareHistogramToBaseline<4>( *histogramD, baseline2 ) )
return 1;
// reset and populate histogram using mask
const int mask[10] = { 0, 0, 1, 1, 0, 0, 0, 1, 1, 1 };
cmtk::DeviceMemory::SmartPtr maskD = cmtk::DeviceMemory::Create( 10, mask );
histogramD->Reset();
histogramD->Populate( *dataD, *maskD, 0.0 /*rangeFrom*/, 9.0 /*rangeTo*/, true /*logScale*/ );
const float baseline3[4] = { 2, 0, 3, 0 };
if ( compareHistogramToBaseline<4>( *histogramD, baseline3 ) )
return 1;
}
catch ( std::bad_alloc )
{
std::cerr << "Caught bad_alloc()" << std::endl;
return 1;
}
return 0;
}
cmtk-3.0.0/testing/libs/Registration/ 0000755 0001777 0000017 00000000000 12263615446 016600 5 ustar torsten man cmtk-3.0.0/testing/libs/Registration/CMakeLists.txt 0000644 0001777 0000017 00000004715 11761260653 021345 0 ustar torsten man ##
## Copyright 2004-2012 SRI International
##
## Copyright 1997-2009 Torsten Rohlfing
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 4367 $
##
## $LastChangedDate: 2012-05-29 16:54:19 -0700 (Tue, 29 May 2012) $
##
## $LastChangedBy: torstenrohlfing $
##
# ==========================================
# Setup binary test drivers
SET(CMTK_LIBRARIES "cmtkRegistration;cmtkIO;cmtkBase;cmtkNumerics;cmtkSystem")
SET(DRIVERS libRegistrationTests)
IF(CMTK_USE_SQLITE)
SET(DRIVERS ${DRIVERS} libRegistrationTestsSQLite)
ENDIF(CMTK_USE_SQLITE)
FOREACH(D ${DRIVERS})
ADD_EXECUTABLE(${D} ${D}.cxx)
TARGET_LINK_LIBRARIES(${D} ${CMTK_LIBRARIES} ${CMTK_SYSTEM_LIBRARIES})
ENDFOREACH(D ${DRIVERS})
# ==========================================
# Tests for "cmtk::TypedArraySimilarity" class
SET(Tests ${Tests} TypedArraySimilarity)
FOREACH(T ${Tests})
ADD_TEST(${T} ${EXECUTABLE_OUTPUT_PATH}/libRegistrationTests ${T})
ENDFOREACH(T ${Tests})
# ==========================================
# Tests for "cmtk::XformImageDB" class
IF(CMTK_USE_SQLITE)
SET(Tests
ImageXformDBCreate
ImageXformDBAddImage
ImageXformDBAddImageRepeat
ImageXformDBAddImagePair
ImageXformDBAddImageThenXform
ImageXformDBAddImageWithXform
ImageXformDBAddXformSameSpace
ImageXformDBAddXformRefined
ImageXformDBFindXform
ImageXformDBFindXformSameSpace
ImageXformDBFindXformInverse
ImageXformDBFindXformNone
ImageXformDBFindXformMultiple
ImageXformDBFindXformLevels
ImageXformDBFindXformLevelsInverse
)
FOREACH(T ${Tests})
ADD_TEST(${T} ${EXECUTABLE_OUTPUT_PATH}/libRegistrationTestsSQLite ${T})
ENDFOREACH(T ${Tests})
ENDIF(CMTK_USE_SQLITE)
cmtk-3.0.0/testing/libs/Registration/cmtkImageXformDBTests.txx 0000644 0001777 0000017 00000032753 12217637632 023525 0 ustar torsten man /*
//
// Copyright 2010, 2013 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 4859 $
//
// $LastChangedDate: 2013-09-22 12:06:02 -0700 (Sun, 22 Sep 2013) $
//
// $LastChangedBy: torsten_at_home $
//
*/
#include
// test database creation
int
testImageXformDBCreate()
{
cmtk::ImageXformDB db( "imagexform.sqlite" );
return 0;
}
// test open of existing file
int
testImageXformDBOpen()
{
cmtk::ImageXformDB db( CMTK_DATADIR "/empty.sqlite", true /*readOnly*/ );
return 0;
}
// test adding an image to a database
int
testImageXformDBAddImage()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
db.AddImage( "image1.nii" );
const cmtk::ImageXformDB::PrimaryKeyType key1 = db.FindImageSpaceID( "image1.nii" );
if ( key1 == cmtk::ImageXformDB::NOTFOUND )
{
std::cerr << "No space key for image1." << std::endl;
return 1;
}
db.AddImage( "image2.nii", "image1.nii" );
const cmtk::ImageXformDB::PrimaryKeyType key2 = db.FindImageSpaceID( "image2.nii" );
if ( key2 == cmtk::ImageXformDB::NOTFOUND )
{
std::cerr << "No space key for image2." << std::endl;
return 1;
}
if ( key1 != key2 )
{
std::cerr << "Keys for image1 and image2 do not match." << std::endl;
return 1;
}
db.AddImage( "image3.nii", "image2.nii" );
const cmtk::ImageXformDB::PrimaryKeyType key3 = db.FindImageSpaceID( "image3.nii" );
if ( key3 == cmtk::ImageXformDB::NOTFOUND )
{
std::cerr << "No space key for image3." << std::endl;
return 1;
}
if ( key1 != key3 )
{
std::cerr << "Keys for image1 and image3 do not match." << std::endl;
return 1;
}
db.AddImage( "image4.nii" );
const cmtk::ImageXformDB::PrimaryKeyType key4 = db.FindImageSpaceID( "image4.nii" );
if ( key4 == cmtk::ImageXformDB::NOTFOUND )
{
std::cerr << "No space key for image4." << std::endl;
return 1;
}
if ( key4 == key1 )
{
std::cerr << "Keys for image1 and image4 match when they should not." << std::endl;
return 1;
}
return 0;
}
// test adding an image to a database repeatedly without creating multiple entries.
int
testImageXformDBAddImageRepeat()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
db.AddImage( "image1.nii" );
const cmtk::ImageXformDB::PrimaryKeyType key1 = db.FindImageSpaceID( "image1.nii" );
if ( key1 == cmtk::ImageXformDB::NOTFOUND )
{
std::cerr << "No space key for image1 (first add)" << std::endl;
return 1;
}
db.AddImage( "image1.nii" );
const cmtk::ImageXformDB::PrimaryKeyType key2 = db.FindImageSpaceID( "image1.nii" );
if ( key2 == cmtk::ImageXformDB::NOTFOUND )
{
std::cerr << "No space key for image1 (second add)" << std::endl;
return 1;
}
if ( key1 != key2 )
{
std::cerr << "Two different keys." << std::endl;
return 1;
}
const std::vector list = db.GetSpaceImageList( db.FindImageSpaceID( "image1.nii" ) );
if ( list.size() != 1 )
{
std::cerr << "Number of entries is not equal to 1." << std::endl;
return 1;
}
return 0;
}
// test adding an image to a database
int
testImageXformDBAddImagePair()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
db.AddImage( "image2.nii", "image1.nii" );
const cmtk::ImageXformDB::PrimaryKeyType key1 = db.FindImageSpaceID( "image1.nii" );
if ( key1 == cmtk::ImageXformDB::NOTFOUND )
{
std::cerr << "No space key for image1." << std::endl;
return 1;
}
const cmtk::ImageXformDB::PrimaryKeyType key2 = db.FindImageSpaceID( "image2.nii" );
if ( key2 == cmtk::ImageXformDB::NOTFOUND )
{
std::cerr << "No space key for image2." << std::endl;
return 1;
}
if ( key1 != key2 )
{
std::cerr << "Keys for image1 and image2 do not match." << std::endl;
return 1;
}
return 0;
}
// test adding images, then a transformation to a database
int
testImageXformDBAddImageThenXform()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
db.AddImage( "image1.nii" );
db.AddImage( "image2.nii" );
db.AddImage( "image4.nii" );
if ( ! db.AddImagePairXform( "xform12", true /*invertible*/, "image1.nii", "image2.nii" ) ||
! db.AddImagePairXform( "xform21", false /*invertible*/, "image2.nii", "image1.nii" ) ||
! db.AddImagePairXform( "xform42", false /*invertible*/, "image4.nii", "image2.nii" ) )
return 1;
return 0;
}
// test adding images and transformations to a database
int
testImageXformDBAddImageWithXform()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
if ( ! db.AddImagePairXform( "xform12", true /*invertible*/, "image1.nii", "image2.nii" ) ||
! db.AddImagePairXform( "xform21", false /*invertible*/, "image2.nii", "image1.nii" ) ||
! db.AddImagePairXform( "xform42", false /*invertible*/, "image4.nii", "image2.nii" ) )
return 1;
return 0;
}
// test: try adding a transformation between images in the same space
int
testImageXformDBAddXformSameSpace()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
db.AddImage( "image1.nii" );
db.AddImage( "image2.nii", "image1.nii" );
if ( db.AddImagePairXform( "xform12", true /*invertible*/, "image1.nii", "image2.nii" ) )
return 1;
return 0;
}
// test: add transformation, then add its refinement.
int
testImageXformDBAddXformRefined()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
db.AddImage( "image1.nii" );
db.AddImage( "image2.nii" );
if ( ! db.AddImagePairXform( "xform12", true /*invertible*/, "image1.nii", "image2.nii" ) ||
! db.AddRefinedXform( "xform12refined", true /*invertible*/, "xform12" ) )
{
std::cerr << "DB add transformation." << std::endl;
return 1;
}
if ( (db.FindXformLevel( "xform12" ) != 0) ||
(db.FindXformLevel( "xform12refined" ) != 1) )
{
std::cerr << "DB transformation levels are incorrect." << std::endl;
return 1;
}
return 0;
}
// test getting simple transformations
int
testImageXformDBFindXform()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
if ( ! db.AddImagePairXform( "xform12", true /*invertible*/, "image1.nii", "image2.nii" ) )
return 1;
std::string xform;
bool inverse;
if ( ! db.FindXform( "image1.nii", "image2.nii", xform, inverse ) )
{
std::cerr << "DB transformation lookup failed." << std::endl;
return 1;
}
if ( xform != "xform12" )
{
std::cerr << "DB transformation returned wrong xform." << std::endl;
return 1;
}
if ( inverse )
{
std::cerr << "DB transformation returned wrong inversion flag." << std::endl;
return 1;
}
return 0;
}
// test getting transformation between two images in the same space.
int
testImageXformDBFindXformSameSpace()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
db.AddImage( "image1.nii" );
db.AddImage( "image2.nii", "image1.nii" );
std::string xform;
bool inverse;
if ( ! db.FindXform( "image1.nii", "image2.nii", xform, inverse ) )
{
std::cerr << "DB transformation lookup failed." << std::endl;
return 1;
}
if ( xform != "" )
{
std::cerr << "DB transformation returned wrong xform." << std::endl;
return 1;
}
if ( inverse )
{
std::cerr << "DB transformation returned wrong inversion flag." << std::endl;
return 1;
}
return 0;
}
// test getting inverse transformations
int
testImageXformDBFindXformInverse()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
if ( ! db.AddImagePairXform( "xform12", true /*invertible*/, "image1.nii", "image2.nii" ) )
return 1;
std::string xform;
bool inverse;
if ( ! db.FindXform( "image2.nii", "image1.nii", xform, inverse ) )
{
std::cerr << "DB transformation lookup failed." << std::endl;
return 1;
}
if ( xform != "xform12" )
{
std::cerr << "DB transformation returned wrong xform." << std::endl;
return 1;
}
if ( !inverse )
{
std::cerr << "DB transformation returned wrong inversion flag." << std::endl;
return 1;
}
return 0;
}
// test getting transformations when none actually exists
int
testImageXformDBFindXformNone()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
if ( ! db.AddImagePairXform( "xform12", true /*invertible*/, "image1.nii", "image2.nii" ) )
return 1;
std::string xform;
bool inverse;
if ( db.FindXform( "image1.nii", "image3.nii", xform, inverse ) )
{
std::cerr << "DB transformation lookup succeeded when it should have failed." << std::endl;
return 1;
}
if ( db.FindXform( "image3.nii", "image2.nii", xform, inverse ) )
{
std::cerr << "DB transformation lookup succeeded when it should have failed." << std::endl;
return 1;
}
if ( db.FindXform( "image3.nii", "image3.nii", xform, inverse ) )
{
std::cerr << "DB transformation lookup succeeded when it should have failed." << std::endl;
return 1;
}
return 0;
}
// test getting transformations when multiple different ones exist
int
testImageXformDBFindXformMultiple()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
if ( ! db.AddImagePairXform( "affine12", true /*invertible*/, "image1.nii", "image2.nii" ) ||
! db.AddImagePairXform( "nonrigid12", false /*invertible*/, "image1.nii", "image2.nii" ) )
return 1;
std::string xform;
bool inverse;
if ( ! db.FindXform( "image1.nii", "image2.nii", xform, inverse ) )
{
std::cerr << "DB transformation lookup failed." << std::endl;
return 1;
}
if ( xform != "nonrigid12" )
{
std::cerr << "DB transformation returned wrong xform." << std::endl;
return 1;
}
if ( inverse )
{
std::cerr << "DB transformation returned wrong inversion flag." << std::endl;
return 1;
}
if ( ! db.FindXform( "image2.nii", "image1.nii", xform, inverse ) )
{
std::cerr << "DB transformation lookup failed." << std::endl;
return 1;
}
if ( xform != "nonrigid12" )
{
std::cerr << "DB transformation returned wrong xform." << std::endl;
return 1;
}
if ( !inverse )
{
std::cerr << "DB transformation returned wrong inversion flag." << std::endl;
return 1;
}
return 0;
}
// test getting transformations when multiple refinement levels exist.
int
testImageXformDBFindXformLevels()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
if ( ! db.AddImagePairXform( "affine12", true /*invertible*/, "image1.nii", "image2.nii" ) ||
! db.AddRefinedXform( "nonrigid12", false /*invertible*/, "affine12" ) )
return 1;
std::string xform;
bool inverse;
if ( ! db.FindXform( "image1.nii", "image2.nii", xform, inverse ) )
{
std::cerr << "DB transformation lookup failed." << std::endl;
return 1;
}
if ( xform != "nonrigid12" )
{
std::cerr << "DB transformation returned wrong xform." << std::endl;
return 1;
}
if ( inverse )
{
std::cerr << "DB transformation returned wrong inversion flag." << std::endl;
return 1;
}
if ( ! db.FindXform( "image2.nii", "image1.nii", xform, inverse ) )
{
std::cerr << "DB transformation lookup failed." << std::endl;
return 1;
}
if ( xform != "nonrigid12" )
{
std::cerr << "DB transformation returned wrong xform." << std::endl;
return 1;
}
if ( !inverse )
{
std::cerr << "DB transformation returned wrong inversion flag." << std::endl;
return 1;
}
return 0;
}
// test getting transformations when multiple refinement levels exist and the refined transformation is based on an inverted initial transformation
int
testImageXformDBFindXformLevelsInverse()
{
cmtk::ImageXformDB db( ":memory:" );
db.DebugModeOn();
if ( ! db.AddImagePairXform( "affine12", true /*invertible*/, "image1.nii", "image2.nii" ) ||
! db.AddRefinedXform( "nonrigid21", false /*invertible*/, "affine12", true /*initInverse*/ ) )
return 1;
std::string xform;
bool inverse;
if ( ! db.FindXform( "image1.nii", "image2.nii", xform, inverse ) )
{
std::cerr << "DB transformation lookup failed." << std::endl;
return 1;
}
if ( xform != "affine12" )
{
std::cerr << "DB transformation returned wrong xform." << std::endl;
return 1;
}
if ( inverse )
{
std::cerr << "DB transformation returned wrong inversion flag." << std::endl;
return 1;
}
if ( ! db.FindXform( "image2.nii", "image1.nii", xform, inverse ) )
{
std::cerr << "DB transformation lookup failed." << std::endl;
return 1;
}
if ( xform != "nonrigid21" )
{
std::cerr << "DB transformation returned wrong xform." << std::endl;
return 1;
}
if ( inverse )
{
std::cerr << "DB transformation returned wrong inversion flag." << std::endl;
return 1;
}
return 0;
}
cmtk-3.0.0/testing/libs/Registration/libRegistrationTestsSQLite.cxx 0000644 0001777 0000017 00000006622 11430605055 024566 0 ustar torsten man /*
//
// Copyright 2004-2010 SRI International
//
// Copyright 1997-2009 Torsten Rohlfing
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2192 $
//
// $LastChangedDate: 2010-08-11 13:38:05 -0700 (Wed, 11 Aug 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
#include "cmtkImageXformDBTests.txx"
/** Set up table of test names and function pointers */
typedef int (*testFuncPtr)();
typedef
struct __testNameAndFunctionPointer
{
const char* name;
const testFuncPtr func;
} testNameAndFunctionPointer;
const testNameAndFunctionPointer testTable[] =
{
{ "ImageXformDBCreate", &testImageXformDBCreate },
{ "ImageXformDBOpen", &testImageXformDBOpen },
{ "ImageXformDBAddImage", &testImageXformDBAddImage },
{ "ImageXformDBAddImageRepeat", &testImageXformDBAddImageRepeat },
{ "ImageXformDBAddImagePair", &testImageXformDBAddImagePair },
{ "ImageXformDBAddImageThenXform", &testImageXformDBAddImageThenXform },
{ "ImageXformDBAddImageWithXform", &testImageXformDBAddImageWithXform },
{ "ImageXformDBAddXformSameSpace", &testImageXformDBAddXformSameSpace },
{ "ImageXformDBAddXformRefined", &testImageXformDBAddXformRefined },
{ "ImageXformDBFindXform", &testImageXformDBFindXform },
{ "ImageXformDBFindXformSameSpace", &testImageXformDBFindXformSameSpace },
{ "ImageXformDBFindXformInverse", &testImageXformDBFindXformInverse },
{ "ImageXformDBFindXformNone", &testImageXformDBFindXformNone },
{ "ImageXformDBFindXformMultiple", &testImageXformDBFindXformMultiple },
{ "ImageXformDBFindXformLevels", &testImageXformDBFindXformLevels },
{ "ImageXformDBFindXformLevelsInverse", &testImageXformDBFindXformLevelsInverse },
{ NULL, NULL }
};
int
main( const int argc, const char* argv[] )
{
int testNumber = -1;
// is test name given on command line?
if ( argc < 2 )
{
// no: ask user in dialog mode
for ( size_t i = 0; testTable[i].name; ++i )
{
std::cout << i << ". " << testTable[i].name << std::endl;
}
std::cout << "Run test number: ";
std::cin >> testNumber;
}
else
{
// batch mode: find test by name given on command line
for ( size_t i = 0; testTable[i].name; ++i )
{
if ( !strcmp( argv[1], testTable[i].name ) )
testNumber = i;
}
}
// run test, or return error if none found
if ( testNumber < 0 )
{
std::cerr << "Test " << argv[1] << " not found!" << std::endl;
return 2;
}
else
return testTable[testNumber].func();
}
cmtk-3.0.0/testing/libs/Registration/libRegistrationTests.cxx 0000644 0001777 0000017 00000004257 11761260653 023516 0 ustar torsten man /*
//
// Copyright 2004-2012 SRI International
//
// Copyright 1997-2009 Torsten Rohlfing
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 4367 $
//
// $LastChangedDate: 2012-05-29 16:54:19 -0700 (Tue, 29 May 2012) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include "cmtkTypedArraySimilarityTests.txx"
/** Set up table of test names and function pointers */
typedef int (*testFuncPtr)();
typedef
struct __testNameAndFunctionPointer
{
const char* name;
const testFuncPtr func;
} testNameAndFunctionPointer;
const testNameAndFunctionPointer testTable[] =
{
{ "TypedArraySimilarity", &testTypedArraySimilarity },
{ NULL, NULL }
};
int
main( const int argc, const char* argv[] )
{
int testNumber = -1;
// is test name given on command line?
if ( argc < 2 )
{
// no: ask user in dialog mode
for ( size_t i = 0; testTable[i].name; ++i )
{
std::cout << i << ". " << testTable[i].name << std::endl;
}
std::cout << "Run test number: ";
std::cin >> testNumber;
}
else
{
// batch mode: find test by name given on command line
for ( size_t i = 0; testTable[i].name; ++i )
{
if ( !strcmp( argv[1], testTable[i].name ) )
testNumber = i;
}
}
// run test, or return error if none found
if ( testNumber < 0 )
return 2;
else
return testTable[testNumber].func();
}
cmtk-3.0.0/testing/libs/Registration/cmtkTypedArraySimilarityTests.txx 0000644 0001777 0000017 00000006774 11452717235 025416 0 ustar torsten man /*
//
// Copyright 2004-2010 SRI International
//
// Copyright 1997-2009 Torsten Rohlfing
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2398 $
//
// $LastChangedDate: 2010-10-05 14:54:37 -0700 (Tue, 05 Oct 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
#ifdef HAVE_IEEEFP_H
# include
#endif
#include
#include
// Check TypedArraySimilarity result against baseline.
int
testTypedArraySimilarityCheck( const char* name, const cmtk::Types::DataItem result, const cmtk::Types::DataItem baseline )
{
const cmtk::Types::DataItem tolerance = 1e-4;
const cmtk::Types::DataItem error = 2 * fabs(result-baseline) / (fabs(result)+fabs(baseline));
if ( !finite( result ) || (error > tolerance) )
{
std::cerr << name << " returned " << result << ", which exceeds tolerance for baseline " << baseline << std::endl;
return 0;
}
return 1;
}
// test "TypedArraySimilarity" class
int
testTypedArraySimilarity()
{
cmtk::UniformVolume::SmartPtr testVolume( cmtk::VolumeIO::Read( CMTK_DATADIR "/spgr_3t.hdr" ) );
if ( ! testVolume )
{
std::cerr << "SETUP ERROR: could not read test image 'spgr_3t.hdr'" << std::endl;
return 1;
}
cmtk::TypedArray::SmartPtr data0( testVolume->GetOrthoSlice( 2, 34 )->GetPixelData() );
cmtk::TypedArray::SmartPtr data1( testVolume->GetOrthoSlice( 2, 35 )->GetPixelData() );
int success = 0;
success += testTypedArraySimilarityCheck( "GetMutualInformation", cmtk::TypedArraySimilarity::GetMutualInformation( data0, data1 ), 1.55075 );
success += testTypedArraySimilarityCheck( "GetNormalizedMutualInformation", cmtk::TypedArraySimilarity::GetNormalizedMutualInformation( data0, data1 ), 1.29928 );
success += testTypedArraySimilarityCheck( "GetPeakSignalToNoiseRatio", cmtk::TypedArraySimilarity::GetPeakSignalToNoiseRatio( data0, data1 ), -4.98786 );
success += testTypedArraySimilarityCheck( "GetMinusMeanSquaredDifference", cmtk::TypedArraySimilarity::GetMinusMeanSquaredDifference( data0, data1 ), -9545.03 );
success += testTypedArraySimilarityCheck( "GetCrossCorrelation", cmtk::TypedArraySimilarity::GetCrossCorrelation( data0, data1 ), 0.964253 );
success += testTypedArraySimilarityCheck( "GetCorrelationRatio", cmtk::TypedArraySimilarity::GetCorrelationRatio( data0, data1 ), 0.933251 );
cmtk::Types::DataItem scaleFactor = 0;
success += testTypedArraySimilarityCheck( "GetDifferenceImageEntropy", cmtk::TypedArraySimilarity::GetDifferenceArrayEntropy( data0, data1, scaleFactor ), 2.89753 );
success += testTypedArraySimilarityCheck( "GetDifferenceImageEntropy::scaleFactor", scaleFactor, 1.01683 );
return (success == 8) ? 0 : 1;
}
cmtk-3.0.0/testing/libs/Base/ 0000755 0001777 0000017 00000000000 12263615446 015000 5 ustar torsten man cmtk-3.0.0/testing/libs/Base/CMakeLists.txt 0000644 0001777 0000017 00000005440 12024721403 017525 0 ustar torsten man ##
## Copyright 1997-2009 Torsten Rohlfing
##
## Copyright 2004-2012 SRI International
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 4510 $
##
## $LastChangedDate: 2012-09-14 14:34:59 -0700 (Fri, 14 Sep 2012) $
##
## $LastChangedBy: torstenrohlfing $
##
# ==========================================
# Setup binary test drivers
SET(CMTK_LIBRARIES "cmtkBase;cmtkNumerics;cmtkSystem")
SET(DRIVERS libBaseTests)
FOREACH(D ${DRIVERS})
ADD_EXECUTABLE(${D} ${D}.cxx)
TARGET_LINK_LIBRARIES(${D} ${CMTK_LIBRARIES} ${CMTK_SYSTEM_LIBRARIES})
ENDFOREACH(D ${DRIVERS})
# ==========================================
# Tests for "cmtk::DataGrid" class
SET(Tests ${Tests} DataGridMatches)
# ==========================================
# Tests for "cmtk::Region" class
SET(Tests ${Tests}
RegionSizeInt
RegionSizeFloat)
# ==========================================
# Tests for "cmtk::ParametricPlane" class
SET(Tests ${Tests}
ParametricPlaneMirror
ParametricPlaneMirrorOffset)
# ==========================================
# Tests for "cmtk::ScalarImage" class
SET(Tests ${Tests} ScalarImage)
# ==========================================
# Tests for "cmtk::SplineWarpXform" class
SET(Tests ${Tests} SplineWarpXform SplineWarpXformInverse)
# ==========================================
# Tests for "cmtk::SymmetricMatrix" class
SET(Tests ${Tests}
SymmetricMatrix
SymmetricMatrixResize
SymmetricMatrixEqual)
# ==========================================
# Tests for "cmtk::TypedArray" class
SET(Tests ${Tests}
TypedArrayMatchHistogram1
TypedArrayMatchHistogram2
TypedArrayMatchHistogram3
TypedArrayMatchHistogram4)
# ==========================================
# Tests for "cmtk::UniformVolume" class
SET(Tests ${Tests} UniformVolumeMatches)
# ==========================================
# Tests for "cmtk::MathUtil" functions
SET(Tests ${Tests}
EigenSystemSymmetricMatrix3x3
MathUtilUniformRandom)
FOREACH(T ${Tests})
ADD_TEST(${T} ${EXECUTABLE_OUTPUT_PATH}/libBaseTests ${T})
ENDFOREACH(T Tests)
cmtk-3.0.0/testing/libs/Base/cmtkScalarImageTests.txx 0000644 0001777 0000017 00000002343 11452717235 021617 0 ustar torsten man /*
//
// Copyright 2004-2010 SRI International
// Copyright 1997-2009 Torsten Rohlfing
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2398 $
//
// $LastChangedDate: 2010-10-05 14:54:37 -0700 (Tue, 05 Oct 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
// test "GridMatches" function
int
testScalarImage()
{
cmtk::ScalarImage image;
cmtk::ScalarImage image2( image );
return 0;
}
cmtk-3.0.0/testing/libs/Base/cmtkUniformVolumeTests.txx 0000644 0001777 0000017 00000004337 11765704432 022265 0 ustar torsten man /*
//
// Copyright 2004-2012 SRI International
//
// Copyright 1997-2010 Torsten Rohlfing
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 4427 $
//
// $LastChangedDate: 2012-06-12 11:23:22 -0700 (Tue, 12 Jun 2012) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
// test "GridMatches" function
int
testUniformVolumeMatches()
{
const int dims1[3] = { 10, 11, 12 };
const cmtk::Types::Coordinate size1a[3] = { 9, 10, 11 };
const cmtk::Types::Coordinate size1b[3] = { 10, 11, 12 };
const int dims2[3] = { 11, 12, 10 };
const cmtk::Types::Coordinate size2[3] = { 11, 12, 10 };
cmtk::UniformVolume volume1a( (cmtk::UniformVolume::IndexType::FromPointer( dims1 )), cmtk::FixedVector<3,cmtk::Types::Coordinate>::FromPointer( size1a ) );
cmtk::UniformVolume volume1b( (cmtk::UniformVolume::IndexType::FromPointer( dims1 )), cmtk::FixedVector<3,cmtk::Types::Coordinate>::FromPointer( size1b ) );
cmtk::UniformVolume volume1c( (cmtk::UniformVolume::IndexType::FromPointer( dims1 )), cmtk::FixedVector<3,cmtk::Types::Coordinate>::FromPointer( size1b ) );
cmtk::UniformVolume volume2( (cmtk::UniformVolume::IndexType::FromPointer( dims2 )), cmtk::FixedVector<3,cmtk::Types::Coordinate>::FromPointer( size2 ) );
if ( volume1a.GridMatches( volume1b ) )
return 1;
if ( !volume1b.GridMatches( volume1c ) )
return 1;
if ( volume1a.GridMatches( volume2 ) )
return 1;
return 0;
}
cmtk-3.0.0/testing/libs/Base/cmtkParametricPlaneTests.txx 0000644 0001777 0000017 00000007523 11452730031 022510 0 ustar torsten man /*
//
// Copyright 2010 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2401 $
//
// $LastChangedDate: 2010-10-05 16:09:13 -0700 (Tue, 05 Oct 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
#include
#include
// test parametric plane reflection with zero offset
int
testParametricPlaneMirror()
{
typedef cmtk::ParametricPlane PlaneType;
typedef PlaneType::CoordinateVectorType VectorType;
typedef cmtk::AffineXform::MatrixType MatrixType;
VectorType origin;
std::fill( origin.begin(), origin.end(), 0 );
PlaneType plane;
plane.SetOrigin( origin );
plane.SetTheta( cmtk::Units::Degrees( 30 ) );
plane.SetPhi( cmtk::Units::Degrees( 45 ) );
for ( double rho = 0; rho < 21; rho += 20 )
{
plane.SetRho( rho );
VectorType v;
v[0] = v[1] = v[2] = 1;
VectorType pv = v;
plane.MirrorInPlace( pv );
MatrixType pm = plane.GetMirrorXformMatrix();
VectorType mv = v * pm;
if ( sqrt( (mv-pv).SumOfSquares() ) > 1e-5 )
{
std::cerr << "ParametricPlane::MirrorInPlace and mirror matrix produce different results." << std::endl;
return 1;
}
mv *= pm;
if ( sqrt( (mv-v).SumOfSquares() ) > 1e-5 )
{
std::cerr << "ParametricPlane mirror matrix applied twice does not return to original point." << std::endl;
return 1;
}
plane.MirrorInPlace( pv );
if ( sqrt( (pv-v).SumOfSquares() ) > 1e-5 )
{
std::cerr << "ParametricPlane::MirrorInPlane applied twice does not return to original point." << std::endl;
return 1;
}
}
return 0;
}
// test parametric plane reflection with non-zero offset
int
testParametricPlaneMirrorOffset()
{
typedef cmtk::ParametricPlane PlaneType;
typedef PlaneType::CoordinateVectorType VectorType;
typedef cmtk::AffineXform::MatrixType MatrixType;
VectorType origin;
origin[0] = 10;
origin[1] = 20;
origin[2] = 30;
PlaneType plane;
plane.SetOrigin( origin );
plane.SetTheta( cmtk::Units::Degrees( 30 ) );
plane.SetPhi( cmtk::Units::Degrees( 45 ) );
for ( double rho = 0; rho < 21; rho += 20 )
{
plane.SetRho( rho );
VectorType v;
v[0] = v[1] = v[2] = 1;
VectorType pv = v;
plane.MirrorInPlace( pv );
MatrixType pm = plane.GetMirrorXformMatrix();
VectorType mv = v * pm;
if ( sqrt( (mv-pv).SumOfSquares() ) > 1e-5 )
{
std::cerr << "ParametricPlane::MirrorInPlace and mirror matrix produce different results." << std::endl;
return 1;
}
mv *= pm;
if ( sqrt( (mv-v).SumOfSquares() ) > 1e-5 )
{
std::cerr << "ParametricPlane mirror matrix applied twice does not return to original point." << std::endl;
return 1;
}
plane.MirrorInPlace( pv );
if ( sqrt( (pv-v).SumOfSquares() ) > 1e-5 )
{
std::cerr << "ParametricPlane::MirrorInPlane applied twice does not return to original point." << std::endl;
return 1;
}
}
return 0;
}
cmtk-3.0.0/testing/libs/Base/cmtkMathUtilTests.txx 0000644 0001777 0000017 00000004321 12024721403 021160 0 ustar torsten man /*
//
// Copyright 1997-2009 Torsten Rohlfing
// Copyright 2004-2009 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2398 $
//
// $LastChangedDate: 2010-10-05 14:54:37 -0700 (Tue, 05 Oct 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
// test whether uniform random numbers are reasonably uniform; does NOT test whether they are random!
int
testMathUtilUniformRandom()
{
const size_t nSamples = 100000;
const size_t nBins = 50;
unsigned int histogram[nBins];
memset( histogram, 0, sizeof( histogram ) );
for ( size_t n = 0; n < nSamples; ++n )
{
++histogram[static_cast( nBins * cmtk::MathUtil::UniformRandom() )];
}
// allow +/- 5% deviation in each bin. This seems to be what Numerical Recipes can do.
const unsigned int lower = static_cast( 0.95 * nSamples / nBins );
const unsigned int upper = static_cast( 1.05 * nSamples / nBins );
unsigned int countOutside = 0;
for ( size_t n = 0; n < nBins; ++n )
{
if ( (histogram[n] < lower ) || (histogram[n] > upper ) )
++countOutside;
}
const unsigned int threshold = static_cast( 0.05 * nBins );
if ( countOutside > threshold )
{
std::cerr << "Too many bins outside +/- 5% range. Actual: " << countOutside << ", threshold: " << threshold << std::endl;
return 1;
}
return 0;
}
cmtk-3.0.0/testing/libs/Base/cmtkTypedArrayTests.txx 0000644 0001777 0000017 00000002203 11452717235 021526 0 ustar torsten man /*
//
// Copyright 2004-2010 SRI International
// Copyright 1997-2009 Torsten Rohlfing
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2398 $
//
// $LastChangedDate: 2010-10-05 14:54:37 -0700 (Tue, 05 Oct 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
#include
cmtk-3.0.0/testing/libs/Base/cmtkTypedArrayFunctionHistogramMatchingTests.txx 0000644 0001777 0000017 00000014660 11452717235 026577 0 ustar torsten man /*
//
// Copyright 2004-2010 SRI International
// Copyright 1997-2009 Torsten Rohlfing
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2398 $
//
// $LastChangedDate: 2010-10-05 14:54:37 -0700 (Tue, 05 Oct 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
#include
#include
// test "TypedArray::MatchHistogramToReference" function
int
testTypedArrayMatchHistogram1()
{
float data1[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3 };
cmtk::TypedArray::SmartPtr array1( cmtk::TypedArray::Create( cmtk::TYPE_FLOAT, data1, sizeof( data1 ) / sizeof( *data1 ), false /*freeArray*/ ) );
float data2[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3 };
cmtk::TypedArray::SmartPtr array2( cmtk::TypedArray::Create( cmtk::TYPE_FLOAT, data2, sizeof( data2 ) / sizeof( *data2 ), false /*freeArray*/ ) );
array2->ApplyFunctionObject( cmtk::TypedArrayFunctionHistogramMatching( *array2, *array1 ) );
float maxDeviation = 0;
for ( size_t i = 0; iGetDataSize(); ++i )
{
cmtk::Types::DataItem value;
array2->Get( value, i );
maxDeviation = std::max( maxDeviation, fabs(value-data1[i]) );
}
if ( maxDeviation > 0.01 )
return 1;
else
return 0;
}
// test "TypedArray::MatchHistogramToReference" function
int
testTypedArrayMatchHistogram2()
{
float data1[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3 };
cmtk::TypedArray::SmartPtr array1( cmtk::TypedArray::Create( cmtk::TYPE_FLOAT, data1, sizeof( data1 ) / sizeof( *data1 ), false /*freeArray*/ ) );
float data2[] = { 0.1, 0.1, 0.5, 0.5, 2.5, 2.5, 3.0, 3.0 };
float base2[] = { 0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 };
cmtk::TypedArray::SmartPtr array2( cmtk::TypedArray::Create( cmtk::TYPE_FLOAT, data2, sizeof( data2 ) / sizeof( *data2 ), false /*freeArray*/ ) );
array2->ApplyFunctionObject( cmtk::TypedArrayFunctionHistogramMatching( *array2, *array1 ) );
for ( size_t i = 0; iGetDataSize(); ++i )
{
cmtk::Types::DataItem value;
array2->Get( value, i );
}
float maxDeviation = 0;
for ( size_t i = 0; iGetDataSize(); ++i )
{
cmtk::Types::DataItem value;
array2->Get( value, i );
maxDeviation = std::max( maxDeviation, fabs(value-base2[i]) );
}
if ( maxDeviation > 0.01 )
return 1;
else
return 0;
}
// test histogram matching from existing histograms
int
testTypedArrayMatchHistogram3()
{
float data1[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3 };
cmtk::TypedArray::SmartPtr array1( cmtk::TypedArray::Create( cmtk::TYPE_FLOAT, data1, sizeof( data1 ) / sizeof( *data1 ), false /*freeArray*/ ) );
float data2[] = { 0.1, 0.1, 0.5, 0.5, 2.5, 2.5, 3.0, 3.0 };
cmtk::TypedArray::SmartPtr array2a( cmtk::TypedArray::Create( cmtk::TYPE_FLOAT, data2, sizeof( data2 ) / sizeof( *data2 ), false /*freeArray*/ ) );
cmtk::TypedArray::SmartPtr array2b( cmtk::TypedArray::Create( cmtk::TYPE_FLOAT, data2, sizeof( data2 ) / sizeof( *data2 ), false /*freeArray*/ ) );
array2a->ApplyFunctionObject( cmtk::TypedArrayFunctionHistogramMatching( *array2a, *array1 ) );
cmtk::TypedArrayFunctionHistogramMatching::HistogramType::SmartPtr hist1( array1->GetHistogram( cmtk::TypedArrayFunctionHistogramMatching::DefaultNumberOfHistogramBins ) );
cmtk::TypedArrayFunctionHistogramMatching::HistogramType::SmartPtr hist2b( array2b->GetHistogram( cmtk::TypedArrayFunctionHistogramMatching::DefaultNumberOfHistogramBins ) );
array2b->ApplyFunctionObject( cmtk::TypedArrayFunctionHistogramMatching( *hist2b, *hist1 ) );
float maxDeviation = 0;
for ( size_t i = 0; iGetDataSize(); ++i )
{
cmtk::Types::DataItem a, b;
array2a->Get( a, i );
array2b->Get( b, i );
maxDeviation = std::max( maxDeviation, fabs(a-b) );
}
if ( maxDeviation > 1e-8 )
return 1;
else
return 0;
}
// test whether histogram matching breaks with unequal numbers of bins for both histograms.
int
testTypedArrayMatchHistogram4()
{
float data1[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3 };
cmtk::TypedArray::SmartPtr array1a( cmtk::TypedArray::Create( cmtk::TYPE_FLOAT, data1, sizeof( data1 ) / sizeof( *data1 ), false /*freeArray*/ ) );
cmtk::TypedArray::SmartPtr array1b( cmtk::TypedArray::Create( cmtk::TYPE_FLOAT, data1, sizeof( data1 ) / sizeof( *data1 ), false /*freeArray*/ ) );
float data2[] = { 0.1, 0.1, 0.5, 0.5, 2.5, 2.5, 3.0, 3.0 };
cmtk::TypedArray::SmartPtr array2a( cmtk::TypedArray::Create( cmtk::TYPE_FLOAT, data2, sizeof( data2 ) / sizeof( *data2 ), false /*freeArray*/ ) );
cmtk::TypedArray::SmartPtr array2b( cmtk::TypedArray::Create( cmtk::TYPE_FLOAT, data2, sizeof( data2 ) / sizeof( *data2 ), false /*freeArray*/ ) );
cmtk::TypedArrayFunctionHistogramMatching::HistogramType::SmartPtr hist1a( array1a->GetHistogram( cmtk::TypedArrayFunctionHistogramMatching::DefaultNumberOfHistogramBins ) );
cmtk::TypedArrayFunctionHistogramMatching::HistogramType::SmartPtr hist2a( array2a->GetHistogram( cmtk::TypedArrayFunctionHistogramMatching::DefaultNumberOfHistogramBins / 2 ) );
array2a->ApplyFunctionObject( cmtk::TypedArrayFunctionHistogramMatching( *hist2a, *hist1a ) );
cmtk::TypedArrayFunctionHistogramMatching::HistogramType::SmartPtr hist1b( array1b->GetHistogram( cmtk::TypedArrayFunctionHistogramMatching::DefaultNumberOfHistogramBins / 2 ) );
cmtk::TypedArrayFunctionHistogramMatching::HistogramType::SmartPtr hist2b( array2b->GetHistogram( cmtk::TypedArrayFunctionHistogramMatching::DefaultNumberOfHistogramBins ) );
array2b->ApplyFunctionObject( cmtk::TypedArrayFunctionHistogramMatching( *hist2b, *hist1b ) );
// here, we're only testing for crashes, leaks, etc.
return 0;
}
cmtk-3.0.0/testing/libs/Base/cmtkRegionTests.txx 0000644 0001777 0000017 00000005077 11765704432 020703 0 ustar torsten man /*
//
// Copyright 2010, 2012 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 4427 $
//
// $LastChangedDate: 2012-06-12 11:23:22 -0700 (Tue, 12 Jun 2012) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
// test "Size" member function for int regions
int
testRegionSizeInt()
{
const int regionFromArray[] = { 1, 2, 3 };
const int regionToArray[] = { 2, 4, 7 };
const cmtk::Region<3,int> r3( (cmtk::FixedVector<3,int>::FromPointer( regionFromArray )), cmtk::FixedVector<3,int>::FromPointer( regionToArray ) );
if ( r3.Size() != 8 )
return 1;
const cmtk::Region<2,int> r2( (cmtk::FixedVector<2,int>::FromPointer( regionFromArray )), cmtk::FixedVector<2,int>::FromPointer( regionToArray ) );
if ( r2.Size() != 2 )
return 1;
const cmtk::Region<1,int> r1( (cmtk::FixedVector<1,int>::FromPointer( regionFromArray )), cmtk::FixedVector<1,int>::FromPointer( regionToArray ) );
if ( r1.Size() != 1 )
return 1;
return 0;
}
// test "Size" member function for float regions
int
testRegionSizeFloat()
{
const float regionFromArray[] = { 1, 2, 3 };
const float regionToArray[] = { 2, 4, 7 };
const cmtk::Region<3,float> r3( (cmtk::FixedVector<3,float>::FromPointer( regionFromArray )), cmtk::FixedVector<3,float>::FromPointer( regionToArray ) );
if ( r3.Size() != 8 )
return 1;
const cmtk::Region<2,float> r2( (cmtk::FixedVector<2,float>::FromPointer( regionFromArray )), cmtk::FixedVector<2,float>::FromPointer( regionToArray ) );
if ( r2.Size() != 2 )
return 1;
const cmtk::Region<1,float> r1( (cmtk::FixedVector<1,float>::FromPointer( regionFromArray )), cmtk::FixedVector<1,float>::FromPointer( regionToArray ) );
if ( r1.Size() != 1 )
return 1;
return 0;
}
cmtk-3.0.0/testing/libs/Base/libBaseTests.cxx 0000644 0001777 0000017 00000006077 12024721403 020104 0 ustar torsten man /*
//
// Copyright 2004-2012 SRI International
//
// Copyright 1997-2009 Torsten Rohlfing
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 4510 $
//
// $LastChangedDate: 2012-09-14 14:34:59 -0700 (Fri, 14 Sep 2012) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include "cmtkDataGridTests.txx"
#include "cmtkEigenSystemSymmetricMatrix3x3Tests.txx"
#include "cmtkMathUtilTests.txx"
#include "cmtkParametricPlaneTests.txx"
#include "cmtkRegionTests.txx"
#include "cmtkScalarImageTests.txx"
#include "cmtkSplineWarpXformTests.txx"
#include "cmtkSymmetricMatrixTests.txx"
#include "cmtkTypedArrayFunctionHistogramMatchingTests.txx"
#include "cmtkUniformVolumeTests.txx"
int
main( const int argc, const char* argv[] )
{
cmtk::TestFunctionMap map;
map.AddTest( "DataGridMatches", &testDataGridMatches );
map.AddTest( "EigenSystemSymmetricMatrix3x3", &testEigenSystemSymmetricMatrix3x3 );
map.AddTest( "MathUtilUniformRandom", &testMathUtilUniformRandom );
map.AddTest( "ParametricPlaneMirror", &testParametricPlaneMirror );
map.AddTest( "ParametricPlaneMirrorOffset", &testParametricPlaneMirrorOffset );
map.AddTest( "RegionSizeInt", &testRegionSizeInt );
map.AddTest( "RegionSizeFloat", &testRegionSizeFloat );
map.AddTest( "ScalarImage", &testScalarImage );
map.AddTest( "SplineWarpXform", &testSplineWarpXform );
map.AddTest( "SplineWarpXformInverse", &testSplineWarpXformInverse );
map.AddTest( "SymmetricMatrix", &testSymmetricMatrix );
map.AddTest( "SymmetricMatrixResize", &testSymmetricMatrixResize );
map.AddTest( "SymmetricMatrixEqual", &testSymmetricMatrixEqual );
map.AddTest( "TypedArrayMatchHistogram1", &testTypedArrayMatchHistogram1 );
map.AddTest( "TypedArrayMatchHistogram2", &testTypedArrayMatchHistogram2 );
map.AddTest( "TypedArrayMatchHistogram3", &testTypedArrayMatchHistogram3 );
map.AddTest( "TypedArrayMatchHistogram4", &testTypedArrayMatchHistogram4 );
map.AddTest( "UniformVolumeMatches", &testUniformVolumeMatches );
// is test name given on command line?
if ( argc < 2 )
{
}
else
{
return map.RunTestByName( argv[1] );
}
}
cmtk-3.0.0/testing/libs/Base/cmtkSymmetricMatrixTests.txx 0000644 0001777 0000017 00000006124 11551654734 022615 0 ustar torsten man /*
//
// Copyright 2010-2011 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 3142 $
//
// $LastChangedDate: 2011-04-14 13:32:28 -0700 (Thu, 14 Apr 2011) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
// test symmetric behaviour
int
testSymmetricMatrix()
{
cmtk::SymmetricMatrix m( 2 );
m(0,0) = -1;
m(1,1) = -2;
if ( m(0,0) != -1 )
{
cmtk::StdErr << "testSymmetricMatrix test failed at label A\n";
return 1;
}
if ( m(1,1) != -2 )
{
cmtk::StdErr << "testSymmetricMatrix test failed at label B\n";
return 1;
}
m(0,1) = 0;
m(1,0) = 1;
if ( m(0,1) != 1 )
{
cmtk::StdErr << "testSymmetricMatrix test failed at label C\n";
return 1;
}
m(0,1) = 2;
if ( m(1,0) != 2 )
{
cmtk::StdErr << "testSymmetricMatrix test failed at label D\n";
return 1;
}
if ( m(0,0) != -1 )
{
cmtk::StdErr << "testSymmetricMatrix test failed at label E\n";
return 1;
}
if ( m(1,1) != -2 )
{
cmtk::StdErr << "testSymmetricMatrix test failed at label F\n";
return 1;
}
return 0;
}
// test resize functionality
int
testSymmetricMatrixResize()
{
cmtk::SymmetricMatrix m( 1 );
m(0,0) = 1;
m.Resize( 2 );
m(0,1) = 2;
m(1,1) = 3;
if ( m(0,0) != 1 )
{
cmtk::StdErr << "testSymmetricMatrixResize failed at label A\n";
return 1;
}
if ( m(1,0) != 2 )
{
cmtk::StdErr << "testSymmetricMatrixResize failed at label B\n";
return 1;
}
if ( m(1,1) != 3 )
{
cmtk::StdErr << "testSymmetricMatrixResize failed at label C\n";
return 1;
}
m.Resize( 1 );
if ( m(0,0) != 1 )
{
cmtk::StdErr << "testSymmetricMatrixResize failed at label D\n";
return 1;
}
return 0;
}
// test equality/inequality operators
int
testSymmetricMatrixEqual()
{
cmtk::SymmetricMatrix m1( 1 );
cmtk::SymmetricMatrix m2( 2 );
if ( m1 == m2 )
{
cmtk::StdErr << "testSymmetricMatrixEqual failed at label A\n";
return 1;
}
m1.Resize( 2 );
m1(0,0) = m2(0,0) = 1;
m1(1,0) = m2(1,0) = 2;
m1(1,1) = m2(1,1) = 3;
if ( m1 != m2 )
{
cmtk::StdErr << "testSymmetricMatrixEqual failed at label B\n";
return 1;
}
return 0;
}
cmtk-3.0.0/testing/libs/Base/cmtkSplineWarpXformTests.txx 0000644 0001777 0000017 00000033375 11765704432 022562 0 ustar torsten man /*
//
// Copyright 1997-2009 Torsten Rohlfing
//
// Copyright 2004-2012 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 4427 $
//
// $LastChangedDate: 2012-06-12 11:23:22 -0700 (Tue, 12 Jun 2012) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
#include
#include
int
testSplineWarpXform()
{
return 0;
}
int
testSplineWarpXformInverse()
{
// parameters for the current WarpSingleLevel baseline transformation
const cmtk::Types::Coordinate domain[3] = { 357.1875, 357.1875, 125 };
const int dims[3] = { 7, 7, 4 };
const size_t nparameters = 3 * 7 * 7 * 4;
cmtk::Types::Coordinate parameters[nparameters] =
{ -88.706249, -84.998951480000002, -133.41214640000001, 0.58282801900000003, -85.552844629999996, -132.6599301,
89.312814939999996, -86.301460410000004, -132.5876548, 177.77193539999999, -85.646700699999997, -133.84530789999999,
266.44951250000003, -79.496837150000005, -133.9639134, 355.83432440000001, -82.938156820000003, -133.6333545,
444.48369489999999, -85.145062800000005, -134.2765378, -87.318911839999998, 3.4110965480000002, -132.63593660000001,
2.617442912, -0.38841385519999999, -127.8795088, 90.052308600000003, -4.7583292430000004, -131.88906729999999,
179.2010363, 0.1205040694, -133.54224679999999, 264.80709460000003, 12.066754080000001, -130.28005279999999,
357.41610070000002, 7.3845064359999997, -127.76716690000001, 445.47999440000001, 3.1919038909999999, -132.9684795,
-83.704470520000001, 92.192599630000004, -132.28900619999999, 4.9322056060000001, 90.245003139999994,
-128.26304400000001, 87.099999409999995, 74.254342940000001, -135.77073709999999, 170.00687600000001,
88.896090749999999, -155.3283208, 273.92401669999998, 93.242624550000002, -140.88084140000001, 361.17963400000002,
89.683891509999995, -130.97434670000001, 445.75771220000001, 91.876312139999996, -133.26873420000001,
-81.061337280000004, 181.6535792, -133.0931166, 1.0531317360000001, 188.02919120000001, -137.56335189999999,
89.184044760000006, 178.8696482, -159.36757170000001, 174.015658, 183.60500909999999, -151.0189499, 267.2078841,
179.12156770000001, -144.6624151, 359.74886040000001, 176.8779567, -137.3049566, 444.22113439999998,
180.80086940000001, -133.6307272, -83.727375629999997, 267.29410710000002, -133.48054730000001, 1.7494822249999999,
266.0169631, -132.43946500000001, 99.806269929999999, 267.21390309999998, -150.58490649999999, 177.13017690000001,
262.75285589999999, -147.6204467, 260.4250389, 252.11927119999999, -145.32091500000001, 359.6639907, 257.1055576,
-136.3139481, 445.63570859999999, 268.85830870000001, -133.20231140000001, -87.196138289999993, 356.09219039999999,
-131.7662282, 5.5288343080000004, 348.41581830000001, -127.61307909999999, 93.661780930000006, 350.04663319999997,
-134.64285319999999, 179.84697249999999, 356.04154419999998, -138.72237849999999, 263.79976570000002,
351.84695269999997, -134.74277140000001, 354.08110850000003, 354.72597280000002, -127.8249725, 446.35394769999999,
356.2593943, -132.68096320000001, -88.868390099999999, 445.57343600000002, -132.74548110000001, 0.13575482220000001,
444.76912679999998, -131.80384480000001, 88.728966940000007, 444.62619749999999, -132.15681269999999,
177.92944069999999, 446.30323390000001, -133.03929260000001, 266.35346240000001, 444.6431498, -132.9607939,
355.45975850000002, 445.66228130000002, -133.26875509999999, 444.53735660000001, 445.56110649999999,
-133.65817060000001, -87.595741469999993, -85.615120719999993, -5.958190739, 0.44238839149999998, -98.505404619999993,
-2.2983611289999999, 91.516483010000002, -100.0147607, -5.1136814890000002, 181.5319556, -104.2308865,
-5.8053919389999997, 268.33913130000002, -88.234155250000001, -6.6261121190000001, 357.53476169999999,
-84.906273350000006, -3.6736957480000001, 445.84451159999998, -85.767281420000003, -6.19765224, -84.004465359999998,
1.1194690920000001, -2.3237842579999999, 7.0343907919999999, 2.887315584, 9.3485539650000007, 85.201014270000002,
3.2166232570000002, -2.638737415, 185.81284930000001, 3.2168928389999998, -5.0315402049999998, 263.85491830000001,
-5.885358095, -1.5863716800000001, 355.65862499999997, -0.22509619959999999, 9.7554431780000002, 446.56552870000002,
0.91509386459999997, -1.77461844, -76.155025309999999, 91.465387050000004, -4.5014921750000001, -0.025622953949999999,
91.082948139999999, 36.132634940000003, 88.895439049999993, 91.715001909999998, 5.5567657759999998,
175.59212350000001, 91.715271490000006, -19.827600650000001, 267.31410360000001, 91.71554107, -18.57972865,
355.65862499999997, 92.067915659999997, 15.83988965, 447.8203795, 94.976408219999996, -1.8117929740000001,
-89.183814949999999, 182.31435640000001, -0.18152812469999999, -0.025622953949999999, 180.213111, 29.576301829999998,
88.895439049999993, 180.21338059999999, -50.387582109999997, 177.81650099999999, 187.63108, -6.3127768949999998,
266.73756300000002, 188.21391969999999, -39.724707619999997, 355.65862499999997, 194.76894530000001,
12.719229840000001, 448.49040489999999, 180.30507940000001, 6.4192943600000003, -86.124877290000001,
266.36517220000002, 0.81955630999999995, -0.025622953949999999, 268.71148959999999, 6.6378779159999999,
88.895439049999993, 268.71175920000002, -8.5170915610000009, 177.81650099999999, 268.71202879999998,
-40.255468520000001, 266.73756300000002, 268.71229840000001, -11.29851287, 355.65862499999997, 268.71256799999998,
12.631458200000001, 455.28980799999999, 262.68077749999998, 3.5113257330000001, -83.442058020000005,
352.86904729999998, -1.6556360590000001, -0.025622953949999999, 357.20986829999998, 18.933949649999999,
92.201104720000004, 357.21013790000001, -5.9082610569999998, 185.02496339999999, 357.21040749999997,
-38.860956639999998, 265.44028609999998, 357.21067699999998, -14.704373049999999, 355.65862499999997, 357.2109466,
9.0930626809999993, 444.68610519999999, 356.86132309999999, -1.78315417, -87.485908379999998, 444.2545389,
-4.8936582450000001, 3.2569376710000002, 444.43092489999998, 0.096468254239999995, 91.317244149999993,
442.34335479999999, -6.8668513320000004, 174.63876999999999, 450.46435989999998, -5.3950795060000001,
265.36603500000001, 445.70905570000002, -3.9132990560000001, 354.38166330000001, 445.87286769999997,
-4.1942974719999997, 445.27059109999999, 444.60602310000002, -6.1777497380000002, -87.057384740000003,
11 -86.151767390000003, 121.0374534, 1.7057175179999999, -96.19556394, 122.554754, 89.579146320000007, -104.5236975,
118.37620750000001, 179.89012020000001, -104.9898585, 117.0390142, 267.55622369999998, -91.202323030000002,
116.7009912, 355.50636229999998, -91.482698450000001, 121.1113952, 445.60660159999998, -86.026599090000005,
120.60045580000001, -84.171902759999995, -0.01482944089, 121.7216818, 7.2181945880000002, 3.0001385580000002,
107.25279829999999, 80.852307519999997, 3.0004081390000001, 107.9820965, 176.8311132, 3.0006777210000002, 120.5239799,
263.74011230000002, 3.0009473029999998, 120.63115879999999, 355.37072819999997, 3.0012168840000002,
104.91928830000001, 446.56621439999998, -2.4291254979999999, 119.3823773, -81.5035065, 90.071761339999995,
120.84644969999999, 0.20142214319999999, 90.574182809999996, 113.35627599999999, 89.122484139999997,
91.498786789999997, 128.82387059999999, 175.58544979999999, 101.4990564, 122.9002965, 268.38340210000001,
91.499325959999993, 120.5156942, 355.88567010000003, 91.499595540000001, 131.39708440000001, 444.7709438,
96.842661910000004, 119.9692496, -89.055928379999997, 182.5025977, 120.1122323, 0.20142214319999999, 179.9968959,
122.4469038, 89.122484139999997, 179.9971654, 122.601725, 178.04354609999999, 179.997435, 126.95405100000001,
266.96460810000002, 179.99770459999999, 109.6421946, 355.88567010000003, 180.75639219999999, 121.4688462,
447.20440389999999, 185.2565166, 129.8153983, -89.080491530000003, 271.57375159999998, 118.9826401,
0.20142214319999999, 268.49527449999999, 133.51210159999999, 89.122484139999997, 268.49554410000002, 123.2495995,
178.04354609999999, 268.49581369999999, 156.55418539999999, 266.96460810000002, 268.49608330000001, 126.9632696,
355.88567010000003, 268.49635280000001, 125.8377127, 456.11810259999999, 263.93876160000002, 124.1798611,
-78.757516609999996, 354.1474331, 118.3106315, 0.20142214319999999, 356.99365319999998, 106.9986686,
80.916068390000007, 356.99392280000001, 122.5179942, 183.90640450000001, 356.99419230000001, 139.70791149999999,
274.36699199999998, 356.99446189999998, 128.8031953, 355.88567010000003, 356.9947315, 113.7361619, 431.15941249999997,
357.78121429999999, 120.79886980000001, -87.137463229999994, 444.211366, 121.661636, 3.032267085, 442.4181438,
122.02193889999999, 90.122988419999999, 447.11456579999998, 119.2880096, 171.88924359999999, 443.27612269999997,
126.6859994, 266.08858839999999, 445.49284060000002, 123.3604062, 354.6575727, 447.03908790000003, 121.0512234,
444.93700189999998, 444.38999630000001, 120.7991143, -88.437080820000006, -85.679078360000005, 248.01994110000001,
0.90716082620000005, -87.579235199999999, 247.72265619999999, 90.422524789999997, -89.779116000000002,
247.09381070000001, 177.9337969, -99.358937710000006, 246.43002150000001, 268.200943, -91.2776566, 246.78031390000001,
356.61125870000001, -87.247415489999995, 247.33492340000001, 445.13719680000003, -85.752559039999994,
247.14701299999999, -88.667440450000001, 2.378526865, 248.15868649999999, 2.8663826349999999, -1.1642714359999999,
247.05720909999999, 89.347263699999999, -9.1457145759999996, 242.8314393, 174.87415490000001, -9.2338554550000005,
240.81855210000001, 271.94218269999999, -10.368706850000001, 243.2065522, 357.89138079999998, -12.21101354,
243.7249606, 445.92261459999997, 1.966463385, 247.059834, -88.912398969999998, 91.495463610000002, 248.26963259999999,
2.7270593399999998, 91.117068270000004, 244.86417639999999, 82.594282609999993, 92.770709539999999,
245.50448940000001, 178.86315379999999, 126.0907351, 229.5875126, 276.54213440000001, 100.338989, 241.38238050000001,
357.5755231, 92.732282940000005, 243.25368760000001, 448.57513119999999, 91.815159890000004, 244.83041610000001,
-90.320214309999997, 180.10600199999999, 246.54689540000001, 3.6745516139999999, 186.6898391, 241.52917769999999,
89.349529239999995, 179.11642739999999, 239.24101239999999, 173.81978810000001, 162.44730430000001,
250.41458320000001, 265.41958579999999, 180.45522170000001, 247.98236069999999, 353.23377349999998,
192.21066049999999, 251.7287273, 445.66010940000001, 181.26521289999999, 246.71072000000001, -86.986800479999999,
269.28480500000001, 244.58283109999999, 0.51393186719999995, 268.80303909999998, 236.98863900000001, 89.621769709999995,
266.26399020000002, 238.93264049999999, 179.266944, 238.34859410000001, 265.1629236, 269.35367380000002, 256.8740277,
257.8996176, 361.80705540000002, 263.43252030000002, 246.61417800000001, 436.91912619999999, 269.42811289999997,
247.08582329999999, -87.15915038, 359.0044408, 247.66274319999999, -0.82839372629999997, 360.31312320000001,
241.9673334, 92.841495690000002, 355.37873960000002, 250.24562259999999, 175.9934432, 348.99376549999999,
257.76013139999998, 266.66541599999999, 356.44961849999999, 252.0638975, 353.65442949999999, 358.05145049999999,
245.86233609999999, 442.59605629999999, 357.38704439999998, 247.363855, -88.558712749999998, 445.28969480000001,
248.99420019999999, 0.055054464290000001, 448.6656423, 248.6825187, 89.390803320000003, 450.3772573,
249.60217069999999, 177.06173150000001, 446.93556389999998, 250.2954866, 266.63590900000003, 444.83473020000002,
249.33391330000001, 355.91280690000002, 445.81271129999999, 248.44589859999999, 444.89687249999997, 445.23544709999999 };
cmtk::CoordinateVector::SmartPtr vParameters( new cmtk::CoordinateVector( sizeof( nparameters ), parameters, false /*free*/ ) );
cmtk::SplineWarpXform splineWarp( cmtk::FixedVector<3,cmtk::Types::Coordinate>::FromPointer( domain ), cmtk::SplineWarpXform::ControlPointIndexType::FromPointer( dims ), vParameters );
int failed = 0, total = 0;
#pragma omp parallel for reduction(+:failed) reduction(+:total)
for ( int k = 0; k < (int)domain[2]; k += 4 )
{
cmtk::Xform::SpaceVectorType v, vX, u;
v[2] = k;
for ( int j = 0; j < (int)domain[1]; j += 8 )
{
v[1] = j;
for ( int i = 0; i < (int)domain[0]; i += 8 )
{
v[0] = i;
++total;
vX = splineWarp.Apply( v );
const bool success = splineWarp.ApplyInverse( vX, u, 0.1 /*accuracy*/ );
if ( ! success )
{
++failed;
}
}
}
}
std::cerr << "Inversion failed for " << failed << " out of " << total << " points." << std::endl;
return failed != 0;
}
cmtk-3.0.0/testing/libs/Base/cmtkDataGridTests.txx 0000644 0001777 0000017 00000003277 11765704432 021137 0 ustar torsten man /*
//
// Copyright 2004-2010 SRI International
// Copyright 1997-2009 Torsten Rohlfing
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 4427 $
//
// $LastChangedDate: 2012-06-12 11:23:22 -0700 (Tue, 12 Jun 2012) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
// test "GridMatches" function
int
testDataGridMatches()
{
const int dims1_array[3] = { 10, 11, 12 };
cmtk::DataGrid::IndexType dims1 = cmtk::DataGrid::IndexType::FromPointer( dims1_array );
const int dims2_array[3] = { 11, 12, 10 };
cmtk::DataGrid::IndexType dims2 = cmtk::DataGrid::IndexType::FromPointer( dims2_array );
cmtk::DataGrid grid1a( dims1 );
cmtk::DataGrid grid1b( dims1 );
cmtk::DataGrid grid2( dims2 );
if ( !grid1a.GridMatches( grid1b ) )
return 1;
if ( !grid1b.GridMatches( grid1a ) )
return 1;
if ( grid1a.GridMatches( grid2 ) )
return 1;
return 0;
}
cmtk-3.0.0/testing/libs/Base/cmtkEigenSystemSymmetricMatrix3x3Tests.txx 0000644 0001777 0000017 00000005515 11452717235 025327 0 ustar torsten man /*
//
// Copyright 1997-2009 Torsten Rohlfing
//
// Copyright 2004-2010 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2398 $
//
// $LastChangedDate: 2010-10-05 14:54:37 -0700 (Tue, 05 Oct 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
#include
#include
template
bool
testMatrixEigensystem
( const T m[3][3], const T evals[3], const T evecs[3][3] )
{
const T tolerance = 1e-6;
cmtk::Matrix3x3 matrix( &m[0][0] );
cmtk::EigenSystemSymmetricMatrix3x3 es( matrix );
// compare eigenvalues
for ( size_t i = 0; i<3; ++i )
{
if ( fabs( evals[i] - es.GetNthEigenvalue(i) ) > tolerance )
{
std::cerr << "Eigenvalues do not match." << std::endl
<< " ACTUAL: " << es.GetNthEigenvalue(0) << " " << es.GetNthEigenvalue(1) << " " << es.GetNthEigenvalue(2) << std::endl
<< " BASELN: " << evals[0] << " " << evals[1] << " " << evals[2] << std::endl;
return false;
}
}
// compare eigenvectors
for ( size_t i = 0; i<3; ++i )
{
const cmtk::FixedVector<3,T> actual = es.GetNthEigenvector( i );
for ( size_t j = 0; j<3; ++j )
{
if ( fabs( evecs[i][j] - actual[j] ) > tolerance )
{
std::cerr << "Eigenvectors do not match." << std::endl;
for ( size_t ii = 0; ii<3; ++ii )
{
const cmtk::FixedVector<3,T> ev = es.GetNthEigenvector( ii );
std::cerr << " ACTUAL: " << ev[0] << " " << ev[1] << " " << ev[2] << std::endl;
std::cerr << " BASELN: " << evecs[ii][0] << " " << evecs[ii][1] << " " << evecs[ii][2] << " " << std::endl;
}
return false;
}
}
}
return true;
}
// test eigenvalues computation
int
testEigenSystemSymmetricMatrix3x3()
{
const double dm1[3][3] = { { 1, 0, 0 }, { 0, -2, 0 }, { 0, 0, 3 } };
const double evals1[3] = { 1, -2, 3 };
const double evecs1[3][3] = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } };
if ( ! testMatrixEigensystem( dm1, evals1, evecs1 ) )
{
return 1;
}
return 0;
}
cmtk-3.0.0/testing/libs/IO/ 0000755 0001777 0000017 00000000000 12263615446 014435 5 ustar torsten man cmtk-3.0.0/testing/libs/IO/CMakeLists.txt 0000644 0001777 0000017 00000003402 11763211566 017173 0 ustar torsten man ##
## Copyright 1997-2010 Torsten Rohlfing
##
## Copyright 2004-2012 SRI International
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 4412 $
##
## $LastChangedDate: 2012-06-04 12:58:46 -0700 (Mon, 04 Jun 2012) $
##
## $LastChangedBy: torstenrohlfing $
##
# ==========================================
# Setup binary test drivers
SET(CMTK_LIBRARIES "cmtkIO;cmtkBase;cmtkNumerics;cmtkSystem")
SET(DRIVERS "")
IF(CMTK_USE_SQLITE)
LIST(APPEND DRIVERS libIOTestsSQLite)
ENDIF(CMTK_USE_SQLITE)
FOREACH(D ${DRIVERS})
ADD_EXECUTABLE(${D} ${D}.cxx)
TARGET_LINK_LIBRARIES(${D} ${CMTK_LIBRARIES} ${CMTK_SYSTEM_LIBRARIES})
ENDFOREACH(D ${DRIVERS})
# ==========================================
# Tests for "cmtk::SQLite" class
IF(CMTK_USE_SQLITE)
SET(Tests
SQLiteNew
SQLiteOpen
SQLiteCreateAndInsert
SQLiteQuery
)
FOREACH(T ${Tests})
ADD_TEST(${T} ${EXECUTABLE_OUTPUT_PATH}/libIOTestsSQLite ${T})
ENDFOREACH(T Tests)
ENDIF(CMTK_USE_SQLITE)
cmtk-3.0.0/testing/libs/IO/cmtkSQLiteTests.txx 0000644 0001777 0000017 00000003654 11452717235 020253 0 ustar torsten man /*
//
// Copyright 2004-2010 SRI International
//
// Copyright 1997-2009 Torsten Rohlfing
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2398 $
//
// $LastChangedDate: 2010-10-05 14:54:37 -0700 (Tue, 05 Oct 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
// test SQLite database creation
int
testSQLiteNew()
{
cmtk::SQLite db( ":memory:" );
return 0;
}
// test SQLite open of existing file
int
testSQLiteOpen()
{
cmtk::SQLite db( CMTK_DATADIR "/empty.sqlite", true /*readOnly*/ );
return 0;
}
// test SQLite table creation and data insertion
int
testSQLiteCreateAndInsert()
{
cmtk::SQLite db( ":memory:" );
db.Exec( "create table testing ( id integer primary key, data text )" );
db.Exec( "insert into testing values ( NULL, 'test1')" );
db.Exec( "insert into testing values ( 2, 'test2')" );
db.Exec( "insert into testing values ( NULL, 'test3')" );
return 0;
}
// test SQLite database query
int
testSQLiteQuery()
{
cmtk::SQLite db( CMTK_DATADIR "/testDB.sqlite", true /*readOnly*/ );
cmtk::SQLite::TableType table;
db.Query( "select * from testing", table );
return 0;
}
cmtk-3.0.0/testing/libs/IO/libIOTestsSQLite.cxx 0000644 0001777 0000017 00000004607 11434566214 020270 0 ustar torsten man /*
//
// Copyright 2004-2010 SRI International
//
// Copyright 1997-2009 Torsten Rohlfing
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 2280 $
//
// $LastChangedDate: 2010-08-23 14:47:56 -0700 (Mon, 23 Aug 2010) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
#include "cmtkSQLiteTests.txx"
/** Set up table of test names and function pointers */
typedef int (*testFuncPtr)();
typedef
struct __testNameAndFunctionPointer
{
const char* name;
const testFuncPtr func;
} testNameAndFunctionPointer;
const testNameAndFunctionPointer testTable[] =
{
{ "SQLiteNew", &testSQLiteNew },
{ "SQLiteOpen", &testSQLiteOpen },
{ "SQLiteCreateAndInsert", &testSQLiteCreateAndInsert },
{ "SQLiteQuery", &testSQLiteQuery },
{ NULL, NULL }
};
int
main( const int argc, const char* argv[] )
{
int testNumber = -1;
// is test name given on command line?
if ( argc < 2 )
{
// no: ask user in dialog mode
for ( size_t i = 0; testTable[i].name; ++i )
{
std::cout << i << ". " << testTable[i].name << std::endl;
}
std::cout << "Run test number: ";
std::cin >> testNumber;
}
else
{
// batch mode: find test by name given on command line
for ( size_t i = 0; testTable[i].name; ++i )
{
if ( !strcmp( argv[1], testTable[i].name ) )
testNumber = i;
}
}
// run test, or return error if none found
if ( testNumber < 0 )
{
std::cerr << "Test " << argv[1] << " not found!" << std::endl;
return 2;
}
else
return testTable[testNumber].func();
}
cmtk-3.0.0/testing/libs/System/ 0000755 0001777 0000017 00000000000 12263615446 015412 5 ustar torsten man cmtk-3.0.0/testing/libs/System/CMakeLists.txt 0000644 0001777 0000017 00000003175 11730722076 020154 0 ustar torsten man ##
## Copyright 1997-2009 Torsten Rohlfing
##
## Copyright 2004-2012 SRI International
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 4039 $
##
## $LastChangedDate: 2012-03-16 13:36:14 -0700 (Fri, 16 Mar 2012) $
##
## $LastChangedBy: torstenrohlfing $
##
# ==========================================
# Setup binary test drivers
SET(CMTK_LIBRARIES "cmtkSystem")
SET(DRIVERS libSystemTests)
FOREACH(D ${DRIVERS})
ADD_EXECUTABLE(${D} ${D}.cxx)
TARGET_LINK_LIBRARIES(${D} ${CMTK_LIBRARIES})
ENDFOREACH(D ${DRIVERS})
# ==========================================
# Tests for "StackBacktrace" class
SET(Tests StackBacktrace)
# ==========================================
# Tests for "StrUtility" functions
LIST(APPEND Tests StrNStr)
FOREACH(T ${Tests})
ADD_TEST(${T} ${EXECUTABLE_OUTPUT_PATH}/libSystemTests ${T})
ENDFOREACH(T Tests)
cmtk-3.0.0/testing/libs/System/testStackBacktrace.txx 0000644 0001777 0000017 00000002612 11730722076 021721 0 ustar torsten man /*
//
// Copyright 1997-2009 Torsten Rohlfing
//
// Copyright 2004-2011 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 4039 $
//
// $LastChangedDate: 2012-03-16 13:36:14 -0700 (Fri, 16 Mar 2012) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
namespace cmtk { static StackBacktrace StackBacktraceInstance; }
// deliberately crash to test stack trace output
int
testStackBacktrace()
{
cmtk::StackBacktrace::SetExitCode( 0 );
char* nullPtr = NULL;
(*nullPtr) = 0;
// if we didn't catch a SEGFAULT, the test failed
return 1;
}
cmtk-3.0.0/testing/libs/System/testStrNStr.txx 0000644 0001777 0000017 00000005051 11730722076 020433 0 ustar torsten man /*
//
// Copyright 1997-2009 Torsten Rohlfing
//
// Copyright 2004-2011 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 4039 $
//
// $LastChangedDate: 2012-03-16 13:36:14 -0700 (Fri, 16 Mar 2012) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
int
testStrNStr()
{
const char* needle = "needle";
const char* haystack1 = "this is the needle";
// make sure we find needle
if ( cmtk::StrNStr( haystack1, strlen( haystack1 ), needle ) == NULL )
{
cmtk::StdErr << "StrNStr test #1 failed\n";
return 1;
}
// make sure we stop looking after nBytes needle
if ( cmtk::StrNStr( haystack1, strlen( haystack1 ) - 1, needle ) != NULL )
{
cmtk::StdErr << "StrNStr test #2 failed\n";
return 1;
}
// make sure we find only needle
const char* haystack2 = "this is not the Needle";
if ( cmtk::StrNStr( haystack2, strlen( haystack2 ), needle ) != NULL )
{
cmtk::StdErr << "StrNStr test #3 failed\n";
return 1;
}
// make sure we find only needle
const char* haystack3 = "this is not the needl either";
if ( cmtk::StrNStr( haystack3, strlen( haystack3 ), needle ) != NULL )
{
cmtk::StdErr << "StrNStr test #4 failed\n";
return 1;
}
// make sure we find only needle
const char haystack4[] = "first put \x00 then put needle";
if ( cmtk::StrNStr( haystack4, sizeof( haystack4 ), needle ) == NULL )
{
cmtk::StdErr << "StrNStr test #5 failed\n";
return 1;
}
// make sure we can find prefixes
const char* haystack5 = "needle first";
if ( cmtk::StrNStr( haystack5, strlen( haystack5 ), needle ) == NULL )
{
cmtk::StdErr << "StrNStr test #6 failed\n";
return 1;
}
return 0;
}
cmtk-3.0.0/testing/libs/System/libSystemTests.cxx 0000644 0001777 0000017 00000004325 11730722076 021134 0 ustar torsten man /*
//
// Copyright 1997-2009 Torsten Rohlfing
//
// Copyright 2004-2011 SRI International
//
// This file is part of the Computational Morphometry Toolkit.
//
// http://www.nitrc.org/projects/cmtk/
//
// The Computational Morphometry Toolkit is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Computational Morphometry Toolkit is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with the Computational Morphometry Toolkit. If not, see
// .
//
// $Revision: 4039 $
//
// $LastChangedDate: 2012-03-16 13:36:14 -0700 (Fri, 16 Mar 2012) $
//
// $LastChangedBy: torstenrohlfing $
//
*/
#include
#include
#include
#include "testStackBacktrace.txx"
#include "testStrNStr.txx"
/** Set up table of test names and function pointers */
typedef int (*testFuncPtr)();
typedef struct
{
const char* name;
const testFuncPtr func;
} testNameAndFunctionPointer;
const testNameAndFunctionPointer testTable[] =
{
{ "StackBacktrace", &testStackBacktrace },
{ "StrNStr", &testStrNStr },
{ NULL, NULL }
};
int
main( const int argc, const char* argv[] )
{
int testNumber = -1;
// is test name given on command line?
if ( argc < 2 )
{
// no: ask user in dialog mode
for ( size_t i = 0; testTable[i].name; ++i )
{
std::cout << i << ". " << testTable[i].name << std::endl;
}
std::cout << "Run test number: ";
std::cin >> testNumber;
}
else
{
// batch mode: find test by name given on command line
for ( size_t i = 0; testTable[i].name; ++i )
{
if ( !strcmp( argv[1], testTable[i].name ) )
testNumber = i;
}
}
// run test, or return error if none found
if ( testNumber < 0 )
return 2;
else
return testTable[testNumber].func();
}
cmtk-3.0.0/testing/gui/ 0000755 0001777 0000017 00000000000 12263615446 013761 5 ustar torsten man cmtk-3.0.0/testing/gui/testDriverFunctions.sh 0000644 0001777 0000017 00000003414 11213300741 020322 0 ustar torsten man #!/bin/sh
##
## Copyright 1997-2009 Torsten Rohlfing
## Copyright 2004-2009 SRI International
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 41 $
##
## $LastChangedDate: 2009-06-08 14:25:53 -0700 (Mon, 08 Jun 2009) $
##
## $LastChangedBy: torstenrohlfing $
##
BUILDNAME=$1
BINDIR=$2
DATADIR=$3
RUNTEST=$4
HOSTNAME=`uname -n`
tmpdir=${BINDIR}/../testing/temporary/${HOSTNAME}/${RUNTEST}
mkdir -p ${tmpdir}
BASELINE=${DATADIR}/testing/baseline/${RUNTEST}
if [ -d ${DATADIR}/testing/baseline/${BUILDNAME}/${RUNTEST} ]; then
BASELINE=${DATADIR}/testing/${BUILDNAME}/${RUNTEST}
fi
cd ${DATADIR}/testing/inputs
run()
{
local cmd=$*
if ! $cmd; then
exit 1
fi
}
get_unzipped()
{
if [ -e ${1}.gz ]; then
local tmp=`mktemp`
gzip -cd ${1}.gz > ${tmp}
echo ${tmp}
else
echo ${1}
fi
}
check_result()
{
local result=`get_unzipped $1`
local baseline=`get_unzipped $2`
echo "diff $1 $2"
if ! diff $result $baseline; then
exit 1
fi
}
cmtk-3.0.0/testing/gui/CMakeLists.txt 0000644 0001777 0000017 00000004151 11313020114 016473 0 ustar torsten man ##
## Copyright 1997-2009 Torsten Rohlfing
## Copyright 2004-2009 SRI International
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 1076 $
##
## $LastChangedDate: 2009-12-18 16:37:32 -0800 (Fri, 18 Dec 2009) $
##
## $LastChangedBy: torstenrohlfing $
##
# ==========================================
# Tests for "triplanar" gui application
# (batch mode)
SET(testDriver ${CMAKE_CURRENT_BINARY_DIR}/triplanarTestDriver.sh)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/triplanarTestDriver.sh.in ${CMAKE_CURRENT_BINARY_DIR}/triplanarTestDriver.sh @ONLY)
SET(testList triplanarDefault
triplanarZoom300
triplanarZoom25
triplanarSetPixelWindowLevel
triplanarColormaps
triplanarPhantomAx
triplanarPhantomSa
triplanarPhantomCo)
IF(IGS_BUILD_NRRD OR IGS_USE_TEEM)
SET(testList ${testList}
triplanarPhantomAxNrrd
triplanarPhantomSaNrrd
triplanarPhantomCoNrrd)
ENDIF(IGS_BUILD_NRRD OR IGS_USE_TEEM)
# ==========================================
# Set up all tests
FOREACH(testName ${testList})
IF(CMTK_TESTING_MEMORYCHECK)
ADD_TEST(${testName} /bin/sh ${testDriver} ${testName} ${MEMORYCHECK_COMMAND})
ELSE(CMTK_TESTING_MEMORYCHECK)
ADD_TEST(${testName} /bin/sh ${testDriver} ${testName})
ENDIF(CMTK_TESTING_MEMORYCHECK)
ENDFOREACH(testName ${testList})
cmtk-3.0.0/testing/gui/triplanarTestDriver.sh.in 0000644 0001777 0000017 00000011013 11314230570 020711 0 ustar torsten man #!/bin/sh
##
## Copyright 1997-2009 Torsten Rohlfing
## Copyright 2004-2009 SRI International
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 1092 $
##
## $LastChangedDate: 2009-12-22 12:52:08 -0800 (Tue, 22 Dec 2009) $
##
## $LastChangedBy: torstenrohlfing $
##
RUNTEST=$1
VALGRIND=$2
BUILDNAME=@BUILDNAME@
DATADIR=@CMTK_DATA_ROOT@/testing/inputs
BINDIR=@EXECUTABLE_OUTPUT_PATH@/@CMAKE_BUILD_TYPE@
if [ ! -d ${BINDIR} ]; then
BINDIR=@EXECUTABLE_OUTPUT_PATH@
fi
BASELINE_DEFAULT=@CMTK_DATA_ROOT@/testing/baseline/${RUNTEST}
BASELINE=${BINDIR}/../testing/baseline/${RUNTEST}
if [ ! -d ${BASELINE} ]; then
BASELINE=${BASELINE_DEFAULT}
fi
HOSTNAME=`uname -n`
tmpdir=${BINDIR}/../testing/temporary/${HOSTNAME}/${RUNTEST}
mkdir -p ${tmpdir}
cd ${DATADIR}
run()
{
cmd=$*
echo "cd $PWD; $cmd"
if $cmd; then
return
else
exit 1
fi
}
run_eval()
{
cmd=$*
echo "cd $PWD; $cmd"
if eval "$cmd"; then
return
else
exit 1
fi
}
get_unzipped()
{
if test -f ${1}.gz; then
tmp=`mktemp`
gzip -cd ${1}.gz > ${tmp}
echo ${tmp}
else
echo ${1}
fi
}
check_result()
{
baseline=`get_unzipped ${BASELINE}/$1`
result=`get_unzipped ${tmpdir}/$1`
if test ! -f ${result}; then
echo "Results file ${result} does not exist"
exit 1
fi
if test ! -f ${baseline}; then
echo "Baseline file ${baseline} does not exist"
exit 1
fi
echo "diff ${BASELINE}/$1 ${tmpdir}/$1"
if diff $result $baseline; then
return
else
exit 1
fi
}
check_results()
{
for r in $*; do
check_result $r
done
}
case ${RUNTEST} in
triplanarDefault)
run ${BINDIR}/triplanar --exec load pat001_pet.hdr export-panel ${tmpdir}/panel.ppm export-axial ${tmpdir}/axial.ppm export-coronal ${tmpdir}/coronal.ppm export-sagittal ${tmpdir}/sagittal.ppm
for img in panel axial sagittal coronal; do
if check_result ${img}.ppm; then
echo $img ok.
else
exit $?
fi
done
;;
triplanarZoom300)
run ${BINDIR}/triplanar --exec load pat001_pet.hdr zoom 300 export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarZoom25)
run ${BINDIR}/triplanar --exec load pat001_pet.hdr zoom 25 export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarSetPixelWindowLevel)
run ${BINDIR}/triplanar --exec load pat002_ct.hdr crosshair off goto-pixel 32,20,0 window-level 500:0 export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarColormaps)
run ${BINDIR}/triplanar --exec load parc1.hdr crosshair off window-level 116:58 colormap Labels export-axial ${tmpdir}/labels.ppm colormap Red export-axial ${tmpdir}/red.ppm colormap Rainbow export-axial ${tmpdir}/rainbow.ppm
for img in labels red rainbow; do
if check_result ${img}.ppm; then
echo $img ok.
else
exit $?
fi
done
;;
triplanarPhantomAx)
run ${BINDIR}/triplanar --exec load phantom_ax.hdr crosshair off export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarPhantomSa)
run ${BINDIR}/triplanar --exec load phantom_sa.hdr crosshair off export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarPhantomCo)
run ${BINDIR}/triplanar --exec load phantom_co.hdr crosshair off export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarPhantomAxNrrd)
run ${BINDIR}/triplanar --exec load phantom_ax.nhdr crosshair off export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarPhantomSaNrrd)
run ${BINDIR}/triplanar --exec load phantom_sa.nhdr crosshair off export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarPhantomCoNrrd)
run ${BINDIR}/triplanar --exec load phantom_co.nhdr crosshair off export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
esac
if [ "${tmpdir}" != "" ]; then
rm -rf ${tmpdir}
fi
cmtk-3.0.0/testing/gui/triplanarTestDriver.sh 0000644 0001777 0000017 00000010566 11305033275 020323 0 ustar torsten man #!/bin/sh
##
## Copyright 1997-2009 Torsten Rohlfing
## Copyright 2004-2009 SRI International
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 918 $
##
## $LastChangedDate: 2009-11-30 13:18:53 -0800 (Mon, 30 Nov 2009) $
##
## $LastChangedBy: torstenrohlfing $
##
BUILDNAME=$1
BINDIR=$2
DATADIR=$3
RUNTEST=$4
HOSTNAME=`uname -n`
tmpdir=${BINDIR}/../testing/temporary/${HOSTNAME}/${RUNTEST}
mkdir -p ${tmpdir}
BASELINE=${DATADIR}/testing/baseline/${RUNTEST}
if [ -d ${DATADIR}/testing/baseline/${BUILDNAME}/${RUNTEST} ]; then
BASELINE=${DATADIR}/testing/${BUILDNAME}/${RUNTEST}
fi
cd ${DATADIR}/testing/inputs
run()
{
cmd=$*
echo "cd $PWD; $cmd"
if $cmd; then
return
else
exit 1
fi
}
run_eval()
{
cmd=$*
echo "cd $PWD; $cmd"
if eval "$cmd"; then
return
else
exit 1
fi
}
get_unzipped()
{
if test -f ${1}.gz; then
tmp=`mktemp`
gzip -cd ${1}.gz > ${tmp}
echo ${tmp}
else
echo ${1}
fi
}
check_result()
{
baseline=`get_unzipped ${BASELINE}/$1`
result=`get_unzipped ${tmpdir}/$1`
if test ! -f ${result}; then
echo "Results file ${result} does not exist"
exit 1
fi
if test ! -f ${baseline}; then
echo "Baseline file ${baseline} does not exist"
exit 1
fi
echo "diff ${BASELINE}/$1 ${tmpdir}/$1"
if diff $result $baseline; then
return
else
exit 1
fi
}
check_results()
{
for r in $*; do
check_result $r
done
}
case ${RUNTEST} in
triplanarDefault)
run ${BINDIR}/triplanar --exec load pat001_pet.hdr export-panel ${tmpdir}/panel.ppm export-axial ${tmpdir}/axial.ppm export-coronal ${tmpdir}/coronal.ppm export-sagittal ${tmpdir}/sagittal.ppm
for img in panel axial sagittal coronal; do
if check_result ${img}.ppm; then
echo $img ok.
else
exit $?
fi
done
;;
triplanarZoom300)
run ${BINDIR}/triplanar --exec load pat001_pet.hdr zoom 300 export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarZoom25)
run ${BINDIR}/triplanar --exec load pat001_pet.hdr zoom 25 export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarSetPixelWindowLevel)
run ${BINDIR}/triplanar --exec load pat002_ct.hdr crosshair off goto-pixel 32,20,0 window-level 500:0 export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarColormaps)
run ${BINDIR}/triplanar --exec load parc1.hdr crosshair off window-level 116:58 colormap Labels export-axial ${tmpdir}/labels.ppm colormap Red export-axial ${tmpdir}/red.ppm colormap Rainbow export-axial ${tmpdir}/rainbow.ppm
for img in labels red rainbow; do
if check_result ${img}.ppm; then
echo $img ok.
else
exit $?
fi
done
;;
triplanarPhantomAx)
run ${BINDIR}/triplanar --exec load phantom_ax.hdr crosshair off export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarPhantomSa)
run ${BINDIR}/triplanar --exec load phantom_sa.hdr crosshair off export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarPhantomCo)
run ${BINDIR}/triplanar --exec load phantom_co.hdr crosshair off export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarPhantomAxNrrd)
run ${BINDIR}/triplanar --exec load phantom_ax.nhdr crosshair off export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarPhantomSaNrrd)
run ${BINDIR}/triplanar --exec load phantom_sa.nhdr crosshair off export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
triplanarPhantomCoNrrd)
run ${BINDIR}/triplanar --exec load phantom_co.nhdr crosshair off export-panel ${tmpdir}/panel.ppm
check_result panel.ppm
;;
esac
if [ "${tmpdir}" != "" ]; then
rm -rf ${tmpdir}
fi
cmtk-3.0.0/testing/apps/ 0000755 0001777 0000017 00000000000 12263615446 014140 5 ustar torsten man cmtk-3.0.0/testing/apps/appsTestDriver.sh.in 0000755 0001777 0000017 00000361555 12262344156 020076 0 ustar torsten man #!/bin/bash
##
## Copyright 2004-2014 SRI International
##
## Copyright 1997-2011 Torsten Rohlfing
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 5099 $
##
## $LastChangedDate: 2014-01-05 13:02:38 -0800 (Sun, 05 Jan 2014) $
##
## $LastChangedBy: torsten_at_home $
##
RUNTEST=$1
CONFIG=$2
VALGRIND=$3
BUILDNAME=@BUILDNAME@
DATADIR=@CMTK_DATA_ROOT@/testing/inputs
BINDIR=@EXECUTABLE_OUTPUT_PATH@/${CONFIG}
if [ ! -d ${BINDIR}/. ]; then
BINDIR=@EXECUTABLE_OUTPUT_PATH@
fi
BASELINE_DEFAULT=@CMTK_DATA_ROOT@/testing/baseline/${RUNTEST}
BASELINE=${BINDIR}/../testing/baseline/${RUNTEST}
if [ ! -d ${BASELINE} ]; then
BASELINE=${BASELINE_DEFAULT}
fi
HOSTNAME=`uname -n`
NUMDIFF=@NUMDIFF_EXECUTABLE@
tmpdir=${BINDIR}/../testing/temporary/${HOSTNAME}/${RUNTEST}
if [ -e ${tmpdir} ]; then
rm -rf ${tmpdir}
fi
mkdir -p ${tmpdir}
sqlite=${BINDIR}/sqlite
if [ ! -f ${sqlite} ]; then
sqlite=sqlite3
fi
sed=/opt/local/bin/gsed
if [ ! -f ${sed} ]; then
sed=sed
fi
cd ${DATADIR}
run()
{
cmd=$*
echo "pushd $PWD; ${BINDIR}/$cmd; popd" 1>&2
if ${VALGRIND} ${BINDIR}/$cmd; then
return
else
exit 1
fi
}
run_expect_fail()
{
cmd=$*
echo "pushd $PWD; ${BINDIR}/$cmd; popd"
if ${BINDIR}/$cmd; then
exit 1
else
return
fi
}
run_eval()
{
cmd=$*
echo "pushd $PWD; $cmd; popd"
if eval "${VALGRIND} $cmd"; then
return
else
exit 1
fi
}
get_unzipped()
{
if test -f ${1}.gz; then
if [ "`uname`" = "Darwin" ]; then
local tmp=`mktemp /tmp/temp.XXXX`
else
local tmp=`mktemp`
fi
gzip -cd ${1}.gz > ${tmp}
echo ${tmp}
else
echo ${1}
fi
}
remove_if_tempfile()
{
for f in $*; do
local dir=`dirname $f`
if [ "${dir}" == "/tmp" ]; then
rm $f
fi
done
}
check_result()
{
baseline=`get_unzipped ${BASELINE}/$1`
result=`get_unzipped ${tmpdir}/$1`
if test ! -f ${result}; then
echo "Results file ${result} does not exist"
remove_if_tempfile ${baseline} ${result}
exit 1
fi
if test ! -f ${baseline}; then
echo "Baseline file ${baseline} does not exist"
remove_if_tempfile ${baseline} ${result}
exit 1
fi
local diff="cmp"
if file ${result} | fgrep text; then
## diff="diff --strip-trailing-cr"
diff="${NUMDIFF} --relative-tolerance=1e-5 --absolute-tolerance=5e-7"
fi
echo "${diff} ${tmpdir}/$1 ${BASELINE}/$1"
if ${diff} $result $baseline; then
remove_if_tempfile ${baseline} ${result}
return
else
remove_if_tempfile ${baseline} ${result}
exit 1
fi
}
check_results()
{
for r in $*; do
check_result $r
done
}
check_image()
{
baseline=${BASELINE}/$1
result=${tmpdir}/$1
abs_threshold=1e-5 ## if this is made much smaller, need to adjust "scale=" on next line:
# see if maximum relative difference between images exceeds 1e-6
difference=`${BINDIR}/similarity $baseline $result | fgrep SIMval | cut -f3`
compare=`echo "SCALE; $difference > $abs_threshold" | sed 's/e/*10^/g;s/SCALE/scale=10/' | bc`
echo difference=$difference compare=$compare
if [ "${compare}" = "0" ]; then
return
else
echo "Absolute image difference $difference exceeds threshold $abs_threshold"
fi
rel_threshold=1e-5 ## if this is made much smaller, need to adjust "scale=" on next line:
difference=`${BINDIR}/similarity $baseline $result | fgrep SIMval | cut -f4`
compare=`echo "SCALE; $difference > $rel_threshold" | sed 's/e/*10^/g;s/SCALE/scale=10/' | bc`
echo difference=$difference compare=$compare
if [ "${compare}" = "0" ]; then
return
else
echo "Relative image difference $difference exceeds threshold $rel_threshold"
exit 1
fi
}
check_images()
{
for r in $*; do
check_image $r
done
}
case ${RUNTEST} in
average_imagesMean)
run average_images -o ${tmpdir}/average.hdr spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results average.img
;;
average_imagesMeanNormPadd)
run average_images -o ${tmpdir}/average.hdr --set-padding-value 0 --normalize-mean-stdev spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results average.img
;;
average_imagesMeanAbsLog)
run average_images --set-padding-value 0 -o ${tmpdir}/average.hdr --abs --log spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results average.img
;;
average_imagesVariance)
run average_images -o ${tmpdir}/variance.hdr --var spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results variance.img
;;
average_imagesStDev)
run average_images -o ${tmpdir}/stdev.hdr --stdev spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results stdev.img
;;
average_imagesEntropy)
run average_images -o ${tmpdir}/entropy.hdr --entropy spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results entropy.img
;;
average_imagesZScore)
run average_images -o ${tmpdir}/zscore.hdr --zscore spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results zscore.img
;;
avg_admDefault2)
run avg_adm --output ${tmpdir}/avg.hdr --output-warp ${tmpdir}/avg.warp spgr_brain_12_warp.list
check_results avg.img avg.warp
;;
avg_admDefault3)
run avg_adm --output ${tmpdir}/avg.hdr --output-warp ${tmpdir}/avg.warp spgr_brain_12_warp.list spgr_brain_13_warp.list
check_results avg.img avg.warp
;;
avg_admJacobianFloat)
run avg_adm --jacobian --float --output ${tmpdir}/avg.hdr --output-warp ${tmpdir}/avg.warp spgr_brain_12_warp.list spgr_brain_13_warp.list
check_results avg.img avg.warp
;;
avg_admLabels)
run avg_adm --nn --label --replace-from spgr_brain_ --replace-to parc --output ${tmpdir}/avg.hdr --output-warp ${tmpdir}/avg.warp spgr_brain_12_warp.list spgr_brain_13_warp.list
check_results avg.img avg.warp
;;
avg_admPaddOutZeroNN)
run avg_adm --nn --pad-out 0 --output ${tmpdir}/avg.hdr --output-warp ${tmpdir}/avg.warp spgr_brain_12_warp.list spgr_brain_13_warp.list
check_results avg.img avg.warp
;;
avg_admNoReferenceModelCubic)
run avg_adm --byte --cubic --output ${tmpdir}/avg.hdr --output-warp ${tmpdir}/avg.warp --no-ref-model spgr_brain_12_warp.list spgr_brain_13_warp.list
check_results avg.img avg.warp
;;
avg_admNoScaleModelAutoScale)
run avg_adm --byte --output ${tmpdir}/avg.hdr --output-warp ${tmpdir}/avg.warp --no-scale-model --auto-scale spgr_brain_12_warp.list spgr_brain_13_warp.list
check_results avg.img avg.warp
;;
avg_admWithAffineNoRefData)
run avg_adm --byte --output ${tmpdir}/avg.hdr --output-warp ${tmpdir}/avg.warp --no-ref-data --with-affine spgr_brain_12_warp.list spgr_brain_13_warp.list
check_results avg.img avg.warp
;;
concat_affineABA)
run concat_affine -o ${tmpdir}/concat.xform affineA.xform affineB.xform affineA.xform
check_results concat.xform
;;
concat_affineABAInvert)
run concat_affine --invert-output -o ${tmpdir}/concat.xform affineA.xform affineB.xform affineA.xform
check_results concat.xform
;;
concat_affineAB1A)
run concat_affine -o ${tmpdir}/concat.xform affineA.xform --inverse affineB.xform affineA.xform
check_results concat.xform
;;
concat_affineAA1)
run concat_affine -o ${tmpdir}/concat.xform affineA.xform --inverse affineA.xform
check_results concat.xform
;;
concat_affineA1A)
run concat_affine -o ${tmpdir}/concat.xform -- --inverse affineA.xform affineA.xform
check_results concat.xform
;;
convert_warpFractional)
run convert_warp --fractional 0.5 vol001_mr_t0t1_warp.xform ${tmpdir}/fractional.xform
check_results fractional.xform
;;
convert_warpDeformation)
run convert_warp --deformation-only vol001_mr_t0t1_warp.xform ${tmpdir}/deformation.xform
check_results deformation.xform
;;
convertxType)
run convertx --byte --char --float --double --int --uint --short --ushort spgr_brain_1.hdr ${tmpdir}/convert.nii
check_results convert.nii
;;
convertxBinarize)
run convertx --binarize-thresh 100 spgr_brain_1.hdr ${tmpdir}/thresh.hdr
check_results thresh.img
;;
convertxBinarizeOtsu)
run convertx --otsu-thresh --byte phantom_ax.nii ${tmpdir}/binary.nii
check_results binary.nii
;;
convertxBinarizeOtsuNBins)
run convertx --otsu-thresh-nbins 128 --byte phantom_ax.nii ${tmpdir}/binary.nii
check_results binary.nii
;;
convertxPruneHighLow)
run convertx --prune-histogram 16 pat001_pet.hdr ${tmpdir}/prune.nii
check_results prune.nii
;;
convertxPruneHigh)
run convertx --prune-histogram-high 16 pat001_pet.hdr ${tmpdir}/prune.nii
check_results prune.nii
;;
convertxPruneLow)
run convertx --prune-histogram-low 16 pat001_pet.hdr ${tmpdir}/prune.nii
check_results prune.nii
;;
convertxBoundaryMap)
run convertx --boundary-map parc1.hdr ${tmpdir}/boundary_map.hdr
check_results boundary_map.img
;;
convertxConnectedComponents)
run convertx --connected-components binary_mask.nii ${tmpdir}/connected.hdr
check_results connected.img
;;
convertxDistanceUnsigned)
run convertx --distance-map parc1_bin.hdr ${tmpdir}/dmap.hdr
check_results dmap.img
;;
convertxLaplace)
run convertx --float --laplace-filter spgr_brain_1.hdr ${tmpdir}/laplace.hdr
check_results laplace.img
;;
convertxMapValues)
run convertx --map-values 82,86:254 --map-values 16:255 --set-padding 128 --map-values 0 parc3.hdr ${tmpdir}/mapped.hdr
check_results mapped.img
;;
convertxMapValues2)
run convertx --set-padding 128 --map-values 82,86:254+16:255+0 parc3.hdr ${tmpdir}/mapped.hdr
check_results mapped.img
;;
convertxMapValues3)
run convertx --set-padding 128 --map-values 16:255+82,86:254+0 parc3.hdr ${tmpdir}/mapped.hdr
check_results mapped.img
;;
convertxMapValuesOnly)
run convertx --set-padding 255 --map-values-only 82,86:1 parc3.hdr ${tmpdir}/mapped.hdr
check_results mapped.img
;;
convertxMapValuesOnly2)
run convertx --set-padding 255 --map-values-only 82:1+86:1 parc3.hdr ${tmpdir}/mapped.hdr
check_results mapped.img
;;
convertxRevert)
run convertx --revert parc1_bin.hdr ${tmpdir}/revert.hdr
check_results revert.img
run convertx --revert parc1.hdr ${tmpdir}/revert.hdr
check_results revert.img
;;
convertxDistanceSigned)
run convertx --signed-distance-map parc1_bin.hdr ${tmpdir}/dmap.hdr
check_results dmap.img
;;
convertxDistanceSigned2)
run convertx --signed-distance-map parc1.hdr ${tmpdir}/dmap.hdr
check_results dmap.img
;;
convertxBoundaryMapMultiValue)
run convertx --multi-boundary-map parc1.hdr ${tmpdir}/boundary_map_multi.hdr
check_results boundary_map_multi.img
;;
convertxCropThresholdWriteRegion)
run_eval "${BINDIR}/convertx --crop-by-threshold-write-region 1 spgr_brain_1.hdr ${tmpdir}/cropped.nii > ${tmpdir}/crop.txt"
check_results cropped.nii crop.txt
;;
convertxCropRegion1)
run_eval "${BINDIR}/convertx --crop-by-index 2,2,2,12,12,12 spgr_brain_1.hdr ${tmpdir}/cropped.nii"
check_results cropped.nii
;;
convertxCropRegion2)
run_eval "${BINDIR}/convertx --crop-by-index 10,10,10,-10,-10,-10 spgr_brain_1.hdr ${tmpdir}/cropped.nii"
check_results cropped.nii
;;
convertxResample)
run convertx --resample 1.0 phantom_ax.nii ${tmpdir}/resample.nii
check_results resample.nii
;;
convertxDownsample)
run convertx --downsample-average 8,4,1 phantom_ax.hdr ${tmpdir}/downsample.hdr
check_results downsample.hdr downsample.img
;;
convertxDownsampleNiftiSform)
run convertx --downsample-average 8,4,1 phantom_ax_sform.nii ${tmpdir}/downsample_ax.nii
run convertx --downsample-average 1,8,4 phantom_sa_sform.nii ${tmpdir}/downsample_sa.nii
run convertx --downsample-average 4,1,8 phantom_co_sform.nii ${tmpdir}/downsample_co.nii
check_results downsample_ax.nii downsample_sa.nii downsample_co.nii
;;
convertxDownsampleNiftiQform)
run convertx --downsample-average 8,4,1 phantom_ax_qform.nii ${tmpdir}/downsample_ax.nii
run convertx --downsample-average 1,8,4 phantom_sa_qform.nii ${tmpdir}/downsample_sa.nii
run convertx --downsample-average 4,1,8 phantom_co_qform.nii ${tmpdir}/downsample_co.nii
check_results downsample_ax.nii downsample_sa.nii downsample_co.nii
;;
convertxDownsampleNiftiQformSform)
run convertx --downsample-average 8,4,1 phantom_ax_qform_sform.nii ${tmpdir}/downsample_ax.nii
run convertx --downsample-average 1,8,4 phantom_sa_qform_sform.nii ${tmpdir}/downsample_sa.nii
run convertx --downsample-average 4,1,8 phantom_co_qform_sform.nii ${tmpdir}/downsample_co.nii
check_results downsample_ax.nii downsample_sa.nii downsample_co.nii
;;
convertxDownsampleNrrd)
run convertx --downsample-average 8,4,1 phantom_ax.nhdr ${tmpdir}/downsample.nhdr
check_results downsample.nhdr downsample.raw
;;
convertxDownsampleSelect)
run convertx --downsample-select 8,4,1 phantom_ax.hdr ${tmpdir}/downsample.hdr
check_results downsample.hdr downsample.img
;;
convertxDownsampleSelectNrrd)
run convertx --downsample-select 8,4,1 phantom_ax.nhdr ${tmpdir}/downsample.nhdr
check_results downsample.nhdr downsample.raw
;;
convertxFlipX)
run convertx --flip-x parc1_bin.hdr ${tmpdir}/flip.hdr
check_results flip.img
;;
convertxFlipYZ)
run convertx --flip-y --flip-z parc1_bin.hdr ${tmpdir}/flip.hdr
check_results flip.img
;;
convertxErodeDilateErode)
run convertx --erode 1 --dilate 2 --erode 1 parc1_bin.hdr ${tmpdir}/parc1_ede.img
check_results parc1_ede.img
;;
convertxDilateErodeDilate)
run convertx --dilate 1 --erode 2 --dilate 1 parc1_bin.hdr ${tmpdir}/parc1_ded.img
check_results parc1_ded.img
;;
convertxErodeByDistance)
run convertx --erode-distance 10 parc1_bin.hdr ${tmpdir}/parc1_erode.nii
check_results parc1_erode.nii
;;
convertxDilateByDistance)
run convertx --dilate-distance 10 parc1_bin.hdr ${tmpdir}/parc1_dilate.nii
check_results parc1_dilate.nii
;;
convertxGaussianFilterSigma)
run convertx --gaussian-filter-sigma 5.0 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxGaussianFilterFWHM)
run convertx --gaussian-filter-fwhm 10.0 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxHistogramEqualization)
run convertx --histogram-equalization spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxHistogramEqualizationNBins)
run convertx --histogram-equalization-nbins 32 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxMask)
run convertx --mask spgr_3t_mask.hdr spgr_3t.hdr ${tmpdir}/masked.hdr
check_results masked.img
;;
convertxMaskInverse)
run convertx --mask-inverse spgr_3t_mask.hdr spgr_3t.hdr ${tmpdir}/masked.hdr
check_results masked.img
;;
convertxMedianFilter1)
run convertx --median-filter 1 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxMedianFilter2)
run convertx --median-filter 2 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxMedianFilterXYZ)
run convertx --median-filter 2,2,1 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxMeanFilter)
run convertx --float --mean-filter 1 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxFastMean0Filter)
run convertx --float --fast-mean-filter 0 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxFastMean1Filter)
run convertx --float --fast-mean-filter 1 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxFastMean2Filter)
run convertx --float --fast-mean-filter 2 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxFastMean2PadFilter)
run convertx --set-padding 0 --float --fast-mean-filter 2 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxVarianceFilter)
run convertx --float --variance-filter 1 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxFastVariance0Filter)
run convertx --float --fast-variance-filter 0 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxFastVariance1Filter)
run convertx --float --fast-variance-filter 1 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxFastVariance2Filter)
run convertx --float --fast-variance-filter 2 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxFastVariance2PadFilter)
run convertx --set-padding 0 --float --fast-variance-filter 2 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxThirdMomentFilter)
run convertx --float --third-moment-filter 1 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxStandardDeviationFilter)
run convertx --float --standard-deviation-filter 1 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxSmoothnessFilter)
run convertx --float --smoothness-filter 1 spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.img
;;
convertxNiftiToAnalyze)
run convertx spgr_brain_1.nii ${tmpdir}/spgr_brain_1.hdr
check_results spgr_brain_1.hdr spgr_brain_1.img
;;
convertxNiftiToMetaImage)
run convertx spgr_brain_1.nii ${tmpdir}/spgr_brain_1.mha
check_results spgr_brain_1.mha
;;
convertxAnalyzeToNifti)
run convertx spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.nii
check_results spgr_brain_1.nii
;;
convertxAnalyzeToNiftiRAS)
export CMTK_LEGACY_WRITE_IMAGES_RAS=1
run convertx spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.nii
unset CMTK_LEGACY_WRITE_IMAGES_RAS
check_results spgr_brain_1.nii
;;
convertxNiftiDetachedToNifti)
run convertx spgr_brain_nifti.hdr ${tmpdir}/spgr_brain_1.nii
check_results spgr_brain_1.nii
;;
convertxAnalyzeToNiftiDetached)
run convertx spgr_brain_1.hdr ${tmpdir}/spgr_brain_1.img
check_results spgr_brain_1.hdr spgr_brain_1.img
;;
convertxUncompressedNIFTI1)
export CMTK_WRITE_UNCOMPRESSED=1
run convertx parc1_bin.hdr ${tmpdir}/out.nii
unset CMTK_WRITE_UNCOMPRESSED
if [ ! -e ${tmpdir}/out.nii ]; then exit 1; fi
;;
convertxUncompressedNIFTI2)
export CMTK_WRITE_UNCOMPRESSED=1
run convertx parc1_bin.hdr ${tmpdir}/out.nii.gz
unset CMTK_WRITE_UNCOMPRESSED
if [ ! -e ${tmpdir}/out.nii.gz ]; then exit 1; fi
;;
convertxUncompressedNIFTI3)
unset CMTK_WRITE_UNCOMPRESSED
run convertx parc1_bin.hdr ${tmpdir}/out.nii
if [ ! -e ${tmpdir}/out.nii.gz ]; then exit 1; fi
;;
convertxUncompressedNIFTI4)
unset CMTK_WRITE_UNCOMPRESSED
run convertx parc1_bin.hdr ${tmpdir}/out.nii.gz
if [ ! -e ${tmpdir}/out.nii.gz ]; then exit 1; fi
;;
convertxThresholdBelow)
run convertx --set-padding 0 --thresh-below 100 spgr_brain_1.hdr ${tmpdir}/thresh.hdr
check_results thresh.img
;;
convertxThresholdAbove)
run convertx --set-padding 0 --thresh-above 100 spgr_brain_1.hdr ${tmpdir}/thresh.hdr
check_results thresh.img
;;
convertxThresholdBelowToPadding)
run convertx --set-padding 0 --thresh-below-to-padding 100 spgr_brain_1.hdr ${tmpdir}/thresh.hdr
check_results thresh.img
;;
convertxThresholdAboveToPadding)
run convertx --set-padding 0 --thresh-above-to-padding 100 spgr_brain_1.hdr ${tmpdir}/thresh.hdr
check_results thresh.img
;;
convertxScaleToRange)
run convertx --scale-to-range 128:192 spgr_brain_1.hdr ${tmpdir}/scaled.hdr
check_results scaled.img
;;
convertxReplacePadding)
run convertx --byte --set-padding 0 --replace-padding 255 spgr_brain_1.hdr ${tmpdir}/replaced.hdr
check_results replaced.img
;;
convertxReplaceInfNaN)
run convertx --replace-inf-nan 255 infinite.nii ${tmpdir}/replaced.hdr
check_results replaced.img
;;
dbtool_AddImages)
run dbtool add_images ${tmpdir}/db.sqlite image1 image2
${sqlite} ${tmpdir}/db.sqlite "SELECT * FROM images ORDER BY path ASC" > ${tmpdir}/images
check_results images
;;
dbtool_AddImages2)
run dbtool add_images ${tmpdir}/db.sqlite image1 image2 image3 image3
${sqlite} ${tmpdir}/db.sqlite "SELECT * FROM images ORDER BY path ASC" > ${tmpdir}/images
check_results images
;;
dbtool_ListSpace)
run_eval "${BINDIR}/dbtool list_space images.sqlite image1c > ${tmpdir}/list.txt"
check_results list.txt
;;
dbtool_GetXform1)
run_eval "${BINDIR}/dbtool get_xform imagesSingleXform.sqlite image1.nii image2.nii > ${tmpdir}/xform.txt"
check_results xform.txt
;;
dbtool_GetXform2)
run_eval "${BINDIR}/dbtool get_xform imagesSingleXform.sqlite image2.nii image1.nii > ${tmpdir}/xform.txt"
check_results xform.txt
;;
dbtool_GetXform3)
run_eval "${BINDIR}/dbtool get_xform imagesMultiXforms.sqlite image1.nii image2.nii > ${tmpdir}/xform.txt"
check_results xform.txt
;;
dbtool_GetXform4)
run_eval "${BINDIR}/dbtool get_xform imagesMultiXforms.sqlite image2.nii image1.nii > ${tmpdir}/xform.txt"
check_results xform.txt
;;
dbtool_GetXform5)
run_eval "${BINDIR}/dbtool get_xform --all imagesMultiXforms.sqlite image1.nii image2.nii > ${tmpdir}/xform.txt"
check_results xform.txt
;;
dbtool_GetXform6)
run_eval "${BINDIR}/dbtool get_xform --all imagesMultiXforms.sqlite image2.nii image1.nii > ${tmpdir}/xform.txt"
check_results xform.txt
;;
dcm2image)
run dcm2image -O ${tmpdir}/00%n.hdr dcm/
check_results 001.hdr 001.img 002.hdr 002.img 003.hdr 003.img
;;
dcm2imageSubs)
run dcm2image -O ${tmpdir}/%D_%R_%E%N.nii dcm/
check_results 3-plane-localizer_5.104_1.52-1.nii 3-plane-localizer_5.104_1.52-2.nii 3-plane-localizer_5.104_1.52-3.nii
;;
dcm2imageZ)
run dcm2image -O ${tmpdir}/00%n.nii dcmz/
check_results 001.nii 002.nii 003.nii
;;
dcm2imageNrrd)
run dcm2image -O ${tmpdir}/00%n.nhdr dcm/
check_results 001.nhdr 001.raw 002.nhdr 002.raw 003.nhdr 003.raw
;;
dcm2imageEmbedPatientNameAnalyze)
run dcm2image --embed PatientName -O ${tmpdir}/00%n.hdr dcm/
check_results 001.hdr 002.hdr 003.hdr
;;
dcm2imageEmbedPatientNameNifti)
run dcm2image --embed PatientName -O ${tmpdir}/00%n.nii dcm/
check_results 001.nii 002.nii 003.nii
;;
dcm2imageEmbedSeriesDescriptionNifti)
run dcm2image --embed SeriesDescription -O ${tmpdir}/00%n.nii dcm/
check_results 001.nii 002.nii 003.nii
;;
dcm2imageEmbedStudyIDDateNifti)
run dcm2image --embed StudyID_StudyDate -O ${tmpdir}/00%n.nii dcm/
check_results 001.nii
;;
dcm2imageEmbedPatientNameNrrd)
run dcm2image --embed PatientName -O ${tmpdir}/00%n.nhdr dcm/
check_results 001.nhdr 002.nhdr 003.nhdr
;;
dcm2imageMosaic)
run dcm2image -x --include-identifiers -O ${tmpdir}/00.nii mr-mosaic/
check_results 00.nii 00.nii.xml
;;
dcm2imageMosaicPACS)
run dcm2image -x --include-identifiers -O ${tmpdir}/00.nii mr-mosaic-pacs/
check_results 00.nii 00.nii.xml
;;
dcm2imageDiffusionGEXML)
run dcm2image -x --tolerance 1e-4 --include-identifiers -O ${tmpdir}/%n.nii mr-dwi-ge/
check_results 1.nii 1.nii.xml 2.nii 2.nii.xml
;;
dcm2imageDiffusionSiemensXML)
run dcm2image -x --include-identifiers -O ${tmpdir}/%n.nii mr-dwi-siemens/
check_results 1.nii 1.nii.xml 2.nii 2.nii.xml 3.nii 3.nii.xml 4.nii 4.nii.xml
;;
dcm2imageMosaicAnon)
run dcm2image -x -O ${tmpdir}/00.nii mr-mosaic/
check_results 00.nii 00.nii.xml
;;
dcm2imageMosaicPACSAnon)
run dcm2image -x -O ${tmpdir}/00.nii mr-mosaic-pacs/
check_results 00.nii 00.nii.xml
;;
dcm2imageDiffusionGEXMLAnon)
run dcm2image -x --tolerance 1e-4 -O ${tmpdir}/%n.nii mr-dwi-ge/
check_results 1.nii 1.nii.xml 2.nii 2.nii.xml
;;
dcm2imageDiffusionSiemensXMLAnon)
run dcm2image -x -O ${tmpdir}/%n.nii mr-dwi-siemens/
check_results 1.nii 1.nii.xml 2.nii 2.nii.xml 3.nii 3.nii.xml 4.nii 4.nii.xml
;;
dcm2imageExclude)
run dcm2image --exclude ImageOrientationPatient=1\\-0\\0\\-0\\1\\0 -O ${tmpdir}/image%n.nii dcm/
check_results image1.nii image2.nii
;;
dcm2imageInclude)
run dcm2image --filter ImageOrientationPatient=1\\-0\\0\\-0\\1\\0 -O ${tmpdir}/image%n.nii dcm/
check_results image.nii
;;
dcm2imageSubsDirName)
run dcm2image -x --tolerance 1e-4 --include-identifiers -O ${tmpdir}/%1/%0.nii mr-dwi-ge/ mr-dwi-siemens/
check_results mr-dwi-ge/I0150.dcm.nii mr-dwi-ge/I0150.dcm.nii.xml mr-dwi-ge/I0280.dcm.nii mr-dwi-ge/I0280.dcm.nii.xml
check_results mr-dwi-siemens/I0001.dcm.nii mr-dwi-siemens/I0001.dcm.nii.xml mr-dwi-siemens/I0002.dcm.nii mr-dwi-siemens/I0002.dcm.nii.xml
check_results mr-dwi-siemens/I0003.dcm.nii mr-dwi-siemens/I0003.dcm.nii.xml mr-dwi-siemens/I0004.dcm.nii mr-dwi-siemens/I0004.dcm.nii.xml
;;
describeEmpty)
run_eval "${BINDIR}/describe -m empty.nii > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMountPoints)
run_eval "CMTK_MOUNTPOINTS=INPUTS=${DATADIR} ${BINDIR}/describe -m INPUTS/spgr_brain_1.hdr > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMountPointsMulti)
run_eval "CMTK_MOUNTPOINTS=DUMMY=/fs/dummy,INPUTS=${DATADIR} ${BINDIR}/describe -m INPUTS/spgr_brain_1.hdr > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMountPointsPrefix)
run_eval "CMTK_MOUNTPOINTS=^INPUTS=${DATADIR} ${BINDIR}/describe -m INPUTS/spgr_brain_1.hdr > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMountPointsPrefixInvalid)
run_eval "CMTK_MOUNTPOINTS=^NPUTS=INVALID,^INPUTS=${DATADIR} ${BINDIR}/describe -m INPUTS/spgr_brain_1.hdr > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeDICOM)
run_eval "${BINDIR}/describe -m dcm/I0007.dcm > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeDICOMZ)
run_eval "${BINDIR}/describe -m dcmz/I0007.dcm > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMosaicDICOM)
run_eval "${BINDIR}/describe -m mr-mosaic/fmri.dcm > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMosaicPACSDICOM)
run_eval "${BINDIR}/describe -m mr-mosaic-pacs/image.dcm > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeVanderbilt)
run_eval "${BINDIR}/describe -m vanderbilt/header.ascii > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeBZip2a)
run_eval "${BINDIR}/describe -m bzip_test.nii > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeBZip2b)
run_eval "${BINDIR}/describe -m bzip_test.nii.bz2 > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeLZMAa)
run_eval "${BINDIR}/describe -m lzma_test.nii > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeLZMAb)
run_eval "${BINDIR}/describe -m lzma_test.nii.lzma > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeXZa)
run_eval "${BINDIR}/describe -m xz_test.nii > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeXZb)
run_eval "${BINDIR}/describe -m xz_test.nii.xz > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMR1)
run_eval "${BINDIR}/describe -m parc1_bin.hdr > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMR2)
run_eval "${BINDIR}/describe -m phantom_ax.hdr phantom_co.hdr phantom_sa.hdr > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMR3)
run_eval "${BINDIR}/describe -m header_only.hdr > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMR4)
run_eval "${BINDIR}/describe -m phantom_ax.nii phantom_co.nii phantom_sa.nii > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeHuman)
run_eval "${BINDIR}/describe --read-ras phantom_ax.nii phantom_co.nii phantom_sa.nii > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMRBiorad)
run_eval "${BINDIR}/describe -m bioradvol.PIC > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMRBioradGz)
run_eval "${BINDIR}/describe -m gz_bioradvol.PIC.gz > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMRNrrd1)
run_eval "${BINDIR}/describe -m phantom_ax.nhdr phantom_co.nhdr phantom_sa.nhdr > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeMRNrrd2)
run_eval "${BINDIR}/describe -m split_ax_0.nhdr split_ax_1.nhdr split_ax_2.nhdr > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeNrrdNoOrigin)
run_eval "${BINDIR}/describe -m phantom_ax_noOrigin.nhdr > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeNiftiDetached348)
run_eval "${BINDIR}/describe -m spgr_brain_nifti_hdr348.hdr > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeEmbedAnalyze)
run_eval "${BINDIR}/describe -m embed_patient.hdr > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeEmbedNifti)
run_eval "${BINDIR}/describe -m embed_patient.nii > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeEmbedNrrd)
run_eval "${BINDIR}/describe -m embed_patient.nrrd > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeXform)
run_eval "${BINDIR}/describe spgr_brain_12_warp.list vol001_mr_t0t1.list > ${tmpdir}/describe.txt"
check_results describe.txt
;;
describeXformMachine)
run_eval "${BINDIR}/describe -m spgr_brain_12_warp.list vol001_mr_t0t1.list > ${tmpdir}/describe.txt"
check_results describe.txt
;;
destripeDefault)
run destripe -y stripes_crop_byte.nii ${tmpdir}/destripe.nii
check_results destripe.nii
;;
destripeKernelFloat)
run destripe -y --kernel-fwhm 5 --kernel-radius 2 --write-float stripes_crop_byte.nii ${tmpdir}/destripe.nii
check_results destripe.nii
;;
detect_adni_phantomDefault)
run detect_adni_phantom --write-labels ${tmpdir}/labels.nii --write-rigid ${tmpdir}/rigid.xform --write-affine ${tmpdir}/affine.xform spgr_magphan.nii ${tmpdir}/magphan.xml
check_results labels.nii rigid.xform affine.xform magphan.xml
;;
detect_adni_phantomRefineXform)
run detect_adni_phantom --tolerant --refine-xform --write-rigid ${tmpdir}/rigid.xform --write-affine ${tmpdir}/affine.xform spgr_magphan_lowcontrast.nii ${tmpdir}/magphan.xml
check_results rigid.xform affine.xform magphan.xml
;;
detect_adni_phantomRefineOutliers)
run detect_adni_phantom --tolerant --refine-outliers --write-rigid ${tmpdir}/rigid.xform --write-affine ${tmpdir}/affine.xform spgr_magphan_lowcontrast.nii ${tmpdir}/magphan.xml
check_results rigid.xform affine.xform magphan.xml
;;
detect_adni_phantomExcludeOutliers)
run detect_adni_phantom --tolerant --exclude-outliers --write-rigid ${tmpdir}/rigid.xform --write-affine ${tmpdir}/affine.xform spgr_magphan_lowcontrast.nii ${tmpdir}/magphan.xml
check_results rigid.xform affine.xform magphan.xml
;;
detect_adni_phantomErodeNonStd)
run detect_adni_phantom --erode-snr 20 --erode-cnr 2 spgr_magphan.nii ${tmpdir}/magphan.xml
check_results magphan.xml
;;
detect_adni_phantomBadFOV)
run_expect_fail detect_adni_phantom spgr_magphan_badFOV.nii ${tmpdir}/magphan.xml
;;
detect_adni_phantomTolerantBadFOV)
run detect_adni_phantom --tolerant --write-labels ${tmpdir}/labels.nii spgr_magphan_badFOV.nii ${tmpdir}/magphan.xml
check_results magphan.xml labels.nii
;;
detect_adni_phantomMissingSphere)
run detect_adni_phantom --write-labels ${tmpdir}/labels.nii --write-rigid ${tmpdir}/rigid.xform --write-affine ${tmpdir}/affine.xform spgr_magphan_missingSphere.nii ${tmpdir}/magphan.xml
check_results labels.nii rigid.xform affine.xform magphan.xml
;;
detect_adni_phantomBrokenSNR)
run detect_adni_phantom --write-labels ${tmpdir}/labels.nii --write-rigid ${tmpdir}/rigid.xform --write-affine ${tmpdir}/affine.xform spgr_magphan_brokenSNR.nii ${tmpdir}/magphan.xml
check_results labels.nii rigid.xform affine.xform magphan.xml
;;
detect_spheres_matched_filter)
run detect_spheres_matched_filter --radius 15 --filter-margin 2 adni_phantom2mm.nii ${tmpdir}/filtered.nii
run convertx --float --downsample-select 4,4,4 ${tmpdir}/filtered.nii ${tmpdir}/filtered.nii
check_images filtered.nii
;;
detect_spheres_matched_filterNormalized)
run detect_spheres_matched_filter --normalized --radius 15 --filter-margin 1 adni_phantom2mm.nii ${tmpdir}/filtered.nii
run convertx --float --downsample-select 4,4,4 ${tmpdir}/filtered.nii ${tmpdir}/filtered.nii
check_images filtered.nii
;;
dof2mat)
run_eval "${BINDIR}/dof2mat parc1_parc2_9dof.xform > ${tmpdir}/matrix"
check_results matrix
;;
dof2matTranspose)
run_eval "${BINDIR}/dof2mat --transpose parc1_parc2_9dof.xform > ${tmpdir}/matrix"
check_results matrix
;;
dof2matLegacy)
run_eval "${BINDIR}/dof2mat vol001_mr_t0t1.list > ${tmpdir}/matrix"
check_results matrix
;;
dof2matLegacyFwd)
run_eval "${BINDIR}/dof2mat vol001_mr_t0t1_fwd.list > ${tmpdir}/matrix"
check_results matrix
;;
dof2matFixed)
run_eval "${BINDIR}/dof2mat vol001_mr_t0t1_fwd24.list > ${tmpdir}/matrix"
check_results matrix
;;
stream_pixels)
run_eval "${BINDIR}/stream_pixels jacobian-01.nii jacobian-02.nii > ${tmpdir}/stream.raw"
check_results stream.raw
;;
stream_pixelsConvert)
run_eval "${BINDIR}/stream_pixels --convert int jacobian-01.nii jacobian-02.nii > ${tmpdir}/stream.raw"
check_results stream.raw
;;
stream_pixelsReorient)
run_eval "${BINDIR}/stream_pixels --reorient RIP jacobian-01.nii jacobian-02.nii > ${tmpdir}/stream.raw"
check_results stream.raw
;;
stream_pixelsEndian)
run_eval "${BINDIR}/stream_pixels --change-endian jacobian-01.nii jacobian-02.nii > ${tmpdir}/stream.raw"
check_results stream.raw
;;
epiunwarp)
export CMTK_NUM_THREADS=1
run epiunwarp --no-init-shift-com --write-jacobian-fwd ${tmpdir}/jacobian.nii --folding-constraint-weight 0 --smooth-sigma-max 16 --smooth-sigma-min 0 --smooth-sigma-diff 1 --iterations 5 --smoothness-constraint-weight 1e4 --phase-encode-ap dwi_fwd.nii dwi_rev.nii ${tmpdir}/c1.nii ${tmpdir}/c2.nii ${tmpdir}/df.nrrd
unset CMTK_NUM_THREADS
check_images c1.nii c2.nii jacobian.nii
check_results df.nrrd
;;
epiunwarpInitShift)
export CMTK_NUM_THREADS=1
run epiunwarp --write-jacobian-fwd ${tmpdir}/jacobian.nii --folding-constraint-weight 0 --smooth-sigma-max 16 --smooth-sigma-min 0 --smooth-sigma-diff 1 --iterations 5 --smoothness-constraint-weight 1e4 --phase-encode-ap dwi_fwd.nii dwi_rev.nii ${tmpdir}/c1.nii ${tmpdir}/c2.nii ${tmpdir}/df.nrrd
unset CMTK_NUM_THREADS
check_images c1.nii c2.nii jacobian.nii
check_results df.nrrd
;;
fib2image)
run_eval "${BINDIR}/fib2image -o ${tmpdir}/fibers.nii fiber_grid.hdr < fibers.fib"
check_images fibers.nii
;;
fibxform)
run_eval "${BINDIR}/fibxform crop-x30.xform < fibers.fib > ${tmpdir}/output.fib"
check_results output.fib
;;
fibxformSourceTarget)
run_eval "${BINDIR}/fibxform --source-image fiber_grid.hdr --target-image fiber_grid.hdr crop-x30.xform < fibers.fib > ${tmpdir}/output.fib"
check_results output.fib
;;
filterGaussian)
run filter --gaussian 1 --radius 2 rat_fse_erly.hdr ${tmpdir}/filter.hdr
check_results filter.img
;;
filterGaussianSmallKernel)
run filter --gaussian 1 --radius 1.1 rat_fse_erly.hdr ${tmpdir}/filter.hdr
check_results filter.img
;;
filterGaussianNoFilter)
run filter --gaussian 1 --radius 0.5 rat_fse_erly.hdr ${tmpdir}/filter.hdr
check_results filter.img
;;
filterRohlfing)
run filter --rohlfing --intensity-gaussian 1 --gaussian 10 spgr_3t.hdr ${tmpdir}/filter.hdr spgr_3t_mask.hdr
check_results filter.img
;;
filmFourthOrder)
run film --coronal --nmi --fourth-order-error --passes 3 --num-iterations 3 --injection-kernel-radius 2 --injection-kernel-sigma 1 --write-injected-image ${tmpdir}/injected.hdr interleave_thnfse.hdr ${tmpdir}/corrected.hdr
check_results corrected.img
;;
filmCubic)
run film --coronal --nmi --cubic --passes 3 --num-iterations 3 --injection-kernel-radius 2 --injection-kernel-sigma 1 --write-injected-image ${tmpdir}/injected.hdr interleave_thnfse.hdr ${tmpdir}/corrected.hdr
check_results corrected.img
;;
filmMSDLinearNoTrunc)
run film --msd --coronal --linear --no-truncation --passes 3 --num-iterations 3 --injection-kernel-radius 2 --injection-kernel-sigma 1 interleave_thnfse.hdr ${tmpdir}/corrected.hdr
check_results corrected.img
;;
filmMISincRefSPGR)
run film --mi --coronal --cubic --passes 3 --num-iterations 3 --injection-kernel-radius 2 --injection-kernel-sigma 1 --reference-image interleave_3dspgr.hdr interleave_thnfse.hdr ${tmpdir}/corrected.hdr
check_results corrected.img
;;
fit_affine_xform)
run fit_affine_xform -o ${tmpdir}/affine.xform vol001_mr_t0.hdr vol001_mr_t0t1_warp.xform --inverse vol001_mr_t0t1.list
check_results affine.xform
;;
fit_affine_xformRigid)
run fit_affine_xform --rigid -o ${tmpdir}/rigid.xform vol001_mr_t0.hdr vol001_mr_t0t1_warp.xform --inverse vol001_mr_t0t1.list
check_results rigid.xform
;;
fit_affine_xformReverse)
run fit_affine_xform -o ${tmpdir}/affine.xform vol001_mr_t1.hdr --inverse vol001_mr_t0t1.list vol001_mr_t0t1_warp.xform
check_results affine.xform
;;
fit_affine_xform_landmarksRigid)
run fit_affine_xform_landmarks landmarksSource landmarksTargetRigid ${tmpdir}/affine.xform
check_results affine.xform
;;
fit_affine_xform_landmarksScales)
run fit_affine_xform_landmarks landmarksSource landmarksTargetScales ${tmpdir}/affine.xform
check_results affine.xform
;;
fit_affine_xform_landmarksShear)
run fit_affine_xform_landmarks landmarksSource landmarksTargetShear ${tmpdir}/affine.xform
check_results affine.xform
;;
fit_affine_xform_landmarksRigidRigid)
run fit_affine_xform_landmarks --rigid landmarksSource landmarksTargetRigid ${tmpdir}/affine.xform
check_results affine.xform
;;
fit_affine_xform_landmarksRigidRigidFlip)
run fit_affine_xform_landmarks --rigid landmarksSource2 landmarksTarget2 ${tmpdir}/rigid.xform
check_results rigid.xform
;;
fit_affine_xform_landmarksRigidScales)
run fit_affine_xform_landmarks --rigid landmarksSource landmarksTargetScales ${tmpdir}/affine.xform
check_results affine.xform
;;
fit_affine_xform_landmarksRigidShear)
run fit_affine_xform_landmarks --rigid landmarksSource landmarksTargetShear ${tmpdir}/affine.xform
check_results affine.xform
;;
fit_affine_dfieldDField)
run fit_affine_dfield vol001_mr_t0t1_dfield.nrrd ${tmpdir}/affine_fit.xform
check_results affine_fit.xform
;;
fit_affine_dfieldFFD)
run fit_affine_dfield vol001_mr_t0t1_warp.xform ${tmpdir}/affine_fit.xform
check_results affine_fit.xform
;;
fit_spline_dfieldSpacing)
run fit_spline_dfield --final-cp-spacing 40 vol001_mr_t0t1_dfield.nrrd ${tmpdir}/warp.xform
check_results warp.xform
;;
fit_spline_dfieldSpacingMultiLevel)
run fit_spline_dfield --final-cp-spacing 40 --levels 2 vol001_mr_t0t1_dfield.nrrd ${tmpdir}/warp.xform
check_results warp.xform
;;
fit_spline_dfieldDims)
run fit_spline_dfield --final-cp-dims 10,10,5 vol001_mr_t0t1_dfield.nrrd ${tmpdir}/warp.xform
check_results warp.xform
;;
fit_spline_dfieldDimsRelative)
run fit_spline_dfield --relative --final-cp-dims 10,10,5 vol001_mr_t0t1_dfield.nrrd ${tmpdir}/warp.xform
check_results warp.xform
;;
fit_spline_dfieldDimsMultiLevel)
run fit_spline_dfield --final-cp-dims 10,10,5 --levels 2 vol001_mr_t0t1_dfield.nrrd ${tmpdir}/warp.xform
check_results warp.xform
;;
fit_spline_dfieldDimsMultiLevelSafe)
run fit_spline_dfield --final-cp-dims 10,10,5 --levels 400 vol001_mr_t0t1_dfield.nrrd ${tmpdir}/warp.xform
check_results warp.xform
;;
fit_spline_dfieldDimsWithAffine)
run fit_spline_dfield --fit-affine-first --final-cp-dims 10,10,5 vol001_mr_t0t1_dfield.nrrd ${tmpdir}/warp.xform
check_results warp.xform
;;
fit_spline_xformSpacing)
run fit_spline_xform --final-cp-spacing 40 -o ${tmpdir}/warp.xform vol001_mr_t0.hdr vol001_mr_t0t1_warp.xform --inverse vol001_mr_t0t1.list
check_results warp.xform
;;
fit_spline_xformSpacingReverse)
run fit_spline_xform --final-cp-spacing 40 -o ${tmpdir}/warp.xform vol001_mr_t1.hdr --inverse vol001_mr_t0t1.list vol001_mr_t0t1_warp.xform
check_results warp.xform
;;
fit_spline_xformSpacingMultiLevel)
run fit_spline_xform --final-cp-spacing 40 --levels 2 -o ${tmpdir}/warp.xform vol001_mr_t0.hdr vol001_mr_t0t1_warp.xform --inverse vol001_mr_t0t1.list
check_results warp.xform
;;
fit_spline_xformDims)
run fit_spline_xform --final-cp-dims 10,10,5 -o ${tmpdir}/warp.xform vol001_mr_t0.hdr vol001_mr_t0t1_warp.xform --inverse vol001_mr_t0t1.list
check_results warp.xform
;;
fit_spline_xformDimsMultiLevel)
run fit_spline_xform --final-cp-dims 10,10,5 --levels 2 -o ${tmpdir}/warp.xform vol001_mr_t0.hdr vol001_mr_t0t1_warp.xform --inverse vol001_mr_t0t1.list
check_results warp.xform
;;
glmDefault)
run_eval "${BINDIR}/glm -v -O ${tmpdir}/model_%s_%02d_%s.hdr jacobian_glm.txt jacobian-%s.nii | fgrep -v ${tmpdir} > ${tmpdir}/model_stdout.txt"
check_results model_stdout.txt model_fstat_00_model.img model_tstat_00_age.img model_param_00_age.img
check_results model_tstat_01_sex.img model_param_01_sex.img model_tstat_02_CONST.img model_param_02_CONST.img
;;
glmNormalize)
run_eval "${BINDIR}/glm --normalize -v -O ${tmpdir}/model_%s_%02d_%s.hdr jacobian_glm.txt jacobian-%s.nii | fgrep -v ${tmpdir} > ${tmpdir}/model_stdout.txt"
check_results model_stdout.txt model_fstat_00_model.img model_tstat_00_age.img model_param_00_age.img
check_results model_tstat_01_sex.img model_param_01_sex.img model_tstat_02_CONST.img model_param_02_CONST.img
;;
glmExp)
run_eval "${BINDIR}/glm --exp -v -O ${tmpdir}/model_%s_%02d_%s.hdr jacobian_glm.txt jacobian-%s.nii | fgrep -v ${tmpdir} > ${tmpdir}/model_stdout.txt"
check_results model_stdout.txt model_fstat_00_model.img model_tstat_00_age.img model_param_00_age.img
check_results model_tstat_01_sex.img model_param_01_sex.img model_tstat_02_CONST.img model_param_02_CONST.img
;;
glmNoConstant)
run_eval "${BINDIR}/glm --exclude-constant -v -O ${tmpdir}/model_%s_%02d_%s.hdr jacobian_glm.txt jacobian-%s.nii | fgrep -v ${tmpdir} > ${tmpdir}/model_stdout.txt"
check_results model_stdout.txt model_fstat_00_model.img model_tstat_00_age.img model_param_00_age.img
check_results model_tstat_01_sex.img model_param_01_sex.img
;;
glmIgnore)
run_eval "${BINDIR}/glm --ignore-parameter 1 -v -O ${tmpdir}/model_%s_%02d_%s.hdr jacobian_glm.txt jacobian-%s.nii | fgrep -v ${tmpdir} > ${tmpdir}/model_stdout.txt"
check_results model_stdout.txt model_fstat_00_model.img model_tstat_00_age.img model_param_00_age.img
check_results model_tstat_02_CONST.img model_param_02_CONST.img
;;
glmSelect)
run_eval "${BINDIR}/glm --select-parameter age -v -O ${tmpdir}/model_%s_%02d_%s.hdr jacobian_glm.txt jacobian-%s.nii | fgrep -v ${tmpdir} > ${tmpdir}/model_stdout.txt"
check_results model_stdout.txt model_fstat_00_model.img
check_results model_tstat_00_age.img model_param_00_age.img model_tstat_02_CONST.img model_param_02_CONST.img
;;
glmCrop)
run_eval "${BINDIR}/glm --crop 10,10,0,20,20,2 -v -O ${tmpdir}/model_%s_%02d_%s.hdr jacobian_glm.txt jacobian-%s.nii | fgrep -v ${tmpdir} > ${tmpdir}/model_stdout.txt"
check_results model_stdout.txt model_fstat_00_model.img model_tstat_00_age.img model_param_00_age.img
check_results model_tstat_01_sex.img model_param_01_sex.img model_tstat_02_CONST.img model_param_02_CONST.img
;;
gmmDefault)
run gmm --mask gmm/mask.nii gmm/spgr.nii ${tmpdir}/gmm.nii gmm/prior1.nii gmm/prior2.nii gmm/prior3.nii
check_results gmm.nii
;;
gmmAlternative)
run gmm --classes 2 --iterations 5 --priors-init-only --prior-epsilon 0.05 --probability-maps gmm/spgr.nii ${tmpdir}/gmm.nii gmm/prior1.nii gmm/prior2.nii
check_results gmm.nii
check_images gmm_prob1.nii gmm_prob2.nii
;;
gregxformFordwardBackward)
run_eval "cat vol001_t0_points.xyz | ${BINDIR}/gregxform -f vol001_mr_t0t1_warp.xform | ${BINDIR}/gregxform vol001_mr_t0t1_warp.xform > ${tmpdir}/vol001_t0_points.xyz"
check_results vol001_t0_points.xyz
;;
gregxformAffine)
run_eval "cat vol001_t0_points.xyz | ${BINDIR}/gregxform -f vol001_mr_t0t1.list > ${tmpdir}/vol001_t0_points.xyz"
check_results vol001_t0_points.xyz
;;
gregxformAffineFromWarp)
run_eval "cat vol001_t0_points.xyz | ${BINDIR}/gregxform --affine -f vol001_mr_t0t1_warp.xform > ${tmpdir}/vol001_t0_points.xyz"
check_results vol001_t0_points.xyz
;;
gregxformAffineFromWarpFwdBwd)
run_eval "cat vol001_t0_points.xyz | ${BINDIR}/gregxform --affine -f vol001_mr_t0t1_warp.xform | ${BINDIR}/gregxform --affine vol001_mr_t0t1_warp.xform > ${tmpdir}/vol001_t0_points.xyz"
check_results vol001_t0_points.xyz
;;
groupwise_affineFromInit)
run groupwise_affine -v --force-background 0 -O ${tmpdir} --dofs 6 --dofs 9 -e 4 -a 0.25 --downsample-from 2 --downsample-to 1 --sampling-density 1.0 --zero-sum groupwise_init_brain123.xforms
check_results groupwise.xforms average.nii
;;
groupwise_affineMatchHistograms)
export CMTK_NUM_THREADS=1
run groupwise_affine -v --match-histograms --force-background 0 -O ${tmpdir} --dofs 6 --dofs 9 -e 4 -a 0.25 --downsample-from 2 --downsample-to 1 --sampling-density 1.0 --zero-sum groupwise_init_brain123.xforms
unset CMTK_NUM_THREADS
check_results groupwise.xforms average.nii
;;
groupwise_affineFromInitSampling)
run groupwise_affine -v --force-background 0 -O ${tmpdir} --dofs 6 --dofs 9 -e 4 -a 0.25 --downsample-to 1 --sampling-density 0.5 --zero-sum groupwise_init_brain123.xforms
## no baseline; this mode uses probabilistic sampling
;;
groupwise_affineBackground)
run groupwise_affine -v --force-background 0 -O ${tmpdir} --template spgr_brain_1.hdr --dofs 6 --dofs 9 -e 2 -a 0.25 --downsample-from 2 --downsample-to 1 --sampling-density 1.0 --zero-sum spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results groupwise.xforms average.nii
;;
groupwise_affineUseTemplate)
export CMTK_NUM_THREADS=1
run groupwise_affine -v --force-background 0 -O ${tmpdir} --template spgr_brain_1.hdr --dofs 6 --dofs 9 -e 2 -a 0.25 --downsample-from 2 --downsample-to 1 --sampling-density 1.0 --template-with-data spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
unset CMTK_NUM_THREADS
check_results groupwise.xforms average.nii
;;
groupwise_affineZeroSumSmooth)
export CMTK_NUM_THREADS=1
run groupwise_affine -v --smooth 0.5 --downsample-to 0 -O ${tmpdir} --template spgr_brain_1.hdr --dofs 6 --dofs 9 -e 2 -a 0.25 --downsample-from 2 --sampling-density 1.0 --zero-sum spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
unset CMTK_NUM_THREADS
check_results groupwise.xforms average.nii
;;
groupwise_affineRMIFromInit)
run groupwise_affine --rmi --force-background 0 -O ${tmpdir} --dofs 6 --dofs 9 -e 4 -a 0.25 --downsample-from 2 --downsample-to 1 --sampling-density 1.0 --zero-sum groupwise_init_brain123.xforms
check_results groupwise.xforms average.nii
;;
groupwise_affineRMIFromInitDeltaF)
run groupwise_affine --rmi --force-background 0 -O ${tmpdir} --dofs 6,9 -e 4 --delta-f-threshold 0.1 -a 0.25 --downsample-from 2 --downsample-to 1 --sampling-density 1.0 --zero-sum groupwise_init_brain123.xforms
check_results groupwise.xforms average.nii
;;
groupwise_affineRMIFromInitSampling)
run groupwise_affine --rmi --force-background 0 -O ${tmpdir} --dofs 6 --dofs 9 -e 4 -a 0.25 --downsample-to 1 --sampling-density 0.5 --zero-sum groupwise_init_brain123.xforms
## no baseline; this mode uses probabilistic sampling
;;
groupwise_affineRMIBackground)
run groupwise_affine --rmi --force-background 0 -O ${tmpdir} --template spgr_brain_1.hdr --dofs 6 --dofs 9 -e 2 -a 0.25 --downsample-from 2 --downsample-to 1 --sampling-density 1.0 --zero-sum spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results groupwise.xforms average.nii
;;
groupwise_affineRMIZeroSumSmooth)
run groupwise_affine --rmi --smooth 0.5 --downsample-to 0 -O ${tmpdir} --template spgr_brain_1.hdr --dofs 6 --dofs 9 -e 2 -a 0.25 --downsample-from 2 --sampling-density 1.0 --zero-sum spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results groupwise.xforms average.nii
;;
groupwise_warpFromInit)
run groupwise_warp -v --force-background 0 -O ${tmpdir} --grid-spacing 200 --refine-grid 1 -e 2 -a 1 --downsample-from 2 --downsample-to 1 groupwise_init_brain123.xforms
check_results groupwise.xforms average.nii
;;
groupwise_warpFromInitProtect)
run groupwise_warp -v --force-background 0 -vv --disable-cp-mask box_corner.nii -O ${tmpdir} --grid-spacing 200 --refine-grid 1 -e 2 -a 1 --downsample-from 2 --downsample-to 1 groupwise_init_brain123.xforms
check_results groupwise.xforms
;;
groupwise_warpFitFromInit)
run groupwise_warp -v --force-background 0 -O ${tmpdir} --grid-spacing 200 --grid-spacing-fit --refine-grid 1 -e 4 -a 1 --downsample-from 2 --downsample-to 1 groupwise_init_brain123.xforms
check_results groupwise.xforms average.nii
;;
groupwise_warpUseTemplate)
run groupwise_warp -v --force-background 0 -O ${tmpdir} --grid-spacing 200 --refine-grid 1 -e 2 -a 1 --downsample-from 2 --downsample-to 2 --template-with-data spgr_brain_1.hdr groupwise_init_brain123.xforms
check_results groupwise.xforms average.nii
;;
groupwise_warpUseTemplateMatchHistograms)
export CMTK_NUM_THREADS=1
run groupwise_warp -v --match-histograms --force-background 0 -O ${tmpdir} --grid-spacing 200 --refine-grid 1 -e 2 -a 1 --downsample-from 2 --downsample-to 2 --template-with-data spgr_brain_1.hdr groupwise_init_brain123.xforms
unset CMTK_NUM_THREADS
check_results groupwise.xforms average.nii
;;
groupwise_warpMatchHistograms)
export CMTK_NUM_THREADS=1
run groupwise_warp -v --match-histograms --force-background 0 -O ${tmpdir} --grid-spacing 200 --refine-grid 1 -e 2 -a 1 --downsample-from 2 --downsample-to 2 --template spgr_brain_1.hdr groupwise_init_brain123.xforms
unset CMTK_NUM_THREADS
check_results groupwise.xforms average.nii
;;
groupwise_warpFromInitZeroSum)
run groupwise_warp -v --zero-sum --force-background 0 -O ${tmpdir} --grid-spacing 200 --refine-grid 1 -e 2 -a 1 --downsample-from 2 --downsample-to 1 groupwise_init_brain123.xforms
check_results groupwise.xforms average.nii
;;
groupwise_warpFromInitNoBG)
run groupwise_warp -v -O ${tmpdir} --grid-spacing 200 --refine-grid 1 -e 2 -a 1 --downsample-from 2 --downsample-to 1 groupwise_init_brain123.xforms
check_results groupwise.xforms average.nii
;;
groupwise_warpUseTemplateNoBG)
run groupwise_warp -v -O ${tmpdir} --grid-spacing 200 --refine-grid 1 -e 2 -a 1 --downsample-from 2 --downsample-to 2 --template-with-data spgr_brain_1.hdr groupwise_init_brain123.xforms
check_results groupwise.xforms average.nii
;;
groupwise_warpRMIFromInit)
run groupwise_warp --rmi -v --force-background 0 -O ${tmpdir} --grid-spacing 200 --refine-grid 1 -e 2 -a 1 --downsample-from 2 --downsample-to 1 groupwise_init_brain123.xforms
check_results groupwise.xforms average.nii
;;
groupwise_warpRMIFitFromInit)
run groupwise_warp --rmi -v --force-background 0 -O ${tmpdir} --grid-spacing 200 --grid-spacing-fit --refine-grid 1 -e 4 -a 1 --downsample-from 2 --downsample-to 1 groupwise_init_brain123.xforms
check_results groupwise.xforms average.nii
;;
groupwise_warpRMIFromInitZeroSum)
run groupwise_warp --rmi -v --zero-sum --force-background 0 -O ${tmpdir} --grid-spacing 200 --refine-grid 1 -e 2 -a 1 --downsample-from 2 --downsample-to 1 groupwise_init_brain123.xforms
check_results groupwise.xforms average.nii
;;
groupwise_initCentersOfMass)
run groupwise_init -O ${tmpdir} --align-centers-of-mass spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results groupwise.xforms
# cannot compare separate xforms due to local file system path in the file
check_results average.nii
;;
groupwise_initCenterFOV)
run groupwise_init -O ${tmpdir} --center-template spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results groupwise.xforms
# cannot compare separate xforms due to local file system path in the file
check_results average.nii
;;
groupwise_initCentersOfMassScale)
run groupwise_init -O ${tmpdir} --align-centers-of-mass --init-scales spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results groupwise.xforms
# cannot compare separate xforms due to local file system path in the file
check_results average.nii
;;
groupwise_initCentersOfMassTemplate)
run groupwise_init -O ${tmpdir} --template spgr_brain_1.hdr --align-centers-of-mass spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr
check_results groupwise.xforms
check_results pairs/target-000.list/registration pairs/target-001.list/registration pairs/target-002.list/registration
check_results average.nii
;;
hausdorffBinary12)
run_eval "${BINDIR}/hausdorff parc1_bin.hdr parc2_bin.hdr > ${tmpdir}/hd.txt"
check_results hd.txt
;;
hausdorffBinary21)
run_eval "${BINDIR}/hausdorff parc2_bin.hdr parc1_bin.hdr > ${tmpdir}/hd.txt"
check_results hd.txt
;;
hausdorffBinaryForced)
run_eval "${BINDIR}/hausdorff parc1.hdr parc2.hdr > ${tmpdir}/hd.txt"
check_results hd.txt
;;
histogram)
run histogram -o ${tmpdir}/histogram spgr_3t.hdr
check_results histogram
;;
histogramNorm)
run histogram --normalize -o ${tmpdir}/histogram spgr_3t.hdr
check_results histogram
;;
histogramBinsMinMax)
run histogram --min 300 --max 3000 --nbins 16 -o ${tmpdir}/histogram spgr_3t.hdr
check_results histogram
;;
histogramBinsMinMaxTrunc)
run histogram --truncate --min 300 --max 3000 --nbins 16 -o ${tmpdir}/histogram spgr_3t.hdr
check_results histogram
;;
histogramMask)
run histogram --mask spgr_3t_mask.hdr -o ${tmpdir}/histogram spgr_3t.hdr
check_results histogram
;;
imagemathAbsPop)
run imagemath --in pat001_pet.hdr pat001_mr_T1.hdr --pop --abs --out ${tmpdir}/abs.nii
check_results abs.nii
;;
imagemathSqrSqrt)
run imagemath --in pat001_pet.hdr --sqr --sqrt --out ${tmpdir}/abs.nii
check_results abs.nii
;;
imagemathLogExp)
run imagemath --in spgr_brain_1.hdr --log --exp --out ${tmpdir}/logexp.nii
check_results logexp.nii
;;
imagemathDupAddMulDiv)
run imagemath --in spgr_brain_1.hdr --dup --in spgr_brain_2.hdr spgr_brain_3.hdr --add --mul --div --out ${tmpdir}/damd.nii
check_results damd.nii
;;
imagemathThreshAboveBelow)
run imagemath --in pat001_pet.hdr --thresh-above 1000 --thresh-below 0 --out ${tmpdir}/thresh.nii
check_results thresh.nii
;;
imagemathAverage)
run imagemath --in parc1_bin.hdr parc2_bin.hdr parc3_bin.hdr --average --out ${tmpdir}/average.hdr
check_results average.img
;;
imagemathVariance)
run imagemath --in spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr --variance --out ${tmpdir}/variance.nii
check_results variance.nii
;;
imagemathMaskAverage)
run imagemath --in spgr_3t.hdr spgr_3t_mask.hdr --mask-average --out ${tmpdir}/average.hdr
check_results average.img
;;
imagemathXor)
run imagemath --in parc1.hdr --scalar-xor 1 --out ${tmpdir}/xor.hdr
check_results xor.img
;;
imagemathDupFillMaxValue)
run imagemath --in parc1.hdr --dup --fill 1 --max-value --out ${tmpdir}/result.hdr
check_results result.img
;;
imagemathAnd)
run imagemath --in parc1.hdr --scalar-and 1 --out ${tmpdir}/and.hdr
check_results and.img
;;
imagemathContractLabels)
run imagemath --in parc1.hdr parc2.hdr parc3.hdr --contract-labels --out ${tmpdir}/contract.hdr
check_results contract.img
;;
imagemathMaxIndex)
run imagemath --in parc1.hdr parc2.hdr parc3.hdr --max-index --out ${tmpdir}/maxidx.nii
check_results maxidx.nii
;;
imagemathMaxValue)
run imagemath --in parc1.hdr parc2.hdr parc3.hdr --max-value --out ${tmpdir}/maxval.nii
check_results maxval.nii
;;
imagemathVote)
run imagemath --in parc1_bin.hdr parc2_bin.hdr parc3_bin.hdr --vote --out ${tmpdir}/vote.hdr
check_results vote.img
;;
imagemathProduct)
run imagemath --in parc1_bin.hdr parc2_bin.hdr parc3_bin.hdr --product --out ${tmpdir}/prod.nii
check_results prod.nii
;;
imagemathStackEntropyLabels)
run imagemath --in parc1_bin.hdr parc2_bin.hdr parc3_bin.hdr --stack-entropy-labels --out ${tmpdir}/entropy.hdr
check_results entropy.img
;;
imagemathSTAPLE)
run imagemath --in parc1_bin.hdr parc2_bin.hdr parc3_bin.hdr --staple 10 --out ${tmpdir}/staple.hdr
check_results staple.img
;;
imagemathMultiClassSTAPLE)
run imagemath --in parc1.hdr parc2.hdr parc3.hdr --mstaple 2 --out ${tmpdir}/mstaple.hdr
check_results mstaple.img
;;
imagemathMultiClassDisputedSTAPLE)
run imagemath --in parc1.hdr parc2.hdr parc3.hdr --mstaple-disputed 2 --out ${tmpdir}/mstaple.hdr
check_results mstaple.img
;;
imagemathCombinePCA)
run imagemath --in rat_fse_erly.hdr rat_fse_late.hdr --combine-pca --trunc --out ${tmpdir}/combine_pca.hdr
check_results combine_pca.img
;;
imagemathT2)
run imagemath --float --in rat_fse_erly.hdr --log --in rat_fse_late.hdr --log --scalar-mul -1 --add --one-over --out ${tmpdir}/t2.hdr
check_results t2.img
;;
imagemathAtan2)
run imagemath --float --in rat_fse_erly.hdr rat_fse_late.hdr --atan2 --out ${tmpdir}/atan.nii
check_results atan.nii
;;
imagemathLogOddsAdd)
run imagemath --float --in pbmap_wm_2.nii --logit --in pbmap_wm_1.nii --logit --average --logistic --out ${tmpdir}/logodds_add.hdr
check_results logodds_add.img
;;
imagemathLogOddsAdd2)
run imagemath --float --in pbmap_wm_2.nii pbmap_wm_1.nii --all --logit --average --all --logistic --out ${tmpdir}/logodds_add.hdr
check_results logodds_add.img
;;
imagemathMatchMeanSDev)
run imagemath --in spgr_brain_1.hdr spgr_brain_2.hdr --match-mean-sdev --out ${tmpdir}/match.nii
check_results match.nii
;;
imagemathMatchMeanSDev3)
run imagemath --in spgr_brain_1.hdr spgr_brain_2.hdr spgr_brain_3.hdr --match-mean-sdev3 --out ${tmpdir}/match.nii
check_results match.nii
;;
imagemathMatchHistograms)
run imagemath --in spgr_brain_1.hdr spgr_brain_2.hdr --match-histograms --out ${tmpdir}/match_histograms.hdr
check_results match_histograms.img
;;
imagemathMatchHistogramsPadding)
run imagemath --set-padding-value 0 --in spgr_brain_1.hdr spgr_brain_2.hdr --match-histograms --out ${tmpdir}/match_histograms.hdr
check_results match_histograms.img
;;
imagemathMatchHistogramsPadding2)
run imagemath --in spgr_brain_1.hdr spgr_brain_2.hdr --set-padding-value 0 --match-histograms --out ${tmpdir}/match_histograms.hdr
check_results match_histograms.img
;;
imagemathMatchHistogramsPaddingUnset)
run imagemath --set-padding-value 0 --in spgr_brain_1.hdr --unset-padding --in spgr_brain_2.hdr --match-histograms --out ${tmpdir}/match_histograms.hdr
check_results match_histograms.img
;;
interleaved_bad_slicesDefault)
run interleaved_bad_slices rsfMRI-motion/*.nii* > ${tmpdir}/badSlices.txt
check_results badSlices.txt
;;
interleaved_bad_slicesStdDev1)
run interleaved_bad_slices --stdev-thresh 1 rsfMRI-motion/*.nii* > ${tmpdir}/badSlices.txt
check_results badSlices.txt
;;
interleaved_bad_slicesRMS)
run interleaved_bad_slices --rms rsfMRI-motion/*.nii* > ${tmpdir}/badSlices.txt
check_results badSlices.txt
;;
interleaved_bad_slicesBulk)
run interleaved_bad_slices --bad-slices-thresh 1 rsfMRI-motion/*.nii* > ${tmpdir}/badSlices.txt
check_results badSlices.txt
;;
jidbBoxFourthOrder)
run jidb --coronal --nmi --psf box --fourth-order-error --passes 3 --num-iterations 3 --injection-kernel-radius 2 --injection-kernel-sigma 1 --write-injected-image ${tmpdir}/injected.hdr interleave_thnfse.hdr ${tmpdir}/corrected.hdr
check_results corrected.img
;;
jidbGaussian)
run jidb --coronal --nmi --psf gaussian --passes 3 --num-iterations 3 --injection-kernel-radius 2 --injection-kernel-sigma 1 --write-injected-image ${tmpdir}/injected.hdr interleave_thnfse.hdr ${tmpdir}/corrected.hdr
check_results corrected.img
;;
jidbGaussianScale)
run jidb --psf gaussian --nmi --psf-scale 0.5 --no-truncation --passes 3 --num-iterations 3 --injection-kernel-radius 2 --injection-kernel-sigma 1 interleave_thnfse.hdr ${tmpdir}/corrected.hdr
check_results corrected.img
;;
jidbMIRefSPGR)
run jidb --mi --passes 3 --num-iterations 3 --injection-kernel-radius 2 --injection-kernel-sigma 1 --reference-image interleave_3dspgr.hdr interleave_thnfse.hdr ${tmpdir}/corrected.hdr
check_results corrected.img
;;
levelsetDefault)
run levelset -v vol001_mr_t1.hdr ${tmpdir}/levelset.hdr
check_results levelset.img
;;
levelsetScaleInitial)
run levelset -v --scale-initial-sphere 0.5 vol001_mr_t1.hdr ${tmpdir}/levelset.hdr
check_results levelset.img
;;
levelsetBinarizeFastWideBinary)
run levelset -v --binarize --delta 1.0 --filter-sigma 4.0 vol001_mr_t1.hdr ${tmpdir}/levelset.hdr
check_results levelset.img
;;
lvoteDefault)
run lvote -v -o ${tmpdir}/lvote.nii lvote_target.nii lvote_atlas_i0.nii lvote_atlas_l0.nii lvote_atlas_i1.nii lvote_atlas_l1.nii lvote_atlas_i2.nii lvote_atlas_l2.nii
check_results lvote.nii
;;
lvoteGlobalWeights)
run lvote -v -o ${tmpdir}/lvote.nii --use-global-weights lvote_target.nii lvote_atlas_i0.nii lvote_atlas_l0.nii lvote_atlas_i1.nii lvote_atlas_l1.nii lvote_atlas_i2.nii lvote_atlas_l2.nii
check_results lvote.nii
;;
lvoteRadius3)
run lvote -v -o ${tmpdir}/lvote.nii --patch-radius 3 lvote_target.nii lvote_atlas_i0.nii lvote_atlas_l0.nii lvote_atlas_i1.nii lvote_atlas_l1.nii lvote_atlas_i2.nii lvote_atlas_l2.nii
check_results lvote.nii
;;
lvoteOutliersGlobal)
run lvote -v -o ${tmpdir}/lvote.nii --patch-radius 3 --no-global-outliers lvote_target.nii lvote_atlas_i0.nii lvote_atlas_l0.nii lvote_atlas_i1.nii lvote_atlas_l1.nii lvote_atlas_i2.nii lvote_atlas_l2.nii
check_results lvote.nii
;;
lsbaRadius3)
run lsba -v -o ${tmpdir}/lsba.nii --patch-radius 3 lvote_target.nii lvote_atlas_i0.nii lvote_atlas_l0.nii lvote_atlas_i1.nii lvote_atlas_l1.nii lvote_atlas_i2.nii lvote_atlas_l2.nii
check_results lsba.nii
;;
lsbaRadius3Outliers)
run lsba -v -o ${tmpdir}/lsba.nii --patch-radius 3 --no-local-outliers lvote_target.nii lvote_atlas_i0.nii lvote_atlas_l0.nii lvote_atlas_i1.nii lvote_atlas_l1.nii lvote_atlas_i2.nii lvote_atlas_l2.nii
check_results lsba.nii
;;
lsbaRadius3OutliersGlobal)
run lsba -v -o ${tmpdir}/lsba.nii --patch-radius 3 --no-global-outliers lvote_target.nii lvote_atlas_i0.nii lvote_atlas_l0.nii lvote_atlas_i1.nii lvote_atlas_l1.nii lvote_atlas_i2.nii lvote_atlas_l2.nii
check_results lsba.nii
;;
lsbaRadius3Search1)
run lsba -v -o ${tmpdir}/lsba.nii --search-radius 1 --patch-radius 3 --no-local-outliers lvote_target.nii lvote_atlas_i0.nii lvote_atlas_l0.nii lvote_atlas_i1.nii lvote_atlas_l1.nii lvote_atlas_i2.nii lvote_atlas_l2.nii
check_results lsba.nii
;;
lmsbaRadius3)
run lmsba -v -o ${tmpdir}/lmsba.nii --patch-radius 3 lvote_target.nii lvote_atlas_i0.nii lvote_atlas_l0.nii lvote_atlas_i1.nii lvote_atlas_l1.nii lvote_atlas_i2.nii lvote_atlas_l2.nii
check_results lmsba.nii
;;
lmsbaRadius3Outliers)
run lmsba -v -o ${tmpdir}/lmsba.nii --patch-radius 3 --no-local-outliers lvote_target.nii lvote_atlas_i0.nii lvote_atlas_l0.nii lvote_atlas_i1.nii lvote_atlas_l1.nii lvote_atlas_i2.nii lvote_atlas_l2.nii
check_results lmsba.nii
;;
lmsbaRadius3OutliersGlobal)
run lmsba -v -o ${tmpdir}/lmsba.nii --patch-radius 3 --no-global-outliers lvote_target.nii lvote_atlas_i0.nii lvote_atlas_l0.nii lvote_atlas_i1.nii lvote_atlas_l1.nii lvote_atlas_i2.nii lvote_atlas_l2.nii
check_results lmsba.nii
;;
lmsbaRadius3Search1)
run lmsba -v -o ${tmpdir}/lmsba.nii --search-radius 1 --patch-radius 3 --no-local-outliers lvote_target.nii lvote_atlas_i0.nii lvote_atlas_l0.nii lvote_atlas_i1.nii lvote_atlas_l1.nii lvote_atlas_i2.nii lvote_atlas_l2.nii
check_results lmsba.nii
;;
make_initial_affineCenterOfMass)
run make_initial_affine --mode centers-of-mass box1.hdr box3.hdr ${tmpdir}/xform
check_results xform
;;
make_initial_affinePrincipalAxes1)
run make_initial_affine --mode principal-axes box1.hdr box2.hdr ${tmpdir}/xform
check_results xform
;;
make_initial_affinePrincipalAxes2)
run make_initial_affine --mode principal-axes box1.hdr box3.hdr ${tmpdir}/xform
check_results xform
;;
make_initial_affinePrincipalAxes3)
run make_initial_affine --mode principal-axes box2.hdr box3.hdr ${tmpdir}/xform
check_results xform
;;
make_initial_affinePrincipalAxes4)
run make_initial_affine --mode principal-axes box1.hdr box4.hdr ${tmpdir}/xform
check_results xform
;;
make_initial_affinePrincipalAxes5)
run make_initial_affine --mode principal-axes box2.hdr box4.hdr ${tmpdir}/xform
check_results xform
;;
make_initial_affinePrincipalAxes6)
run make_initial_affine --mode principal-axes box3.hdr box4.hdr ${tmpdir}/xform
check_results xform
;;
make_initial_affineDirectionVectorsNrrdAxSa)
run make_initial_affine phantom_ax.nhdr phantom_sa.nhdr ${tmpdir}/xform
check_results xform
;;
make_initial_affineDirectionVectorsNrrdAxCo)
run make_initial_affine phantom_ax.nhdr phantom_co.nhdr ${tmpdir}/xform
check_results xform
;;
make_initial_affineDirectionVectorsNrrdSaCo)
run make_initial_affine phantom_sa.nhdr phantom_co.nhdr ${tmpdir}/xform
check_results xform
;;
make_initial_affineDirectionVectorsNrrdAxSaNative)
run make_initial_affine --native-space phantom_ax.nhdr phantom_sa.nhdr ${tmpdir}/xform
check_results xform
;;
make_initial_affineDirectionVectorsNrrdAxCoNative)
run make_initial_affine --native-space phantom_ax.nhdr phantom_co.nhdr ${tmpdir}/xform
check_results xform
;;
make_initial_affineDirectionVectorsNrrdSaCoNative)
run make_initial_affine --native-space phantom_sa.nhdr phantom_co.nhdr ${tmpdir}/xform
check_results xform
;;
make_initial_affineDB)
run make_initial_affine --db ${tmpdir}/db.sqlite box1.hdr box3.hdr ${tmpdir}/xform
# only test for crash; local xform path in database is not portable for comparison
;;
mat2dof1)
run_eval "${BINDIR}/mat2dof --transpose --center -28,-48,-28 --offset 28,48,28 --pixel-size 1.06667,0.5,1.06667 -l ${tmpdir} < rigid-air.mat"
check_results registration
;;
mat2dof2)
run_eval "${BINDIR}/mat2dof --transpose --center -28,-48,-28 --offset 28,48,28 --pixel-size 1.06667,0.5,1.06667 --inverse -l ${tmpdir} < rigid-air.mat"
check_results registration
;;
mat2dofFile)
run_eval "${BINDIR}/mat2dof --transpose --center -28,-48,-28 --offset 28,48,28 --pixel-size 1.06667,0.5,1.06667 -l ${tmpdir} rigid-air.mat"
check_results registration
;;
mcaffine1)
export CMTK_NUM_THREADS=1
run mcaffine --downsample-from 4 --downsample-to 1 --initial-step-size 1 --final-step-size 0.5 --dofs 6 --covariance -o ${tmpdir}/xform pat001_mr_T1.hdr -- pat001_pet.hdr
unset CMTK_NUM_THREADS
check_results xform
;;
mcaffine2)
run mcaffine --initial-xform mcaffine2_initial.xform --downsample-from 4 --downsample-to 1 --initial-step-size 1 --final-step-size 0.5 --dofs 6 --histograms -o ${tmpdir}/xform pat001_mr_T1.hdr -- pat001_pet.hdr
check_results xform
;;
mcaffine3)
run mcaffine --downsample-from 4 --downsample-to 1 --initial-step-size 1 --final-step-size 0.5 --dofs 6 --dofs 9 --covariance -o ${tmpdir}/xform rat_fse_erly.hdr rat_fse_late.hdr -- rat2_fse_erly.hdr rat2_fse_late.hdr
check_results xform
;;
mcaffine4)
run mcaffine --downsample-from 4 --downsample-to 1 --delta-f-threshold 0.1 --initial-step-size 1 --final-step-size 0.5 --dofs 6,9 --covariance -o ${tmpdir}/xform rat_fse_erly.hdr rat_fse_late.hdr -- rat2_fse_erly.hdr rat2_fse_late.hdr
check_results xform
;;
mcwarp1)
# Test breaks when using multiple threads due to floating point effects
export CMTK_NUM_THREADS=1
run mcwarp --downsample-from 2 --downsample-to 1 --initial-step-size 1 --final-step-size 0.5 --grid-spacing 14 --refine-grid 2 --covariance -o ${tmpdir}/xform mcaffine_rat_rat2.xform
unset CMTK_NUM_THREADS
check_results xform
;;
mcwarp2)
# Test breaks when using multiple threads due to floating point effects
export CMTK_NUM_THREADS=1
run mcwarp --downsample-from 2 --downsample-to 1 --initial-step-size 1 --final-step-size 0.5 --grid-spacing 14 --refine-grid 2 --histograms -o ${tmpdir}/xform mcaffine_rat_rat2.xform
unset CMTK_NUM_THREADS
check_results xform
;;
mcwarp3)
# Test breaks when using multiple threads due to floating point effects
export CMTK_NUM_THREADS=1
run mcwarp --downsample-from 2 --downsample-to 1 --delta-f-threshold 0.1 --initial-step-size 1 --final-step-size 0.5 --grid-spacing 14 --refine-grid 2 --covariance -o ${tmpdir}/xform mcaffine_rat_rat2.xform
unset CMTK_NUM_THREADS
check_results xform
;;
mcwarp4)
# Test breaks when using multiple threads due to floating point effects
export CMTK_NUM_THREADS=1
run mcwarp --downsample-from 2 --downsample-to 1 --delta-f-threshold 0.1 --initial-step-size 1 --final-step-size 0.5 --grid-spacing 14 --refine-grid 2 --covariance --intensity-correction -o ${tmpdir}/xform mcaffine_rat_rat2.xform
unset CMTK_NUM_THREADS
check_results xform
;;
mcwarp5)
# Test breaks when using multiple threads due to floating point effects
export CMTK_NUM_THREADS=1
run mcwarp --downsample-from 2 --downsample-to 1 --delta-f-threshold 0.1 --initial-step-size 1 --final-step-size 0.5 --grid-spacing 14 --adaptive-fix-thresh-factor 0.5 -o ${tmpdir}/xform mcaffine_rat_rat2.xform
unset CMTK_NUM_THREADS
check_results xform
;;
mcwarp6)
# Test breaks when using multiple threads due to floating point effects
export CMTK_NUM_THREADS=1
run mcwarp --downsample-from 2 --downsample-to 1 --delta-f-threshold 0.1 --initial-step-size 1 --final-step-size 0.5 --grid-spacing 14 --adaptive-fix-thresh-factor-entropy 0.5 -o ${tmpdir}/xform mcaffine_rat_rat2.xform
unset CMTK_NUM_THREADS
check_results xform
;;
mk_adni_phantom2mm)
run mk_adni_phantom --resolution 2 ${tmpdir}/phantom.nii
check_results phantom.nii
;;
mk_adni_phantom2mmLabels)
run mk_adni_phantom --resolution 2 --write-labels ${tmpdir}/phantom.lbl --write-landmarks ${tmpdir}/phantom.xyz --labels ${tmpdir}/phantom.nii
check_results phantom.nii phantom.lbl phantom.xyz
;;
mk_analyze_hdrDefault)
run mk_analyze_hdr ${tmpdir}/analyze.hdr
run_eval "${BINDIR}/describe -m ${tmpdir}/analyze.hdr | fgrep --invert-match FNAME > ${tmpdir}/analyze.txt"
check_results analyze.hdr analyze.txt
;;
mk_analyze_hdrImport)
run mk_analyze_hdr --import spgr_3t.hdr ${tmpdir}/analyze.hdr
run_eval "${BINDIR}/describe -m ${tmpdir}/analyze.hdr | fgrep --invert-match FNAME > ${tmpdir}/analyze.txt"
check_results analyze.hdr analyze.txt
;;
mk_analyze_hdrLittleEndian)
run mk_analyze_hdr --description LittleEndian --little-endian --float --dims 100,200,300 --voxel 0.3,0.2,0.1 --offset 1024 ${tmpdir}/analyze.hdr
run_eval "${BINDIR}/describe -m ${tmpdir}/analyze.hdr | fgrep --invert-match FNAME > ${tmpdir}/analyze.txt"
check_results analyze.hdr analyze.txt
;;
mk_analyze_hdrBigEndian)
run mk_analyze_hdr --description BigEndian --big-endian --ushort --dims 100,200,300 --voxel 0.3,0.2,0.1 --offset 1024 ${tmpdir}/analyze.hdr
run_eval "${BINDIR}/describe -m ${tmpdir}/analyze.hdr | fgrep --invert-match FNAME > ${tmpdir}/analyze.txt"
check_results analyze.hdr analyze.txt
;;
mk_nifti_hdrDefault)
run mk_nifti_hdr ${tmpdir}/nifti.hdr
run_eval "${BINDIR}/describe -m ${tmpdir}/nifti.hdr | fgrep --invert-match FNAME > ${tmpdir}/nifti.txt"
check_results nifti.hdr nifti.txt
;;
mk_nifti_hdrDescription)
run_eval "${BINDIR}/mk_nifti_hdr --description \"This is a description text\" ${tmpdir}/nifti.hdr"
check_results nifti.hdr
;;
mk_nifti_hdrImport)
run mk_nifti_hdr --import phantom_ax.nii ${tmpdir}/nifti.hdr
run_eval "${BINDIR}/describe -m ${tmpdir}/nifti.hdr | fgrep --invert-match FNAME > ${tmpdir}/nifti.txt"
check_results nifti.hdr nifti.txt
;;
mk_nifti_hdrDefaultAttached)
run mk_nifti_hdr --attached ${tmpdir}/nifti.nii
run_eval "${BINDIR}/describe -m ${tmpdir}/nifti.nii | fgrep --invert-match FNAME > ${tmpdir}/nifti.txt"
check_results nifti.nii nifti.txt
;;
mk_nifti_hdrDescriptionAttached)
run_eval "${BINDIR}/mk_nifti_hdr --attached --description \"This is a description text\" ${tmpdir}/nifti.nii"
check_results nifti.nii
;;
mk_nifti_hdrImportAttached)
run mk_nifti_hdr --attached --import phantom_ax.nii ${tmpdir}/nifti.nii
run_eval "${BINDIR}/describe -m ${tmpdir}/nifti.nii | fgrep --invert-match FNAME > ${tmpdir}/nifti.txt"
check_results nifti.nii nifti.txt
;;
mk_phantom_3dBoxIndexed)
run mk_phantom_3d -o ${tmpdir}/phantom.nii --dims 10,10,10 --voxel 2,2,2 box 2,2,2 5,5,5 10
check_results phantom.nii
;;
mk_phantom_3dBoxIndexedRange)
run mk_phantom_3d -o ${tmpdir}/phantom.nii --dims 10,10,10 --voxel 2,2,2 box 11,11,11 5,5,5 10
check_results phantom.nii
;;
mk_phantom_3dBoxAbsolute)
run mk_phantom_3d --absolute -o ${tmpdir}/phantom.nii --dims 10,10,10 --voxel 1,1,1 box 2,2,2 5,5,5 10
check_results phantom.nii
;;
mk_phantom_3dBoxRelative)
run mk_phantom_3d --relative -o ${tmpdir}/phantom.nii --dims 10,10,10 --voxel 1,1,1 box 0.1,0.2,0.3 0.5,0.5,0.5 10
check_results phantom.nii
;;
mk_phantom_3dSphereIndexed)
run mk_phantom_3d --coordinates indexed -o ${tmpdir}/phantom.nii --dims 10,10,10 --voxel 1,1,1 sphere 7,7,7 5 20
check_results phantom.nii
;;
mk_phantom_3dSphereAbsolute)
run mk_phantom_3d --coordinates absolute -o ${tmpdir}/phantom.nii --dims 10,10,10 --voxel 1,1,1 sphere 7,7,7 5 20
check_results phantom.nii
;;
mk_phantom_3dSphereAbsolute2)
run mk_phantom_3d --coordinates absolute -o ${tmpdir}/phantom.nii --dims 10,10,10 --voxel 1,1,2 sphere 7,7,7 5 20
check_results phantom.nii
;;
mk_phantom_3dSphereRelative)
run mk_phantom_3d --coordinates relative -o ${tmpdir}/phantom.nii --dims 10,10,10 --voxel 1,1,1 sphere 0.5,0.4,0.3 0.4 20
check_results phantom.nii
;;
mk_phantom_3dSphereRelative2)
run mk_phantom_3d --coordinates relative -o ${tmpdir}/phantom.nii --dims 10,10,10 --voxel 1,1,2 sphere 0.5,0.4,0.3 0.4 20
check_results phantom.nii
;;
mk_phantom_3dBoxSphere)
run mk_phantom_3d -o ${tmpdir}/phantom.nii --char --bg 50 --dims 10,10,10 --voxel 1,1,1 sphere 7,7,7 5 20 box 2,2,2 5,5,5 10
check_results phantom.nii
;;
mk_phantom_3dImport)
run mk_phantom_3d -o ${tmpdir}/phantom.nii --import spgr_3t_mask.hdr sphere 30,40,30 20 0
check_results phantom.nii
;;
mk_phantom_3dImportGrid)
run mk_phantom_3d -o ${tmpdir}/phantom.nii --import-grid spgr_3t_mask.hdr sphere 30,40,30 20 10
check_results phantom.nii
;;
mk_phantom_3dMRSVoxel)
run mk_phantom_3d --echo -v --bg 0 -o ${tmpdir}/voxel.nii --import-grid ge-mrs/lfse.nii mrs-voxel ge-mrs/spectro.dcm 100
check_results voxel.nii
;;
mrbiasMulIncremental)
run mrbias --incremental -M 2 --write-bias-mul ${tmpdir}/bias_mul.hdr --thresh-min 100 spgr_3t.hdr ${tmpdir}/corrected.hdr
check_results corrected.img bias_mul.img
;;
mrbiasMulAutoThresh)
run mrbias -v -M 2 --set-padding-value 0 --thresh-auto spgr_3t.hdr ${tmpdir}/corrected.hdr
check_results corrected.img
;;
mrbiasMulOtsuThresh)
run mrbias -v -M 2 --set-padding-value 0 --thresh-otsu-nbins 256 spgr_3t.hdr ${tmpdir}/corrected.hdr
check_results corrected.img
;;
mrbiasMulLogIntensity)
run mrbias --log-intensities -M 2 --write-bias-mul ${tmpdir}/bias_mul.hdr --thresh-min 100 spgr_3t.hdr ${tmpdir}/corrected.hdr
check_results corrected.img bias_mul.img
;;
mrbiasAddMulMask)
export CMTK_NUM_THREADS=1
run mrbias -A 1 -M 2 --mask spgr_3t_mask.hdr --write-bias-add ${tmpdir}/bias_add.hdr --write-bias-mul ${tmpdir}/bias_mul.hdr spgr_3t.hdr ${tmpdir}/corrected.hdr
unset CMTK_NUM_THREADS
check_results corrected.img bias_mul.img bias_add.img
;;
mrbiasMulIncrementalCUDA)
run mrbias_cuda --incremental -M 2 --write-bias-mul ${tmpdir}/bias_mul.hdr --thresh-min 100 spgr_3t.hdr ${tmpdir}/corrected.hdr
check_results corrected.img bias_mul.img
;;
mrbiasMulLogIntensityCUDA)
run mrbias_cuda --log-intensities -M 2 --write-bias-mul ${tmpdir}/bias_mul.hdr --thresh-min 100 spgr_3t.hdr ${tmpdir}/corrected.hdr
check_results corrected.img bias_mul.img
;;
mrbiasAddMulMaskCUDA)
run mrbias_cuda -A 1 -M 2 --mask spgr_3t_mask.hdr --write-bias-add ${tmpdir}/bias_add.hdr --write-bias-mul ${tmpdir}/bias_mul.hdr spgr_3t.hdr ${tmpdir}/corrected.hdr
check_results corrected.img bias_mul.img bias_add.img
;;
overlap)
run_eval "${BINDIR}/overlap parc1.hdr parc2.hdr parc3.hdr > ${tmpdir}/overlap.txt"
check_results overlap.txt
;;
overlapNumLabels)
run_eval "${BINDIR}/overlap -N 2 parc1.hdr parc2.hdr parc3.hdr > ${tmpdir}/overlap.txt"
check_results overlap.txt
;;
overlapByLabel)
run_eval "${BINDIR}/overlap --by-label parc1.hdr parc2.hdr parc3.hdr > ${tmpdir}/overlap.txt"
check_results overlap.txt
;;
overlapFirst)
run_eval "${BINDIR}/overlap --first-label 10 parc1.hdr parc2.hdr parc3.hdr > ${tmpdir}/overlap.txt"
check_results overlap.txt
;;
overlapFirstByLabel)
run_eval "${BINDIR}/overlap --by-label --first-label 10 parc1.hdr parc2.hdr parc3.hdr > ${tmpdir}/overlap.txt"
check_results overlap.txt
;;
overlapFirstByLabelNumLabels)
run_eval "${BINDIR}/overlap --by-label --first-label 10 --num-labels 10 parc1.hdr parc2.hdr parc3.hdr > ${tmpdir}/overlap.txt"
check_results overlap.txt
;;
probeIndexed)
run_eval "echo 98 154 1 |${BINDIR}/probe --indexed phantom_ax.nii.gz > ${tmpdir}/probe.txt"
check_results probe.txt
;;
probeAbsolute)
run_eval "echo 91.875 144.375 3 |${BINDIR}/probe --absolute phantom_ax.nii.gz > ${tmpdir}/probe.txt"
check_results probe.txt
;;
probeRelative)
run_eval "echo 0.384313725 0.603921569 0.5 |${BINDIR}/probe --relative phantom_ax.nii.gz > ${tmpdir}/probe.txt"
check_results probe.txt
;;
probePhysical)
run_eval "echo -27.656 24.844 0 |${BINDIR}/probe --physical phantom_ax.nii.gz > ${tmpdir}/probe.txt"
check_results probe.txt
;;
probeIndexedLinear)
run_eval "echo 98.5 154.5 1 |${BINDIR}/probe --linear --indexed phantom_ax.nii.gz > ${tmpdir}/probe.txt"
check_results probe.txt
;;
probeIndexedCubic)
run_eval "echo 98.5 154.5 1 |${BINDIR}/probe --cubic --indexed phantom_ax.nii.gz > ${tmpdir}/probe.txt"
check_results probe.txt
;;
probeIndexedSinc)
run_eval "echo 98.5 154.5 1 |${BINDIR}/probe --sinc-cosine --indexed phantom_ax.nii.gz > ${tmpdir}/probe.txt"
check_results probe.txt
;;
pxsearchIndexed)
run_eval "echo 98 154 1 |${BINDIR}/pxsearch --input-coordinates indexed --output-coordinates indexed phantom_ax.nii.gz > ${tmpdir}/pxsearch.txt"
check_results pxsearch.txt
;;
pxsearchIndexedRadius3)
run_eval "echo 98 154 1 |${BINDIR}/pxsearch --radius 3 --input-coordinates indexed --output-coordinates indexed phantom_ax.nii.gz > ${tmpdir}/pxsearch.txt"
check_results pxsearch.txt
;;
pxsearchIndexedRadius311)
run_eval "echo 98 154 1 |${BINDIR}/pxsearch --radius 3,1,1 --input-coordinates indexed --output-coordinates indexed phantom_ax.nii.gz > ${tmpdir}/pxsearch.txt"
check_results pxsearch.txt
;;
pxsearchAbsolute)
run_eval "echo 91.875 144.375 3 |${BINDIR}/pxsearch --input-coordinates absolute --output-coordinates absolute phantom_ax.nii.gz > ${tmpdir}/pxsearch.txt"
check_results pxsearch.txt
;;
pxsearchRelative)
run_eval "echo 0.384313725 0.603921569 0.5 |${BINDIR}/pxsearch --input-coordinates relative --output-coordinates relative phantom_ax.nii.gz > ${tmpdir}/pxsearch.txt"
check_results pxsearch.txt
;;
pxsearchPhysical)
run_eval "echo -27.656 24.844 0 |${BINDIR}/pxsearch --input-coordinates physical --output-coordinates physical phantom_ax.nii.gz > ${tmpdir}/pxsearch.txt"
check_results pxsearch.txt
;;
reformatxNoXform)
run reformatx --linear -o ${tmpdir}/reformat.hdr --floating vol001_mr_t1.hdr vol001_mr_t0_crop.hdr
check_results reformat.img
;;
reformatxLinear)
run reformatx --linear -o ${tmpdir}/reformat.hdr --floating vol001_mr_t1.hdr vol001_mr_t0_crop.hdr vol001_mr_t0t1.list
check_results reformat.img
;;
reformatxNearestNeighbor)
run reformatx --nn -o ${tmpdir}/reformat.hdr --floating vol001_mr_t1.hdr vol001_mr_t0_crop.hdr vol001_mr_t0t1.list
check_results reformat.img
;;
reformatxPartialVolume)
run reformatx --pv -o ${tmpdir}/reformat.hdr --floating vol001_mr_t1.hdr vol001_mr_t0_crop.hdr vol001_mr_t0t1.list
check_results reformat.img
;;
reformatxLinearFwdBwd)
run reformatx --linear --short -o ${tmpdir}/reformat.hdr --floating vol001_mr_t0.hdr vol001_mr_t0.hdr vol001_mr_t0t1.list --inverse vol001_mr_t0t1.list
check_results vol001_mr_t0.img
;;
reformatxCubic)
run reformatx --cubic -o ${tmpdir}/reformat.hdr --floating vol001_mr_t1.hdr vol001_mr_t0_crop.hdr vol001_mr_t0t1.list
check_results reformat.img
;;
reformatxCubicInverse)
run reformatx --cubic -o ${tmpdir}/reformat.hdr --floating vol001_mr_t1.hdr vol001_mr_t0_crop.hdr --inverse vol001_mr_t0t1.list
check_results reformat.img
;;
reformatxSincCosine)
run reformatx --sinc-cosine -o ${tmpdir}/reformat.hdr --floating vol001_mr_t1.hdr vol001_mr_t0_crop.hdr vol001_mr_t0t1.list
check_results reformat.img
;;
reformatxSincHamming)
run reformatx --sinc-hamming -o ${tmpdir}/reformat.hdr --floating vol001_mr_t1.hdr vol001_mr_t0_crop.hdr vol001_mr_t0t1.list
check_results reformat.img
;;
reformatxSincCosine5)
run reformatx --sinc-cosine --sinc-window-radius 5 -o ${tmpdir}/reformat.hdr --floating vol001_mr_t1.hdr vol001_mr_t0_crop.hdr vol001_mr_t0t1.list
check_results reformat.img
;;
reformatxMassPreserving)
run reformatx --preserve-mass -o ${tmpdir}/reformat.hdr --floating vol001_mr_t1.hdr vol001_mr_t0.hdr vol001_mr_t0t1_warp.xform
check_results reformat.img
;;
reformatxJacobian)
run reformatx -o ${tmpdir}/jacobian.hdr vol001_mr_t0_crop.hdr vol001_mr_t0_crop.xform --jacobian vol001_mr_t0t1_warp.xform
check_results jacobian.img
;;
reformatxInverseJacobian)
run reformatx -o ${tmpdir}/jacobian.hdr vol001_mr_t0_crop.hdr vol001_mr_t0_crop.xform --jacobian --inverse vol001_mr_t0t1_warp.xform
check_results jacobian.img
;;
reformatxDfieldNrrd)
run reformatx -o ${tmpdir}/reformat.hdr --floating parc2.hdr parc1.hdr parc1_parc2_dfield.nrrd
check_results reformat.img
;;
reformatxDfieldNrrdJacobian)
run reformatx -o ${tmpdir}/jacobian.hdr vol001_mr_t0.hdr --jacobian vol001_mr_t0t1_dfield.nrrd
check_results jacobian.img
;;
reformatxTargetGrid)
run reformatx -o ${tmpdir}/reformat.nii --target-grid 32,43,21:5.625,5.625,7.5 --floating spgr_brain_1.hdr
check_results reformat.nii
;;
reformatxTargetGridAnalyze)
run reformatx -o ${tmpdir}/reformat.hdr --target-grid 32,43,21:5.625,5.625,7.5 --floating spgr_brain_1.hdr
check_results reformat.hdr reformat.img
;;
reformatxTargetGridOffset)
run reformatx -o ${tmpdir}/reformat.nii --target-grid 32,43,21:5.625,5.625,7.5:5.625,0,0 --floating spgr_brain_1.hdr
check_results reformat.nii
;;
registrationAffineMrMrMSD)
run registration -i --dofs 6,9 --msd --match-histograms -o ${tmpdir} pat001_mr_T1.hdr pat002_mr_T2.hdr
check_results registration
;;
registrationFromList)
run registration -v --dofs 0 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
registrationWithInitial)
run registration -v --dofs 0 -o ${tmpdir} --initial vol001_mr_t0t1.list vol001_mr_t0.hdr vol001_mr_t1.hdr
check_results registration
;;
registrationWithInitialInverse)
run registration -v --dofs 0 -o ${tmpdir} --initial vol001_mr_t0t1.list --initial-is-inverse vol001_mr_t0t1.list
check_results registration
;;
registrationAutoLevelsRat4)
run registration -v -i --auto-multi-levels 4 --dofs 6 -o ${tmpdir} rat_fse_erly.hdr rat_fse_late.hdr
check_results registration
;;
registrationAutoLevelsRat2)
run registration -v -i --auto-multi-levels 2 --dofs 6 -o ${tmpdir} rat_fse_erly.hdr rat_fse_late.hdr
check_results registration
;;
registrationAutoLevelsRatToRat)
run registration -v -i --auto-multi-levels 2 --dofs 6,9 --msd --match-histograms -o ${tmpdir} rat_fse_erly.hdr rat2_fse_erly.hdr
check_results registration
;;
registrationAutoLevelsRatToRatDeltaFThreshold)
run registration -v -i --auto-multi-levels 2 --dofs 6,9 --msd --match-histograms --delta-f-threshold 0.01 -o ${tmpdir} rat_fse_erly.hdr rat2_fse_erly.hdr
check_results registration
;;
registrationAutoLevelsCt3)
run registration --msd --auto-multi-levels 3 --dofs 6 -o ${tmpdir} pat002_ct.hdr pat002_ct.hdr
check_results registration
;;
registrationxAffineMrMrMSD)
run registrationx --init fov --dofs 6,9 --msd --match-histograms -o ${tmpdir} pat001_mr_T1.hdr pat002_mr_T2.hdr
check_results registration
;;
registrationxShearNoScaleMrMrMSD)
run registrationx --auto-multi-levels 4 --init fov --dofs 603 --msd --match-histograms -o ${tmpdir} pat001_mr_T1.hdr pat002_mr_T2.hdr
check_results registration
;;
registrationxFromList)
run registrationx -v --dofs 0 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
registrationxWithInitial)
run registrationx -v --dofs 0 -o ${tmpdir} --initial vol001_mr_t0t1.list vol001_mr_t0.hdr vol001_mr_t1.hdr
check_results registration
;;
registrationxWithInitialInverse)
run registrationx -v --dofs 0 -o ${tmpdir} --initial vol001_mr_t0t1.list --initial-is-inverse vol001_mr_t0t1.list
check_results registration
;;
registrationxFromListDB)
run registrationx --db ${tmpdir}/db.sqlite -v --dofs 0 -o ${tmpdir} vol001_mr_t0t1.list
;;
registrationxWithInitialDB)
run registrationx --db ${tmpdir}/db.sqlite -v --dofs 0 -o ${tmpdir} --initial vol001_mr_t0t1.list vol001_mr_t0.hdr vol001_mr_t1.hdr
;;
registrationxWithInitialInverseDB)
run registrationx --db ${tmpdir}/db.sqlite -v --dofs 0 -o ${tmpdir} --initial vol001_mr_t0t1.list --initial-is-inverse vol001_mr_t0t1.list
;;
registrationxAutoLevelsRat4)
run registrationx -v --auto-multi-levels 4 --dofs 6 -o ${tmpdir} --write-itk ${tmpdir}/xform.tfm rat_fse_erly.hdr rat_fse_late.hdr
check_results registration xform.tfm
;;
registrationxAutoLevelsRat4XY)
run registrationx -v --restrict-in-plane xy --auto-multi-levels 4 --dofs 6,9,12 -o ${tmpdir} rat_fse_erly.hdr rat2_fse_late.hdr
check_results registration
;;
registrationxAutoLevelsRat4XZ)
run registrationx -v --restrict-in-plane xz --auto-multi-levels 4 --dofs 6,9,12 -o ${tmpdir} rat_fse_erly.hdr rat2_fse_late.hdr
check_results registration
;;
registrationxAutoLevelsRat4YZ)
run registrationx -v --restrict-in-plane yz --auto-multi-levels 4 --dofs 6,9,12 -o ${tmpdir} rat_fse_erly.hdr rat2_fse_late.hdr
check_results registration
;;
registrationxAutoLevelsRat4Symmetric)
run registrationx -v --symmetric --auto-multi-levels 4 --dofs 6 -o ${tmpdir} rat_fse_erly.hdr rat_fse_late.hdr
check_results registration
;;
registrationxAutoLevelsRat4NONE)
run registrationx -v --init none --auto-multi-levels 4 --dofs 6 -o ${tmpdir} rat_fse_erly.hdr rat_fse_late.hdr
check_results registration
;;
registrationxAutoLevelsRat4FOV)
run registrationx -v --init fov --auto-multi-levels 4 --dofs 6 -o ${tmpdir} rat_fse_erly.hdr rat_fse_late.hdr
check_results registration
;;
registrationxAutoLevelsRat4COM)
run registrationx -v --init com --auto-multi-levels 4 --dofs 6 -o ${tmpdir} rat_fse_erly.hdr rat_fse_late.hdr
check_results registration
;;
registrationxAutoLevelsRat4PAX)
run registrationx -v --init pax --auto-multi-levels 4 --dofs 6 -o ${tmpdir} rat_fse_erly.hdr rat_fse_late.hdr
check_results registration
;;
registrationxAutoLevelsRat2)
run registrationx -v --init fov --auto-multi-levels 2 --dofs 6 -o ${tmpdir} rat_fse_erly.hdr rat_fse_late.hdr
check_results registration
;;
registrationxAutoLevelsRat2Cubic)
run registrationx -v --cubic --init fov --auto-multi-levels 2 --dofs 6 -o ${tmpdir} rat_fse_erly.hdr rat_fse_late.hdr
check_results registration
;;
registrationxAutoLevelsRat2Sinc)
run registrationx -v --cosine-sinc --init fov --auto-multi-levels 2 --dofs 6 -o ${tmpdir} rat_fse_erly.hdr rat_fse_late.hdr
check_results registration
;;
registrationxAutoLevelsRat2NN)
run registrationx -v --nearest-neighbor --init fov --auto-multi-levels 2 --dofs 6 -o ${tmpdir} rat_fse_erly.hdr rat_fse_late.hdr
check_results registration
;;
registrationxAutoLevelsRatToRat)
export CMTK_NUM_THREADS=1
run registrationx -v --init fov --auto-multi-levels 2 --dofs 6,9 --msd --match-histograms -o ${tmpdir} rat_fse_erly.hdr rat2_fse_erly.hdr
unset CMTK_NUM_THREADS
check_results registration
;;
registrationxAutoLevelsRatToRatNCC)
run registrationx -v --init fov --auto-multi-levels 2 --ncc -o ${tmpdir} rat_fse_erly.hdr rat2_fse_erly.hdr
check_results registration
;;
registrationxAutoLevelsRatToRatRMS)
run registrationx -v --init fov --auto-multi-levels 2 --rms -o ${tmpdir} rat_fse_erly.hdr rat2_fse_erly.hdr
check_results registration
;;
registrationxAutoLevelsRatToRatCR)
run registrationx -v --init fov --auto-multi-levels 2 --cr -o ${tmpdir} rat_fse_erly.hdr rat2_fse_erly.hdr
check_results registration
;;
registrationxAutoLevelsRatToRatMI)
run registrationx -v --init fov --auto-multi-levels 2 --mi -o ${tmpdir} rat_fse_erly.hdr rat2_fse_erly.hdr
check_results registration
;;
registrationxAutoLevelsRatToRatDeltaFThreshold)
export CMTK_NUM_THREADS=1
run registrationx -v --init fov --auto-multi-levels 2 --dofs 6,9 --msd --match-histograms --delta-f-threshold 0.01 -o ${tmpdir} rat_fse_erly.hdr rat2_fse_erly.hdr
unset CMTK_NUM_THREADS
check_results registration
;;
registrationxAutoLevelsCt3)
run registrationx --pad-flt -10000 --write-reformatted ${tmpdir}/reformat.nii --msd --auto-multi-levels 3 --dofs 6 -o ${tmpdir} pat002_ct.hdr pat002_ct.hdr
check_results registration reformat.nii
;;
registrationxAutoLevelsLabelsNN)
run registrationx -v --interpolation nearest-neighbor --class-ref label --class-flt label --auto-multi-levels 4 --dofs 6,9 --nmi -o ${tmpdir} parc1.hdr parc2.hdr
check_results registration
;;
registrationxAutoLevelsLabelsPV)
run registrationx -v --interpolation partial-volume --class-ref label --class-flt label --auto-multi-levels 4 --dofs 6,9 --nmi -o ${tmpdir} parc1.hdr parc2.hdr
check_results registration
;;
reorientHdrSaToAx)
run reorient -o RAS phantom_sa.hdr ${tmpdir}/reorient.hdr
check_results reorient.hdr reorient.img
;;
reorientHdrSaToAxNifti)
run reorient -i RAS -o RAS phantom_sa.hdr ${tmpdir}/reorient.nii
check_results reorient.nii
;;
reorientHdrCoToAx)
run reorient -o RAS phantom_co.hdr ${tmpdir}/reorient.hdr
check_results reorient.hdr reorient.img
;;
reorientHdrAxToSa)
run reorient -o ASL phantom_ax.hdr ${tmpdir}/reorient.hdr
check_results reorient.hdr reorient.img
;;
reorientHdrCoToSa)
run reorient -o ASL phantom_co.hdr ${tmpdir}/reorient.hdr
check_results reorient.hdr reorient.img
;;
reorientHdrAxToCo)
run reorient -o LSA phantom_ax.hdr ${tmpdir}/reorient.hdr
check_results reorient.hdr reorient.img
;;
reorientHdrSaToCo)
run reorient -o LSA phantom_sa.hdr ${tmpdir}/reorient.hdr
check_results reorient.hdr reorient.img
;;
reorientNrrdToNrrd)
run reorient vol001_mr_t0_crop.nrrd ${tmpdir}/vol001_mr_t0_crop.nhdr
check_results vol001_mr_t0_crop.nhdr vol001_mr_t0_crop.raw
;;
reorientNrrdToNrrdRAS)
run reorient --output-orientation RAS vol001_mr_t0_crop.nrrd ${tmpdir}/vol001_mr_t0_crop.nhdr
check_results vol001_mr_t0_crop.nhdr vol001_mr_t0_crop.raw
;;
reorientNrrdToNrrdSpaceLPS)
run reorient --output-space LPS vol001_mr_t0_crop.nrrd ${tmpdir}/vol001_mr_t0_crop.nhdr
check_results vol001_mr_t0_crop.nhdr vol001_mr_t0_crop.raw
;;
registrationRigidMrPet)
run registration -i --dofs 6 -o ${tmpdir} pat001_mr_T1.hdr pat001_pet.hdr
check_results registration
;;
registrationRigidMrCt)
run registration -i --dofs 6 -o ${tmpdir} pat002_mr_T2.hdr pat002_ct.hdr
check_results registration
;;
registrationRigidCt)
run registration --msd -i --dofs 6 -o ${tmpdir} pat002_ct.hdr pat002_ct.hdr
check_results registration
;;
registrationRigidPetMr)
run registration -i --dofs 6 -o ${tmpdir} pat001_pet.hdr pat001_mr_T1.hdr
check_results registration
;;
registrationRigidCtMr)
run registration -i --dofs 6 -o ${tmpdir} pat002_ct.hdr pat002_mr_T2.hdr
check_results registration
;;
registrationRigidMrPetNoSwap)
run registration --no-switch -i --dofs 6 -o ${tmpdir} pat001_mr_T1.hdr pat001_pet.hdr
check_results registration
;;
registrationRigidMrCtNoSwap)
run registration --no-switch -i --dofs 6 -o ${tmpdir} pat002_mr_T2.hdr pat002_ct.hdr
check_results registration
;;
registrationRigidPetMrDOF9)
run registration -i --dofs 9 -o ${tmpdir} pat001_pet.hdr pat001_mr_T1.hdr
check_results registration
;;
registrationRigidCtMrDOF7)
run registration -i --dofs 7 -o ${tmpdir} pat002_ct.hdr pat002_mr_T2.hdr
check_results registration
;;
registrationRigidLabelsDOF69)
run registration --dofs 6 --dofs 9 --class-ref label --class-flt label -o ${tmpdir} parc1.hdr parc2.hdr
check_results registration
;;
registrationRigidCrop)
run registration -v -i -e 2.0 -a 0.125 --sampling 0.25 --crop-index-ref 17,20,0,47,49,12 --crop-index-flt 12,15,0,52,54,12 --dofs 6 -o ${tmpdir} rat_fse_erly.hdr rat_fse_late.hdr
check_results registration
;;
sbaDefault)
run sba -o ${tmpdir}/sba.nii -n 255 parc1.hdr parc2.hdr parc3.hdr
check_results sba.nii
;;
sbaOutliers)
run sba --exclude-outliers -o ${tmpdir}/sba.nii -n 255 parc1.hdr parc1.hdr parc1.hdr parc1.hdr parc1.hdr parc2.hdr
check_results sba.nii
;;
sbaOutliers2)
run sba --exclude-outliers -o ${tmpdir}/sba.nii -n 255 parc1.hdr parc2.hdr parc3.hdr
check_results sba.nii
;;
sbaiDefault)
run sbai -o ${tmpdir}/sbai.nii -n 255 parc12_warp.xform parc13_warp.xform
check_results sbai.nii
;;
sequenceDefault)
run_eval "cat numbers.txt | ${BINDIR}/sequence > ${tmpdir}/sequence.txt"
check_results sequence.txt
;;
sequenceFormat)
run_eval "cat numbers.txt | ${BINDIR}/sequence --format %g > ${tmpdir}/sequence.txt"
check_results sequence.txt
;;
sequenceThresh)
run_eval "cat numbers.txt | ${BINDIR}/sequence --thresh 1e4 > ${tmpdir}/sequence.txt"
check_results sequence.txt
;;
sequenceAbs)
run_eval "cat numbers.txt | ${BINDIR}/sequence --abs > ${tmpdir}/sequence.txt"
check_results sequence.txt
;;
sequenceAbsThresh)
run_eval "cat numbers.txt | ${BINDIR}/sequence --thresh 1000 --abs > ${tmpdir}/sequence.txt"
check_results sequence.txt
;;
similarityGrey)
run_eval "${BINDIR}/similarity --histogram-text-file ${tmpdir}/histogram.txt rat_fse_erly.hdr rat_fse_late.hdr > ${tmpdir}/similarity.txt"
check_results histogram.txt similarity.txt
;;
similarityWithInf)
run_eval "${BINDIR}/similarity float_with_inf.nii.gz float_with_inf.nii.gz > ${tmpdir}/similarity.txt"
check_results similarity.txt
;;
similarityLabels)
run_eval "${BINDIR}/similarity --labels --histogram-text-file ${tmpdir}/histogram.txt parc1.hdr parc2.hdr > ${tmpdir}/similarity.txt"
check_results histogram.txt similarity.txt
;;
similarityGreyMask)
run_eval "${BINDIR}/similarity --mask rat_fse_erly.hdr --histogram-text-file ${tmpdir}/histogram.txt rat_fse_erly.hdr rat_fse_late.hdr > ${tmpdir}/similarity.txt"
check_results histogram.txt similarity.txt
;;
similarityLabelsMask)
run_eval "${BINDIR}/similarity --mask parc3_bin.hdr --labels --histogram-text-file ${tmpdir}/histogram.txt parc1.hdr parc2.hdr > ${tmpdir}/similarity.txt"
check_results histogram.txt similarity.txt
;;
splitAxial)
run split --output-xform-path ${tmpdir}/split_ax_%1d.xform --axial spgr_3t.hdr ${tmpdir}/split_ax_%1d.hdr
check_results split_ax_0.img split_ax_1.img split_ax_0.xform split_ax_1.xform
;;
splitAxialSlices)
run split --factor 0 --axial phantom_ax_downsampled.nii ${tmpdir}/slice_%1d.nii
check_results slice_0.nii slice_1.nii slice_2.nii
;;
splitAxialNrrd)
run split --axial --factor 3 spgr_3t.hdr ${tmpdir}/split_ax_%1d.nhdr
check_results split_ax_0.nhdr split_ax_0.raw split_ax_1.nhdr split_ax_1.raw split_ax_2.nhdr split_ax_2.raw
;;
splitSagittal2)
run split --output-xform-path ${tmpdir}/split_sa_%1d.xform --factor 2 --sagittal spgr_3t.hdr ${tmpdir}/split_sa_%1d.hdr
check_results split_sa_0.img split_sa_1.img split_sa_0.xform split_sa_1.xform
;;
splitCoronal3)
run split --output-xform-path ${tmpdir}/split_co_%1d.xform --factor 3 --coronal spgr_3t.hdr ${tmpdir}/split_co_%1d.hdr
check_results split_co_0.img split_co_1.img split_co_2.img split_co_0.xform split_co_1.xform split_co_2.xform
;;
statisticsGrey)
run_eval "${BINDIR}/statistics spgr_3t.hdr > ${tmpdir}/statistics.txt"
check_results statistics.txt
;;
statisticsPercentiles)
run_eval "${BINDIR}/statistics -p 0.1 --percentile 0.5 -p 0.75 spgr_3t.hdr > ${tmpdir}/statistics.txt"
check_results statistics.txt
;;
statisticsGreyColumn)
run_eval "${BINDIR}/statistics -C spgr_3t.hdr > ${tmpdir}/statistics.txt"
check_results statistics.txt
;;
statisticsGreyExpNotation)
run_eval "${BINDIR}/statistics -E spgr_3t.hdr > ${tmpdir}/statistics.txt"
check_results statistics.txt
;;
statisticsGreyMask)
run_eval "${BINDIR}/statistics -m spgr_3t_mask.hdr spgr_3t.hdr > ${tmpdir}/statistics.txt"
check_results statistics.txt
;;
statisticsGreyMultiMask)
run_eval "${BINDIR}/statistics -M spgr_3t_mask.hdr spgr_3t.hdr > ${tmpdir}/statistics.txt"
check_results statistics.txt
;;
statisticsMaskMismatch)
run_eval "${BINDIR}/statistics -M parc1.hdr spgr_3t.hdr > ${tmpdir}/statistics.txt"
check_results statistics.txt
;;
statisticsLabels)
run_eval "${BINDIR}/statistics -l parc1.hdr > ${tmpdir}/statistics.txt"
check_results statistics.txt
;;
statisticsLabelsAllUpToHi)
run_eval "${BINDIR}/statistics --mask-output-all-up-to 256 -l parc1.hdr > ${tmpdir}/statistics.txt"
check_results statistics.txt
;;
statisticsLabelsAllUpToLo)
run_eval "${BINDIR}/statistics --mask-output-all-up-to 2 -l parc1.hdr > ${tmpdir}/statistics.txt"
check_results statistics.txt
;;
streamxformFordwardBackward)
run_eval "cat vol001_t0_points.xyzl | ${BINDIR}/streamxform vol001_mr_t0t1_warp.xform --inverse vol001_mr_t0t1_warp.xform > ${tmpdir}/vol001_t0_points.xyzl"
check_results vol001_t0_points.xyzl
;;
streamxformAffineForward)
run_eval "cat vol001_t0_points.xyzl | ${BINDIR}/streamxform --affine-only vol001_mr_t0t1_warp.xform > ${tmpdir}/vol001_t1_points.xyzl"
check_results vol001_t1_points.xyzl
;;
streamxformAffineForwardBackward)
run_eval "cat vol001_t0_points.xyzl | ${BINDIR}/streamxform --affine-only vol001_mr_t0t1_warp.xform --inverse vol001_mr_t0t1_warp.xform > ${tmpdir}/vol001_t0_points.xyzl"
check_results vol001_t0_points.xyzl
;;
streamxformFordwardBackwardTolerance)
run_eval "cat vol001_t0_points.xyzl | ${BINDIR}/streamxform --inversion-tolerance 0.1 vol001_mr_t0t1_warp.xform --inverse vol001_mr_t0t1_warp.xform > ${tmpdir}/vol001_t0_points.xyzl"
check_results vol001_t0_points.xyzl
;;
streamxformAffine)
run_eval "cat vol001_t0_points.xyzl | ${BINDIR}/streamxform vol001_mr_t0t1.list > ${tmpdir}/vol001_t0_points.xyzl"
check_results vol001_t0_points.xyzl
;;
streamxformAffineFromTo)
run_eval "cat vol001_t0_points.xyzl | ${BINDIR}/streamxform --source-image vol001_mr_t0.hdr --target-image vol001_mr_t1.hdr vol001_mr_t0t1.list > ${tmpdir}/vol001_t0_points.xyzl"
check_results vol001_t0_points.xyzl
;;
symmetry_plane)
run sympl --sampling 1 --levels 4 --accuracy 0.1 --write-xform ${tmpdir}/xform --sinc --write-subtract ${tmpdir}/subtract.hdr --write-marked ${tmpdir}/marked.nii --write-mirror ${tmpdir}/mirror.nii -o ${tmpdir}/parameters cad001_ct.hdr
check_results parameters xform subtract.img marked.nii mirror.nii
;;
symmetry_planeThresh)
run sympl --sampling 1 --levels 4 --accuracy 0.1 --min-value -224 --max-value 176 --cubic --write-aligned ${tmpdir}/aligned.hdr -o ${tmpdir}/parameters cad001_ct.hdr
check_results parameters aligned.img
;;
symplx_Default)
run symplx --sampling 1 --levels 4 --accuracy 0.1 --write-xform ${tmpdir}/xform --sinc --write-subtract ${tmpdir}/subtract.hdr --write-marked ${tmpdir}/marked.nii --write-mirror ${tmpdir}/mirror.nii -o ${tmpdir}/parameters cad001_ct.hdr
check_results parameters xform subtract.img marked.nii mirror.nii
;;
symplx_Thresh)
run symplx --sampling 1 --levels 4 --accuracy 0.1 --min-value -224 --max-value 176 --cubic --write-aligned ${tmpdir}/aligned.hdr -o ${tmpdir}/parameters cad001_ct.hdr
check_results parameters aligned.img
;;
symplx_FixOffset)
run symplx --sampling 1 --levels 4 --accuracy 0.1 --fix-offset --cubic --write-aligned ${tmpdir}/aligned.hdr -o ${tmpdir}/parameters cad001_ct.hdr
check_results parameters aligned.img
;;
symplx_DefaultCUDA)
run symplx_cuda --sampling 1 --levels 4 --accuracy 0.1 --write-xform ${tmpdir}/xform --sinc --write-subtract ${tmpdir}/subtract.hdr -o ${tmpdir}/parameters cad001_ct.hdr
check_results parameters xform subtract.img
;;
symplx_ThreshCUDA)
run symplx_cuda --sampling 1 --levels 4 --accuracy 0.1 --min-value -224 --max-value 176 --cubic --write-aligned ${tmpdir}/aligned.hdr -o ${tmpdir}/parameters cad001_ct.hdr
check_results parameters aligned.img
;;
symplx_FixOffsetCUDA)
run symplx_cuda --sampling 1 --levels 4 --accuracy 0.1 --fix-offset --cubic --write-aligned ${tmpdir}/aligned.hdr -o ${tmpdir}/parameters cad001_ct.hdr
check_results parameters aligned.img
;;
ttestDefault)
run ttest -o ${tmpdir}/ttest.hdr --tstats-file ${tmpdir}/tstats.hdr jacobian-01.nii jacobian-02.nii -- jacobian-03.nii jacobian-04.nii
check_results ttest.img tstats.img
;;
ttestOneSided)
run ttest -o ${tmpdir}/ttest.hdr --tstats-file ${tmpdir}/tstats.hdr jacobian-01.nii jacobian-02.nii jacobian-03.nii jacobian-04.nii
check_results ttest.img tstats.img
;;
ttestSymmetric)
run ttest -o ${tmpdir}/ttest.hdr --tstats-file ${tmpdir}/tstats.hdr --symmetric jacobian-01.nii jacobian-02.nii jacobian-03.nii jacobian-04.nii
check_results ttest.img tstats.img
;;
ttestLog)
run ttest --log -o ${tmpdir}/ttest.hdr --tstats-file ${tmpdir}/tstats.hdr jacobian-01.nii jacobian-02.nii -- jacobian-03.nii jacobian-04.nii
check_results ttest.img tstats.img
;;
ttestAbsLog)
run ttest --abs --log -o ${tmpdir}/ttest.hdr --tstats-file ${tmpdir}/tstats.hdr jacobian-01.nii jacobian-02.nii -- jacobian-03.nii jacobian-04.nii
check_results ttest.img tstats.img
;;
ttestInvert)
run ttest --invert -o ${tmpdir}/ttest.hdr --tstats-file ${tmpdir}/tstats.hdr jacobian-01.nii jacobian-02.nii -- jacobian-03.nii jacobian-04.nii
check_results ttest.img tstats.img
;;
ttestPaired)
run ttest --paired -o ${tmpdir}/ttest.hdr --tstats-file ${tmpdir}/tstats.hdr jacobian-01.nii jacobian-02.nii -- jacobian-03.nii jacobian-04.nii
check_results ttest.img tstats.img
;;
ttestCrossCorrelation)
run ttest --cross-correlation -o ${tmpdir}/ttest.hdr --tstats-file ${tmpdir}/pvals.hdr jacobian-01.nii jacobian-02.nii jacobian-03.nii -- jacobian-04.nii jacobian-03.nii jacobian-02.nii
check_results ttest.img pvals.img
;;
ttestZScores)
run ttest --zscores -o ${tmpdir}/zscores.hdr jacobian-01.nii jacobian-02.nii -- jacobian-03.nii jacobian-04.nii
check_results zscores.img
;;
ttestMask)
run ttest --mask jacobian-mask.nii -o ${tmpdir}/ttest.hdr --tstats-file ${tmpdir}/tstats.hdr jacobian-01.nii jacobian-02.nii -- jacobian-03.nii jacobian-04.nii
check_results ttest.img tstats.img
;;
unsplitHdrAx)
run unsplit --axial -o ${tmpdir}/unsplit.hdr split_ax_0.hdr split_ax_1.hdr
check_results unsplit.hdr unsplit.img
;;
unsplitHdrSa)
run unsplit --sagittal -o ${tmpdir}/unsplit.hdr split_sa_0.hdr split_sa_1.hdr
check_results unsplit.hdr unsplit.img
;;
unsplitHdrCo)
run unsplit --coronal -o ${tmpdir}/unsplit.hdr split_co_0.hdr split_co_1.hdr split_co_2.hdr
check_results unsplit.hdr unsplit.img
;;
unsplitHdrNrrdAx)
run unsplit --axial -o ${tmpdir}/unsplit.nhdr split_ax_0.hdr split_ax_1.hdr
check_results unsplit.nhdr unsplit.raw
;;
unsplitHdrNrrdSa)
run unsplit --sagittal -o ${tmpdir}/unsplit.nhdr split_sa_0.hdr split_sa_1.hdr
check_results unsplit.nhdr unsplit.raw
;;
unsplitHdrNrrdCo)
run unsplit --coronal -o ${tmpdir}/unsplit.nhdr split_co_0.hdr split_co_1.hdr split_co_2.hdr
check_results unsplit.nhdr unsplit.raw
;;
unsplitNrrdNrrd)
run unsplit --axial -o ${tmpdir}/unsplit.nhdr split_ax_0.nhdr split_ax_1.nhdr split_ax_2.nhdr
check_results unsplit.nhdr unsplit.raw
;;
unsplitSlices)
run unsplit --axial -o ${tmpdir}/unsplit.nii phantom_ax_downsampled_slice_0.nii phantom_ax_downsampled_slice_1.nii phantom_ax_downsampled_slice_2.nii
check_results unsplit.nii
;;
unwarp_image_phantomSpacing)
run unwarp_image_phantom --iterations-per-level 1 --final-cp-spacing 80 magphan.xml spgr_magphan.nii ${tmpdir}/ffd.xform
check_results ffd.xform
;;
unwarp_image_phantomSpacingInverse)
run unwarp_image_phantom --iterations-per-level 1 --final-cp-spacing 80 --fit-inverse magphan.xml spgr_magphan.nii ${tmpdir}/ffd.xform
check_results ffd.xform
;;
unwarp_image_phantomSpacingLevels)
run unwarp_image_phantom --iterations-per-level 1 --final-cp-spacing 80 --levels 3 magphan.xml spgr_magphan.nii ${tmpdir}/ffd.xform
check_results ffd.xform
;;
unwarp_image_phantomSpacingDirect)
run unwarp_image_phantom --iterations-per-level 1 --no-fit-affine --final-cp-spacing 80 magphan.xml spgr_magphan.nii ${tmpdir}/ffd.xform
check_results ffd.xform
;;
unwarp_image_phantomDims)
run unwarp_image_phantom --iterations-per-level 1 --final-cp-dims 5,5,5 magphan.xml spgr_magphan.nii ${tmpdir}/ffd.xform
check_results ffd.xform
;;
unwarp_image_phantomDimsLevels)
run unwarp_image_phantom --iterations-per-level 1 --final-cp-dims 5,5,5 --levels 3 magphan.xml spgr_magphan.nii ${tmpdir}/ffd.xform
check_results ffd.xform
;;
unwarp_image_phantomDimsLevelsIterations)
run unwarp_image_phantom --iterations-per-level 10 --final-cp-dims 5,5,5 --levels 3 magphan.xml spgr_magphan.nii ${tmpdir}/ffd.xform
check_results ffd.xform
;;
unwarp_image_phantomDimsLevelsThreshold)
run unwarp_image_phantom --iterations-per-level 1 --rms-threshold 0.1 --final-cp-dims 5,5,5 --levels 3 magphan.xml spgr_magphan.nii ${tmpdir}/ffd.xform
check_results ffd.xform
;;
unwarp_image_phantomDimsLevelsIterationsThreshold)
run unwarp_image_phantom --iterations-per-level 10 --rms-threshold 0.1 --final-cp-dims 5,5,5 --levels 3 magphan.xml spgr_magphan.nii ${tmpdir}/ffd.xform
check_results ffd.xform
;;
unwarp_image_phantomDimsDefault)
run unwarp_image_phantom --final-cp-dims 5,5,5 magphan.xml spgr_magphan.nii ${tmpdir}/ffd.xform
check_results ffd.xform
;;
volume_injection)
run volume_injection --recon-grid-path spgr_3t.hdr -o ${tmpdir}/injection.hdr --injection-kernel-sigma 0.5 --injection-kernel-radius 2 split_ax_0.hdr split_ax_01.xform split_ax_1.hdr
check_results injection.img
;;
volume_injectionReconGrid)
run volume_injection --recon-grid 49,65,35:3.75,3.75,3.75 -o ${tmpdir}/injection.nii --injection-kernel-sigma 0.5 --injection-kernel-radius 2 split_ax_0.hdr split_ax_01.xform split_ax_1.hdr
check_results injection.nii
;;
volume_injectionReconGridOffset)
run volume_injection --recon-grid 48,64,34:3.75,3.75,3.75:1.875,1.875,1.875 -o ${tmpdir}/injection.nii --injection-kernel-sigma 0.5 --injection-kernel-radius 2 split_ax_0.hdr split_ax_01.xform split_ax_1.hdr
check_results injection.nii
;;
volume_injectionIsotropic)
run volume_injection --recon-grid-path spgr_3t.hdr -o ${tmpdir}/injection.hdr --injection-kernel-sigma 0.5 --injection-kernel-radius 2 --isotropic-injection split_ax_0.hdr split_ax_01.xform split_ax_1.hdr
check_results injection.img
;;
volume_injectionNoXform)
run volume_injection -o ${tmpdir}/injection.hdr --injection-kernel-sigma 0.5 --injection-kernel-radius 2 --exclude-first-image spgr_3t.hdr -- split_ax_0.hdr split_ax_01.xform split_ax_1.hdr
check_results injection.img
;;
volume_injectionNoXformIsotropic)
run volume_injection -o ${tmpdir}/injection.hdr --injection-kernel-sigma 0.5 --injection-kernel-radius 2 --isotropic-injection --exclude-first-image spgr_3t.hdr -- split_ax_0.hdr split_ax_01.xform split_ax_1.hdr
check_results injection.img
;;
volume_reconstructionFourthOrder)
run volume_reconstruction --recon-grid-path spgr_3t.hdr -o ${tmpdir}/reconstruction.hdr --linear --fourth-order-error --num-iterations 2 --injection-kernel-sigma 0.5 --injection-kernel-radius 2 --isotropic-injection --write-injected-image ${tmpdir}/injection.hdr split_ax_0.hdr split_ax_01.xform split_ax_1.hdr
check_results injection.img reconstruction.img
;;
volume_reconstructionCubic)
run volume_reconstruction --recon-grid-path spgr_3t.hdr -o ${tmpdir}/reconstruction.hdr --cubic --num-iterations 2 --injection-kernel-sigma 0.5 --injection-kernel-radius 2 --isotropic-injection --write-injected-image ${tmpdir}/injection.hdr split_ax_0.hdr split_ax_01.xform split_ax_1.hdr
check_results injection.img reconstruction.img
;;
volume_reconstructionNoXform)
run volume_reconstruction -o ${tmpdir}/reconstruction.hdr --linear --num-iterations 2 --injection-kernel-sigma 0.5 --injection-kernel-radius 2 --isotropic-injection --write-injected-image ${tmpdir}/injection.hdr --exclude-first-image spgr_3t.hdr -- split_ax_0.hdr split_ax_01.xform split_ax_1.hdr
check_results injection.img reconstruction.img
;;
volume_reconstructionBoxPSF)
run volume_reconstruction --recon-grid-path spgr_3t.hdr -o ${tmpdir}/reconstruction.hdr --deblurring box --psf 0.9375,0.9375,1.25 --num-iterations 2 --injection-kernel-sigma 0.5 --injection-kernel-radius 2 split_ax_0.hdr split_ax_01.xform split_ax_1.hdr
check_results reconstruction.img
;;
volume_reconstructionGaussianPSF)
run volume_reconstruction --recon-grid-path spgr_3t.hdr -o ${tmpdir}/reconstruction.hdr --deblurring gaussian --psf 0.9375,0.9375,1.25 --num-iterations 2 --injection-kernel-sigma 0.5 --injection-kernel-radius 2 split_ax_0.hdr split_ax_01.xform split_ax_1.hdr
check_results reconstruction.img
;;
warpSingleLevel)
run warp --fast --exploration 8 --grid-spacing 160 --accuracy 1 --no-adaptive-fix -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpSingleLevelExact)
run warp --fast --exploration 8 --grid-spacing 180 --exact-spacing --accuracy 1 --sampling 3 --no-adaptive-fix -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpInverseConsistentCC)
run warp --fast --exploration 8 --grid-spacing 80 --accuracy 1 --ncc --ic-weight 1e-2 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpMultiLevel)
run warp --fast --exploration 8 --grid-spacing 160 --accuracy 1 --refine 1 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpMultiLevelMatchHistograms)
run warp --fast --exploration 8 --match-histograms --msd --grid-spacing 160 --accuracy 1 --refine 1 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpMultiLevelDeltaFThreshold)
run warp --fast --exploration 8 --delta-f-threshold 0.01 --msd --grid-spacing 160 --accuracy 1 --refine 1 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpMultiLevelExact)
run warp --fast --exploration 8 --grid-spacing 160 --exact-spacing --accuracy 1 --refine 1 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpDelayRefine)
run warp --fast --exploration 12 --grid-spacing 160 --accuracy 2 --refine 1 --delay-refine --sampling 6 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpEnergy)
run warp --fast --exploration 8 --grid-spacing 160 --accuracy 1 --refine 1 --energy-weight 1e-1 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpEnergyRelax)
run warp --fast --exploration 8 --grid-spacing 160 --accuracy 1 --refine 1 --energy-weight 1e-1 --relax 1e-2 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpJacobian)
export CMTK_NUM_THREADS=1
run warp --fast --exploration 12 --grid-spacing 160 --accuracy 2 --refine 1 --jacobian-weight 1e-1 --sampling 12 --omit-original-data -o ${tmpdir} vol001_mr_t0t1.list
unset CMTK_NUM_THREADS
check_results registration
;;
warpRigidity)
run warp --fast --exploration 12 --grid-spacing 160 --accuracy 2 --refine 1 --rigidity-weight 1e-1 --sampling 12 --omit-original-data -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpLabels)
run warp --fast --exploration 8 --grid-spacing 90 --accuracy 1 --refine 1 --class-ref label --class-flt label -o ${tmpdir} --initial parc1_parc2_9dof.xform parc1.hdr parc2.hdr
check_results registration
;;
warpxSingleLevel)
run warpx --fast --max-stepsize 8 --grid-spacing 160 --min-stepsize 1 --no-adaptive-fix -o ${tmpdir} --write-itk-xform ${tmpdir}/xform.tfm vol001_mr_t0t1.list
check_results registration xform.tfm
;;
warpxSingleLevelExact)
run warpx --fast --max-stepsize 8 --grid-spacing 180 --exact-spacing --min-stepsize 1 --sampling 3 --no-adaptive-fix -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpxInverseConsistentCC)
export CMTK_NUM_THREADS=1
run warpx --fast --max-stepsize 8 --grid-spacing 80 --min-stepsize 1 --ncc --inverse-consistency-weight 1e-2 -o ${tmpdir} vol001_mr_t0t1.list
unset CMTK_NUM_THREADS
check_results registration
;;
warpxMultiLevel)
run warpx --pad-flt -10000 --write-reformatted ${tmpdir}/reformat.nii --fast --max-stepsize 8 --grid-spacing 160 --min-stepsize 1 --grid-refine 1 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration reformat.nii
;;
warpxMultiLevelMatchHistograms)
export CMTK_NUM_THREADS=1
run warpx --fast --max-stepsize 8 --match-histograms --msd --grid-spacing 160 --min-stepsize 1 --grid-refine 1 -o ${tmpdir} vol001_mr_t0t1.list
unset CMTK_NUM_THREADS
check_results registration
;;
warpxMultiLevelDeltaFThreshold)
export CMTK_NUM_THREADS=1
run warpx --fast --max-stepsize 8 --delta-f-threshold 0.01 --msd --grid-spacing 160 --min-stepsize 1 --grid-refine 1 -o ${tmpdir} vol001_mr_t0t1.list
unset CMTK_NUM_THREADS
check_results registration
;;
warpxMultiLevelExact)
run warpx --fast --max-stepsize 8 --grid-spacing 160 --exact-spacing --min-stepsize 1 --grid-refine 1 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpxDelayRefine)
run warpx --fast --max-stepsize 12 --grid-spacing 160 --min-stepsize 2 --grid-refine 1 --delay-refine --sampling 6 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpxEnergy)
run warpx --fast --max-stepsize 8 --grid-spacing 160 --min-stepsize 1 --grid-refine 1 --smoothness-constraint-weight 1e-1 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpxEnergyRelax)
run warpx --fast --max-stepsize 8 --grid-spacing 160 --min-stepsize 1 --grid-refine 1 --smoothness-constraint-weight 1e-1 --constraint-relaxation-factor 1e-2 -o ${tmpdir} vol001_mr_t0t1.list
check_results registration
;;
warpxJacobian)
export CMTK_NUM_THREADS=1
run warpx --fast --max-stepsize 12 --grid-spacing 160 --min-stepsize 2 --grid-refine 1 --jacobian-constraint-weight 1e-1 --sampling 12 --omit-original-data -o ${tmpdir} vol001_mr_t0t1.list
unset CMTK_NUM_THREADS
check_results registration
;;
warpxJacobianUnfold)
export CMTK_NUM_THREADS=1
run warpx --fast --relax-to-unfold --max-stepsize 12 --grid-spacing 160 --min-stepsize 2 --grid-refine 1 --jacobian-constraint-weight 1e-1 --sampling 12 --omit-original-data -o ${tmpdir} vol001_mr_t0t1.list
unset CMTK_NUM_THREADS
check_results registration
;;
warpxLabels)
run warpx --fast --max-stepsize 8 --grid-spacing 90 --min-stepsize 1 --grid-refine 1 --class-ref label --class-flt label -o ${tmpdir} --initial parc1_parc2_9dof.xform parc1.hdr parc2.hdr
check_results registration
;;
vtkxform)
run_eval "${BINDIR}/vtkxform vol001_mr_t0t1.list < polydata_ascii.vtk > ${tmpdir}/output.vtk"
check_results output.vtk
;;
vtkxformInverse)
run_eval "${BINDIR}/vtkxform -- --inverse vol001_mr_t0t1.list < polydata_ascii.vtk > ${tmpdir}/output.vtk"
check_results output.vtk
;;
xform2dfieldWarpNrrd)
run xform2dfield -v ${tmpdir}/dfield.nhdr vol001_mr_t0_crop.hdr vol001_mr_t0t1_warp.xform
check_results dfield.nhdr dfield.raw
;;
xform2dfieldAffineNrrd)
run xform2dfield -v ${tmpdir}/dfield.nhdr vol001_mr_t0_crop.hdr vol001_mr_t0_crop.xform
check_results dfield.nhdr dfield.raw
;;
xform2dfieldDownsampleXYZNrrd)
run xform2dfield -v --downsample 4,4,2 ${tmpdir}/dfield.nhdr vol001_mr_t0_crop.hdr vol001_mr_t0_crop.xform
check_results dfield.nhdr dfield.raw
;;
xform2dfieldDownsampleXNrrd)
run xform2dfield -v --downsample 4 ${tmpdir}/dfield.nhdr vol001_mr_t0_crop.hdr vol001_mr_t0_crop.xform
check_results dfield.nhdr dfield.raw
;;
xform2dfieldConcatNrrd)
run xform2dfield -v ${tmpdir}/dfield.nhdr vol001_mr_t0_crop.hdr vol001_mr_t0_crop.xform vol001_mr_t0t1_warp.xform
check_results dfield.nhdr dfield.raw
;;
xform2dfieldInverseNrrd)
run xform2dfield -v ${tmpdir}/dfield.nhdr vol001_mr_t0_crop.hdr vol001_mr_t0_crop.xform --inverse vol001_mr_t0t1_warp.xform
check_results dfield.nhdr dfield.raw
;;
xform2scalarAffine)
run xform2scalar --float --output ${tmpdir}/magnitude.nii vol001_mr_t0.hdr vol001_mr_t0t1.list
check_results magnitude.nii
;;
xform2scalarAffineDoubleY)
run xform2scalar --mode x-component --output ${tmpdir}/xcomponent.nii vol001_mr_t0.hdr vol001_mr_t0t1.list
check_results xcomponent.nii
;;
xform2scalarWarp)
run xform2scalar --float --output ${tmpdir}/magnitude.nii vol001_mr_t0.hdr vol001_mr_t0t1_warp.xform
check_results magnitude.nii
;;
xform2scalarWarpInverseError)
run xform2scalar --float --output ${tmpdir}/magnitude.nii vol001_mr_t0.hdr vol001_mr_t0t1_warp.xform --inverse vol001_mr_t0t1_warp.xform
check_results magnitude.nii
;;
xform2scalarWarpOnly)
run xform2scalar --warp-only --float --output ${tmpdir}/magnitude.nii vol001_mr_t0.hdr vol001_mr_t0t1_warp.xform
check_results magnitude.nii
;;
xform2scalarDfield)
run xform2scalar --float --output ${tmpdir}/magnitude.nii parc1.hdr parc1_parc2_dfield.nrrd
check_results magnitude.nii
;;
vol2csvLabels)
run vol2csv -o ${tmpdir}/volumes.csv --labels-file sri24_ventricles.txt ncanda_t1_ventricles.nii ncanda_t1_pve_0.nii ncanda_t1_pve_1.nii ncanda_t1_pve_2.nii
check_results volumes.csv
;;
vol2csvScale)
run vol2csv -o ${tmpdir}/volumes.csv --pixel-scale-image ncanda_t1_jacobian.nii ncanda_t1_ventricles.nii ncanda_t1_pve_0.nii ncanda_t1_pve_1.nii ncanda_t1_pve_2.nii
check_results volumes.csv
;;
help_film)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/film --help > ${tmpdir}/film.help"
check_results film.help
;;
help_all_film)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/film --help-all > ${tmpdir}/film.help"
check_results film.help
;;
xml_film)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/film --xml | ${sed} '//{ N; s/^.*$// }' > ${tmpdir}/film.xml"
check_results film.xml
;;
xml_gmm)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/gmm --xml | ${sed} '//{ N; s/^.*$// }' > ${tmpdir}/gmm.xml"
check_results gmm.xml
;;
xml_levelset)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/levelset --xml | ${sed} '//{ N; s/^.*$// }' > ${tmpdir}/levelset.xml"
check_results levelset.xml
;;
xml_mrbias)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/mrbias --xml | ${sed} '//{ N; s/^.*$// }' > ${tmpdir}/mrbias.xml"
check_results mrbias.xml
;;
xml_registration)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/registration --xml | ${sed} '//{ N; s/^.*$// }' > ${tmpdir}/registration.xml"
check_results registration.xml
;;
wiki_film)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/film --wiki > ${tmpdir}/film.wiki"
check_results film.wiki
;;
wiki_levelset)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/levelset --wiki > ${tmpdir}/levelset.wiki"
check_results levelset.wiki
;;
wiki_mrbias)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/mrbias --wiki > ${tmpdir}/mrbias.wiki"
check_results mrbias.wiki
;;
wiki_registration)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/registration --wiki > ${tmpdir}/registration.wiki"
check_results registration.wiki
;;
man_film)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/film --man | fgrep -v .TH > ${tmpdir}/film.man"
check_results film.man
;;
man_levelset)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/levelset --man | fgrep -v .TH > ${tmpdir}/levelset.man"
check_results levelset.man
;;
man_mrbias)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/mrbias --man | fgrep -v .TH > ${tmpdir}/mrbias.man"
check_results mrbias.man
;;
man_registration)
run_eval "CMTK_CONSOLE_LINE_WIDTH=100 ${BINDIR}/registration --man | fgrep -v .TH > ${tmpdir}/registration.man"
check_results registration.man
;;
*)
exit 2
;;
esac
if [ "${tmpdir}" != "" ]; then
rm -rf ${tmpdir}
fi
cmtk-3.0.0/testing/apps/CMakeLists.txt 0000644 0001777 0000017 00000067040 12262344156 016703 0 ustar torsten man ##
## Copyright 2004-2014 SRI International
##
## Copyright 1997-2011 Torsten Rohlfing
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 5099 $
##
## $LastChangedDate: 2014-01-05 13:02:38 -0800 (Sun, 05 Jan 2014) $
##
## $LastChangedBy: torsten_at_home $
##
FIND_PROGRAM(SH_PATH sh PATHS C:/cygwin/bin)
SET(testDriver ${SH_PATH} ${CMAKE_CURRENT_BINARY_DIR}/appsTestDriver.sh)
SET(testList "")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/appsTestDriver.sh.in ${CMAKE_CURRENT_BINARY_DIR}/appsTestDriver.sh @ONLY)
# On Windows, remove "\r" (CR) from line ends, which would make Cygwin's sh choke
IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
EXECUTE_PROCESS(COMMAND c:\\cygwin\\bin\\sed -i.bak s/\\r//g ${CMAKE_CURRENT_BINARY_DIR}/appsTestDriver.sh)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# ==========================================
# Tests for "avg_adm" tool
LIST(APPEND testList
avg_admDefault2
avg_admDefault3
avg_admJacobianFloat
avg_admLabels
avg_admPaddOutZeroNN
avg_admNoReferenceModelCubic
avg_admNoScaleModelAutoScale
avg_admWithAffineNoRefData)
# ==========================================
# Tests for "dbtool"
IF(CMTK_USE_SQLITE)
LIST(APPEND testList
dbtool_AddImages
dbtool_AddImages2
dbtool_ListSpace
dbtool_GetXform1
dbtool_GetXform2
dbtool_GetXform3
dbtool_GetXform4
dbtool_GetXform5
dbtool_GetXform6)
ENDIF(CMTK_USE_SQLITE)
# ==========================================
# Tests for "describe" tool
LIST(APPEND testList
describeMountPoints
describeMountPointsMulti
describeMountPointsPrefix
describeMountPointsPrefixInvalid
describeBZip2a
describeBZip2b
describeLZMAa
describeLZMAb
describeXZa
describeXZb
describeEmpty
describeDICOM
describeMosaicDICOM
describeMosaicPACSDICOM
describeDICOMZ
describeVanderbilt
describeMR1
describeMR2
describeMR3
describeMR4
describeHuman
describeMRBiorad
describeMRBioradGz
describeNiftiDetached348
describeEmbedAnalyze
describeEmbedNifti
describeXform
describeXformMachine)
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList
describeMRNrrd1
describeMRNrrd2
describeNrrdNoOrigin
describeEmbedNrrd)
ENDIF(CMTK_BUILD_NRRD)
# ==========================================
# Tests for "destripe" tool
LIST(APPEND testList
destripeDefault
destripeKernelFloat)
# ==========================================
# Tests for "detect_adni_phantom" tool
IF(CMTK_USE_FFTW)
LIST(APPEND testList
detect_adni_phantomDefault
detect_adni_phantomRefineXform
detect_adni_phantomRefineOutliers
detect_adni_phantomExcludeOutliers
detect_adni_phantomErodeNonStd
detect_adni_phantomBadFOV
detect_adni_phantomTolerantBadFOV
detect_adni_phantomMissingSphere
detect_adni_phantomBrokenSNR)
ENDIF(CMTK_USE_FFTW)
# ==========================================
# Tests for "detect_spheres_matched_filter" tool
IF(CMTK_USE_FFTW)
LIST(APPEND testList
detect_spheres_matched_filter
detect_spheres_matched_filterNormalized)
ENDIF(CMTK_USE_FFTW)
# ==========================================
# Tests for "epiunwarp" tool
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList epiunwarp epiunwarpInitShift)
ENDIF(CMTK_BUILD_NRRD)
# ==========================================
# Tests for "fib2image" tool
LIST(APPEND testList fib2image)
# ==========================================
# Tests for "fibxform" tool
LIST(APPEND testList fibxform fibxformSourceTarget)
# ==========================================
# Tests for "groupwise_init" tool
LIST(APPEND testList
groupwise_initCenterFOV
groupwise_initCentersOfMass
groupwise_initCentersOfMassScale
groupwise_initCentersOfMassTemplate)
# ==========================================
# Tests for "groupwise_affine" tool
LIST(APPEND testList
groupwise_affineFromInit
groupwise_affineMatchHistograms
groupwise_affineFromInitSampling
groupwise_affineBackground
groupwise_affineUseTemplate
groupwise_affineZeroSumSmooth
groupwise_affineRMIFromInit
groupwise_affineRMIFromInitDeltaF
groupwise_affineRMIFromInitSampling
groupwise_affineRMIBackground
groupwise_affineRMIZeroSumSmooth)
# ==========================================
# Tests for "groupwise_warp" tool
LIST(APPEND testList
groupwise_warpFromInit
groupwise_warpFromInitProtect
groupwise_warpFitFromInit
groupwise_warpFromInitZeroSum
groupwise_warpUseTemplate
groupwise_warpUseTemplateMatchHistograms
groupwise_warpMatchHistograms
groupwise_warpFromInitNoBG
groupwise_warpUseTemplateNoBG
groupwise_warpRMIFromInit
groupwise_warpRMIFitFromInit
groupwise_warpRMIFromInitZeroSum
)
# ==========================================
# Tests for xml, wiki, man, and help markups
IF(CMTK_USE_SQLITE)
FOREACH(t film levelset mrbias registration)
LIST(APPEND testList xml_${t} wiki_${t} man_${t})
ENDFOREACH(t film levelset mrbias registration)
LIST(APPEND xml_gmm)
ENDIF(CMTK_USE_SQLITE)
FOREACH(t film)
LIST(APPEND testList help_${t} help_all_${t})
ENDFOREACH(t film)
# ==========================================
# Tests for "concat_affine" tool
LIST(APPEND testList
concat_affineABA
concat_affineABAInvert
concat_affineAB1A
concat_affineAA1
concat_affineA1A)
# ==========================================
# Tests for "average_images" tool
LIST(APPEND testList
average_imagesMean
average_imagesMeanNormPadd
average_imagesMeanAbsLog
average_imagesVariance
average_imagesStDev
average_imagesEntropy
average_imagesZScore)
# ==========================================
# Tests for "convert_warp" tool
LIST(APPEND testList convert_warpFractional convert_warpDeformation)
# ==========================================
# Tests for "convertx" tool
LIST(APPEND testList
convertxType
convertxBinarize
convertxBinarizeOtsu
convertxBinarizeOtsuNBins
convertxPruneHighLow
convertxPruneHigh
convertxPruneLow
convertxBoundaryMap
convertxBoundaryMapMultiValue
convertxConnectedComponents
convertxCropThresholdWriteRegion
convertxCropRegion1
convertxCropRegion2
convertxResample
convertxDownsample
convertxDownsampleNiftiSform
convertxDownsampleNiftiQform
convertxDownsampleNiftiQformSform
convertxDownsampleSelect
convertxDistanceUnsigned
convertxDistanceSigned
convertxDistanceSigned2
convertxFlipX
convertxFlipYZ
convertxErodeDilateErode
convertxDilateErodeDilate
convertxErodeByDistance
convertxDilateByDistance
convertxGaussianFilterSigma
convertxGaussianFilterFWHM
convertxHistogramEqualization
convertxHistogramEqualizationNBins
convertxLaplace
convertxMapValues
convertxMapValues2
convertxMapValues3
convertxMapValuesOnly
convertxMapValuesOnly2
convertxMask
convertxMaskInverse
convertxMedianFilter1
convertxMedianFilter2
convertxMedianFilterXYZ
convertxMeanFilter
convertxFastMean0Filter
convertxFastMean1Filter
convertxFastMean2Filter
convertxFastMean2PadFilter
convertxVarianceFilter
convertxFastVariance0Filter
convertxFastVariance1Filter
convertxFastVariance2Filter
convertxFastVariance2PadFilter
convertxThirdMomentFilter
convertxStandardDeviationFilter
convertxSmoothnessFilter
convertxNiftiToAnalyze
convertxNiftiToMetaImage
convertxAnalyzeToNifti
convertxAnalyzeToNiftiRAS
convertxNiftiDetachedToNifti
convertxAnalyzeToNiftiDetached
convertxUncompressedNIFTI1
convertxUncompressedNIFTI2
convertxUncompressedNIFTI3
convertxUncompressedNIFTI4
convertxThresholdBelow
convertxThresholdAbove
convertxThresholdBelowToPadding
convertxThresholdAboveToPadding
convertxScaleToRange
convertxRevert
convertxReplacePadding
convertxReplaceInfNaN)
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList convertxDownsampleNrrd convertxDownsampleSelectNrrd)
ENDIF(CMTK_BUILD_NRRD)
# ==========================================
# Tests for "dcm2image" tool
IF(CMTK_USE_DCMTK)
LIST(APPEND testList
dcm2image
dcm2imageSubs
dcm2imageZ
dcm2imageEmbedPatientNameAnalyze
dcm2imageEmbedPatientNameNifti
dcm2imageEmbedSeriesDescriptionNifti
dcm2imageEmbedStudyIDDateNifti
dcm2imageMosaic
dcm2imageMosaicPACS
dcm2imageDiffusionGEXML
dcm2imageDiffusionSiemensXML
dcm2imageMosaicAnon
dcm2imageMosaicPACSAnon
dcm2imageDiffusionGEXMLAnon
dcm2imageDiffusionSiemensXMLAnon
dcm2imageExclude
dcm2imageInclude
dcm2imageSubsDirName)
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList
dcm2imageNrrd
dcm2imageEmbedPatientNameNrrd)
ENDIF(CMTK_BUILD_NRRD)
ENDIF(CMTK_USE_DCMTK)
# ==========================================
# Tests for "dof2mat" tool
LIST(APPEND testList
dof2mat
dof2matTranspose
dof2matLegacy
dof2matLegacyFwd
dof2matFixed)
# ==========================================
# Tests for "filter" tool
LIST(APPEND testList
filterGaussian
filterGaussianSmallKernel
filterGaussianNoFilter
filterRohlfing)
# ==========================================
# Tests for "film" tool
LIST(APPEND testList
filmCubic
filmFourthOrder
filmMSDLinearNoTrunc
filmMISincRefSPGR)
# ==========================================
# Tests for "fit_affine_xform_landmarks" tool
LIST(APPEND testList fit_affine_xform_landmarksRigid fit_affine_xform_landmarksScales fit_affine_xform_landmarksShear
fit_affine_xform_landmarksRigidRigid fit_affine_xform_landmarksRigidRigidFlip fit_affine_xform_landmarksRigidScales fit_affine_xform_landmarksRigidShear)
# ==========================================
# Tests for "fit_affine_xform" tool
LIST(APPEND testList fit_affine_xform fit_affine_xformRigid fit_affine_xformReverse)
# ==========================================
# Tests for "fit_affine_dfield" tool
LIST(APPEND testList fit_affine_dfieldFFD)
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList fit_affine_dfieldDField)
ENDIF(CMTK_BUILD_NRRD)
# ==========================================
# Tests for "fit_spline_dfield" tool
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList
fit_spline_dfieldSpacing
fit_spline_dfieldSpacingMultiLevel
fit_spline_dfieldDims
fit_spline_dfieldDimsRelative
fit_spline_dfieldDimsMultiLevel
fit_spline_dfieldDimsMultiLevelSafe
fit_spline_dfieldDimsWithAffine)
ENDIF(CMTK_BUILD_NRRD)
# ==========================================
# Tests for "fit_spline_xform" tool
LIST(APPEND testList fit_spline_xformSpacing fit_spline_xformSpacingReverse fit_spline_xformSpacingMultiLevel fit_spline_xformDims fit_spline_xformDimsMultiLevel)
# ==========================================
# Tests for "glm" tool
LIST(APPEND testList
glmDefault glmNormalize glmExp glmNoConstant glmIgnore glmSelect glmCrop)
# ==========================================
# Tests for "gmm" tool
LIST(APPEND testList gmmDefault gmmAlternative)
# ==========================================
# Tests for "gregxform" tool
LIST(APPEND testList
gregxformFordwardBackward
gregxformAffine
gregxformAffineFromWarp
gregxformAffineFromWarpFwdBwd)
# ==========================================
# Tests for "hausdorff" tool
LIST(APPEND testList
hausdorffBinary12
hausdorffBinary21
hausdorffBinaryForced)
# ==========================================
# Tests for "histogram" tool
LIST(APPEND testList
histogram
histogramNorm
histogramBinsMinMax
histogramBinsMinMaxTrunc
histogramMask)
# ==========================================
# Tests for "imagemath" tool
LIST(APPEND testList
imagemathAbsPop
imagemathSqrSqrt
imagemathLogExp
imagemathDupAddMulDiv
imagemathThreshAboveBelow
imagemathAverage
imagemathVariance
imagemathMaskAverage
imagemathXor
imagemathDupFillMaxValue
imagemathAnd
imagemathContractLabels
imagemathMaxIndex
imagemathMaxValue
imagemathStackEntropyLabels
imagemathVote
imagemathProduct
imagemathSTAPLE
imagemathMultiClassSTAPLE
imagemathMultiClassDisputedSTAPLE
imagemathCombinePCA
imagemathT2
imagemathAtan2
imagemathLogOddsAdd
imagemathLogOddsAdd2
imagemathMatchMeanSDev
imagemathMatchMeanSDev3
imagemathMatchHistograms
imagemathMatchHistogramsPadding
imagemathMatchHistogramsPadding2
imagemathMatchHistogramsPaddingUnset)
# ==========================================
# Tests for "interleaved_bad_slices" tool
LIST(APPEND testList
interleaved_bad_slicesDefault
interleaved_bad_slicesStdDev1
interleaved_bad_slicesRMS
interleaved_bad_slicesBulk)
# ==========================================
# Tests for "jidb" tool
LIST(APPEND testList
jidbGaussian
jidbBoxFourthOrder
jidbGaussianScale
jidbMIRefSPGR)
# ==========================================
# Tests for "levelset" tool
LIST(APPEND testList
levelsetDefault
levelsetScaleInitial
levelsetBinarizeFastWideBinary
)
# ==========================================
# Tests for "lmsba" tool
LIST(APPEND testList lmsbaRadius3 lmsbaRadius3Outliers lmsbaRadius3OutliersGlobal lmsbaRadius3Search1)
# ==========================================
# Tests for "lsba" tool
LIST(APPEND testList lsbaRadius3 lsbaRadius3Outliers lsbaRadius3OutliersGlobal lsbaRadius3Search1)
# ==========================================
# Tests for "lvote" tool
LIST(APPEND testList lvoteDefault lvoteGlobalWeights lvoteRadius3 lvoteOutliersGlobal)
# ==========================================
# Tests for "make_initial_affine" tool
LIST(APPEND testList
make_initial_affineCenterOfMass
make_initial_affinePrincipalAxes1
make_initial_affinePrincipalAxes2
make_initial_affinePrincipalAxes3
make_initial_affinePrincipalAxes4
make_initial_affinePrincipalAxes5
make_initial_affinePrincipalAxes6)
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList
make_initial_affineDirectionVectorsNrrdAxSa
make_initial_affineDirectionVectorsNrrdAxCo
make_initial_affineDirectionVectorsNrrdSaCo
make_initial_affineDirectionVectorsNrrdAxSaNative
make_initial_affineDirectionVectorsNrrdAxCoNative
make_initial_affineDirectionVectorsNrrdSaCoNative)
ENDIF(CMTK_BUILD_NRRD)
IF(CMTK_USE_SQLITE)
LIST(APPEND testList
make_initial_affineDB)
ENDIF(CMTK_USE_SQLITE)
# ==========================================
# Tests for "mat2dof" tool
LIST(APPEND testList
mat2dof1
mat2dof2
mat2dofFile)
# ==========================================
# Multi-channel registration requires hash map to build
IF(HAVE_STL_HASH_MAP)
# ==========================================
# Tests for "mcaffine" tool
LIST(APPEND testList
mcaffine1 mcaffine2 mcaffine3 mcaffine4)
# ==========================================
# Tests for "mcwarp" tool
LIST(APPEND testList
mcwarp1 mcwarp2 mcwarp3 mcwarp4 mcwarp5 mcwarp6)
ENDIF(HAVE_STL_HASH_MAP)
# ==========================================
# Tests for "mk_adni_phantom" tool
LIST(APPEND testList mk_adni_phantom2mm mk_adni_phantom2mmLabels)
# ==========================================
# Tests for "mk_analyze_hdr" tool
LIST(APPEND testList
mk_analyze_hdrDefault
mk_analyze_hdrImport
mk_analyze_hdrLittleEndian
mk_analyze_hdrBigEndian)
# ==========================================
# Tests for "mk_nifti_hdr" tool
LIST(APPEND testList
mk_nifti_hdrDefault
mk_nifti_hdrDescription
mk_nifti_hdrImport
mk_nifti_hdrDefaultAttached
mk_nifti_hdrDescriptionAttached
mk_nifti_hdrImportAttached)
# ==========================================
# Tests for "mk_phantom_3d" tool
LIST(APPEND testList
mk_phantom_3dBoxIndexed
mk_phantom_3dBoxIndexedRange
mk_phantom_3dBoxAbsolute
mk_phantom_3dBoxRelative
mk_phantom_3dSphereIndexed
mk_phantom_3dSphereAbsolute
mk_phantom_3dSphereAbsolute2
mk_phantom_3dSphereRelative
mk_phantom_3dSphereRelative2
mk_phantom_3dBoxSphere
mk_phantom_3dImport
mk_phantom_3dImportGrid
mk_phantom_3dMRSVoxel)
# ==========================================
# Tests for "reorient" tool
LIST(APPEND testList
reorientHdrSaToAx
reorientHdrSaToAxNifti
reorientHdrCoToAx
reorientHdrAxToSa
reorientHdrCoToSa
reorientHdrAxToCo
reorientHdrSaToCo)
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList
reorientNrrdToNrrd
reorientNrrdToNrrdRAS
reorientNrrdToNrrdSpaceLPS)
ENDIF(CMTK_BUILD_NRRD)
# ==========================================
# Tests for "split" tool
LIST(APPEND testList splitAxial splitAxialSlices splitSagittal2 splitCoronal3)
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList splitAxialNrrd)
ENDIF(CMTK_BUILD_NRRD)
# ==========================================
# Tests for "overlap" tool
LIST(APPEND testList
overlap
overlapNumLabels
overlapByLabel
overlapFirst
overlapFirstByLabel
overlapFirstByLabelNumLabels)
# ==========================================
# Tests for "probe" tool
LIST(APPEND testList
probeIndexed
probeAbsolute
probeRelative
probePhysical
probeIndexedLinear
probeIndexedCubic
probeIndexedSinc)
# ==========================================
# Tests for "pxsearch" tool
LIST(APPEND testList pxsearchIndexed pxsearchIndexedRadius3 pxsearchIndexedRadius311 pxsearchAbsolute pxsearchRelative pxsearchPhysical)
# ==========================================
# Tests for "registration" tool
LIST(APPEND testList
registrationAffineMrMrMSD
registrationRigidMrPet
registrationRigidMrCt
registrationRigidCt
registrationRigidPetMr
registrationRigidCtMr
registrationRigidMrPetNoSwap
registrationRigidMrCtNoSwap
registrationRigidPetMrDOF9
registrationRigidCtMrDOF7
registrationRigidLabelsDOF69
registrationRigidCrop
registrationAutoLevelsRat4
registrationAutoLevelsRat2
registrationAutoLevelsRatToRat
registrationAutoLevelsRatToRatDeltaFThreshold
registrationAutoLevelsCt3
registrationFromList
registrationWithInitial
registrationWithInitialInverse)
# ==========================================
# Tests for "registrationx" tool
LIST(APPEND testList
registrationxAffineMrMrMSD
registrationxShearNoScaleMrMrMSD
registrationxFromList
registrationxWithInitial
registrationxWithInitialInverse
registrationxAutoLevelsRat4
registrationxAutoLevelsRat4XY
registrationxAutoLevelsRat4YZ
registrationxAutoLevelsRat4XZ
registrationxAutoLevelsRat4Symmetric
registrationxAutoLevelsRat4NONE
registrationxAutoLevelsRat4FOV
registrationxAutoLevelsRat4COM
registrationxAutoLevelsRat4PAX
registrationxAutoLevelsRat2
registrationxAutoLevelsRat2Cubic
registrationxAutoLevelsRat2Sinc
registrationxAutoLevelsRat2NN
registrationxAutoLevelsRatToRat
registrationxAutoLevelsRatToRatDeltaFThreshold
registrationxAutoLevelsRatToRatRMS
registrationxAutoLevelsRatToRatNCC
registrationxAutoLevelsRatToRatCR
registrationxAutoLevelsRatToRatMI
registrationxAutoLevelsLabelsNN
registrationxAutoLevelsLabelsPV
registrationxAutoLevelsCt3)
IF(CMTK_USE_SQLITE)
LIST(APPEND testList
registrationxFromListDB
registrationxWithInitialDB
registrationxWithInitialInverseDB
)
ENDIF(CMTK_USE_SQLITE)
# ==========================================
# Tests for "mrbias" tool
LIST(APPEND testList
mrbiasMulIncremental
mrbiasMulAutoThresh
mrbiasMulOtsuThresh
mrbiasMulLogIntensity
mrbiasAddMulMask)
IF(CMTK_USE_CUDA)
LIST(APPEND testList
mrbiasMulIncrementalCUDA
mrbiasMulLogIntensityCUDA
mrbiasAddMulMaskCUDA)
ENDIF(CMTK_USE_CUDA)
# ==========================================
# Tests for "reformatx" tool
LIST(APPEND testList
reformatxNoXform
reformatxLinear
## reformatxLinearFwdBwd
reformatxNearestNeighbor
reformatxPartialVolume
reformatxCubic
reformatxCubicInverse
reformatxSincCosine
reformatxSincCosine5
reformatxMassPreserving
reformatxJacobian
reformatxInverseJacobian
reformatxSincHamming
reformatxTargetGrid
reformatxTargetGridAnalyze
reformatxTargetGridOffset)
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList
reformatxDfieldNrrd
reformatxDfieldNrrdJacobian)
ENDIF(CMTK_BUILD_NRRD)
# ==========================================
# Tests for "sba" tool
LIST(APPEND testList sbaDefault sbaOutliers sbaOutliers2)
# ==========================================
# Tests for "sbai" tool
LIST(APPEND testList sbaiDefault)
# ==========================================
# Tests for "sequence" tool
LIST(APPEND testList sequenceDefault sequenceFormat sequenceThresh sequenceAbs sequenceAbsThresh)
# ==========================================
# Tests for "similarity" tool
LIST(APPEND testList
similarityGrey
similarityWithInf
similarityLabels
similarityGreyMask
similarityLabelsMask)
# ==========================================
# Tests for "streamxform" tool
LIST(APPEND testList streamxformFordwardBackward streamxformAffineForward streamxformAffineForwardBackward streamxformFordwardBackwardTolerance streamxformAffine streamxformAffineFromTo)
# ==========================================
# Tests for "sympl" tool
LIST(APPEND testList symmetry_plane symmetry_planeThresh)
# ==========================================
# Tests for "symplx" tool
LIST(APPEND testList
symplx_Default
symplx_Thresh
symplx_FixOffset)
IF(CMTK_USE_CUDA)
LIST(APPEND testList
symplx_DefaultCUDA
symplx_ThreshCUDA
symplx_FixOffsetCUDA)
ENDIF(CMTK_USE_CUDA)
# ==========================================
# Tests for "statistics" tool
LIST(APPEND testList
statisticsGrey
statisticsPercentiles
statisticsGreyColumn
statisticsGreyExpNotation
statisticsGreyMask
statisticsGreyMultiMask
statisticsMaskMismatch
statisticsLabels
statisticsLabelsAllUpToHi
statisticsLabelsAllUpToLo)
# ==========================================
# Tests for "stream_pixels" tool
LIST(APPEND testList
stream_pixels
stream_pixelsConvert
stream_pixelsReorient
stream_pixelsEndian)
# ==========================================
# Tests for "ttest" tool
LIST(APPEND testList ttestDefault ttestLog ttestAbsLog ttestInvert
ttestPaired ttestCrossCorrelation ttestZScores
ttestMask ttestOneSided)
# ==========================================
# Tests for "unsplit" tool
LIST(APPEND testList unsplitHdrAx unsplitHdrSa unsplitHdrCo unsplitSlices)
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList unsplitHdrNrrdAx unsplitHdrNrrdSa unsplitHdrNrrdCo unsplitNrrdNrrd)
ENDIF(CMTK_BUILD_NRRD)
# ==========================================
# Tests for "unwarp_image_phantom" tool
LIST(APPEND testList
unwarp_image_phantomSpacing
unwarp_image_phantomSpacingInverse
unwarp_image_phantomSpacingLevels
unwarp_image_phantomSpacingDirect
unwarp_image_phantomDims
unwarp_image_phantomDimsLevels
unwarp_image_phantomDimsLevelsIterations
unwarp_image_phantomDimsLevelsThreshold
unwarp_image_phantomDimsLevelsIterationsThreshold
unwarp_image_phantomDimsDefault)
# ==========================================
# Tests for "volume_injection" tool
LIST(APPEND testList
volume_injection
volume_injectionReconGrid
volume_injectionReconGridOffset
volume_injectionIsotropic
volume_injectionNoXform
volume_injectionNoXformIsotropic)
# ==========================================
# Tests for "volume_reconstruction" tool
LIST(APPEND testList
volume_reconstructionFourthOrder
volume_reconstructionCubic
volume_reconstructionNoXform
volume_reconstructionBoxPSF
volume_reconstructionGaussianPSF)
# ==========================================
# Tests for "warp" tool
LIST(APPEND testList
warpSingleLevel
warpSingleLevelExact
warpInverseConsistentCC
warpMultiLevel
warpMultiLevelMatchHistograms
warpMultiLevelDeltaFThreshold
warpMultiLevelExact
warpDelayRefine
warpEnergy
warpEnergyRelax
warpRigidity
warpJacobian
warpLabels)
# ==========================================
# Tests for "warpx" tool
LIST(APPEND testList
warpxSingleLevel
warpxSingleLevelExact
warpxInverseConsistentCC
warpxMultiLevel
warpxMultiLevelMatchHistograms
warpxMultiLevelDeltaFThreshold
warpxMultiLevelExact
warpxDelayRefine
warpxEnergy
warpxEnergyRelax
warpxJacobian
warpxJacobianUnfold
warpxLabels)
# ==========================================
# Tests for "xform2dfield" tool
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList
xform2dfieldWarpNrrd
xform2dfieldAffineNrrd
xform2dfieldDownsampleXYZNrrd
xform2dfieldDownsampleXNrrd
xform2dfieldConcatNrrd
xform2dfieldInverseNrrd)
ENDIF(CMTK_BUILD_NRRD)
# ==========================================
# Tests for "xform2scalar" tool
LIST(APPEND testList
xform2scalarAffine
xform2scalarAffineDoubleY
xform2scalarWarp
xform2scalarWarpInverseError
xform2scalarWarpOnly)
# ==========================================
# Tests for "vol2csv" tool
LIST(APPEND testList vol2csvLabels vol2csvScale)
# ==========================================
# Tests for "vtkxform" tool
LIST(APPEND testList
vtkxform
vtkxformInverse)
IF(CMTK_BUILD_NRRD)
LIST(APPEND testList
xform2scalarDfield)
ENDIF(CMTK_BUILD_NRRD)
# ==========================================
# Set up all tests
FOREACH(testName ${testList})
IF(CMTK_TESTING_MEMORYCHECK)
ADD_TEST(NAME ${testName} COMMAND ${testDriver} ${testName} $ ${MEMORYCHECK_COMMAND})
ELSE(CMTK_TESTING_MEMORYCHECK)
ADD_TEST(NAME ${testName} COMMAND ${testDriver} ${testName} $)
ENDIF(CMTK_TESTING_MEMORYCHECK)
ENDFOREACH(testName ${testList})
SET_TESTS_PROPERTIES(groupwise_warpFromInit PROPERTIES TIMEOUT 4800)
SET_TESTS_PROPERTIES(groupwise_warpFitFromInit PROPERTIES TIMEOUT 4800)
SET_TESTS_PROPERTIES(groupwise_warpFromInitZeroSum PROPERTIES TIMEOUT 4800)
SET_TESTS_PROPERTIES(groupwise_warpUseTemplate PROPERTIES TIMEOUT 6400)
SET_TESTS_PROPERTIES(groupwise_warpFromInitNoBG PROPERTIES TIMEOUT 4800)
SET_TESTS_PROPERTIES(groupwise_warpUseTemplateNoBG PROPERTIES TIMEOUT 6400)
SET_TESTS_PROPERTIES(groupwise_warpRMIFromInit groupwise_warpRMIFitFromInit groupwise_warpRMIFromInitZeroSum PROPERTIES TIMEOUT 4800)
# ==========================================
# Set up test properties, now that the tests
# have been defined.
SET_TESTS_PROPERTIES(avg_admLabels filmFourthOrder jidbGaussian jidbGaussianScale volume_reconstructionGaussianPSF volume_reconstructionNoXform PROPERTIES TIMEOUT 1800)
SET_TESTS_PROPERTIES(filmCubic PROPERTIES TIMEOUT 1800)
SET_TESTS_PROPERTIES(filmMSDLinearNoTrunc PROPERTIES TIMEOUT 3600)
SET_TESTS_PROPERTIES(filmMISincRefSPGR PROPERTIES TIMEOUT 3600)
SET_TESTS_PROPERTIES(jidbMIRefSPGR PROPERTIES TIMEOUT 3600)
SET_TESTS_PROPERTIES(registrationxShearNoScaleMrMrMSD PROPERTIES TIMEOUT 900)
IF(HAVE_STL_HASH_MAP)
SET_TESTS_PROPERTIES(mcaffine2 PROPERTIES TIMEOUT 1800)
SET_TESTS_PROPERTIES(mcwarp1 mcwarp2 mcwarp3 mcwarp4 mcwarp5 mcwarp6 PROPERTIES TIMEOUT 1800)
ENDIF(HAVE_STL_HASH_MAP)
SET_TESTS_PROPERTIES(mrbiasAddMulMask PROPERTIES TIMEOUT 3600)
SET_TESTS_PROPERTIES(mrbiasMulIncremental PROPERTIES TIMEOUT 3600)
SET_TESTS_PROPERTIES(mrbiasMulLogIntensity PROPERTIES TIMEOUT 3600)
SET_TESTS_PROPERTIES(volume_reconstructionCubic PROPERTIES TIMEOUT 2400)
SET_TESTS_PROPERTIES(volume_reconstructionFourthOrder PROPERTIES TIMEOUT 1800)
SET_TESTS_PROPERTIES(warpDelayRefine PROPERTIES TIMEOUT 1800)
SET_TESTS_PROPERTIES(warpInverseConsistentCC PROPERTIES TIMEOUT 1800)
SET_TESTS_PROPERTIES(warpLabels PROPERTIES TIMEOUT 1800)
SET_TESTS_PROPERTIES(warpMultiLevel PROPERTIES TIMEOUT 1800)
SET_TESTS_PROPERTIES(warpMultiLevelExact PROPERTIES TIMEOUT 1800)
SET_TESTS_PROPERTIES(warpSingleLevel PROPERTIES TIMEOUT 1800)
SET_TESTS_PROPERTIES(warpSingleLevelExact PROPERTIES TIMEOUT 1800)
SET_TESTS_PROPERTIES(xform2scalarWarpInverseError PROPERTIES TIMEOUT 1800)
cmtk-3.0.0/CMakeLists.txt 0000644 0001777 0000017 00000066200 12263604605 014257 0 ustar torsten man ##
## Copyright 1997-2010 Torsten Rohlfing
##
## Copyright 2004-2014 SRI International
##
## This file is part of the Computational Morphometry Toolkit.
##
## http://www.nitrc.org/projects/cmtk/
##
## The Computational Morphometry Toolkit is free software: you can
## redistribute it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation, either version 3 of
## the License, or (at your option) any later version.
##
## The Computational Morphometry Toolkit is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with the Computational Morphometry Toolkit. If not, see
## .
##
## $Revision: 5127 $
##
## $LastChangedDate: 2014-01-09 12:41:41 -0800 (Thu, 09 Jan 2014) $
##
## $LastChangedBy: torstenrohlfing $
##
##
## This file used to borrow heavily from the analogous InsightToolkit file.
## It may have evolved away since then, however.
##
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
IF(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW) ## libraries with full paths vs. search paths
ENDIF(COMMAND cmake_policy)
SET(CMAKE_OVERRIDE_COMPILER_MISMATCH 1)
PROJECT(CMTK)
SET(CMTK_VERSION_MAJOR "3")
SET(CMTK_VERSION_MINOR "0")
SET(CMTK_VERSION_PATCH "0")
SET(CMTK_VERSION_STRING "${CMTK_VERSION_MAJOR}.${CMTK_VERSION_MINOR}.${CMTK_VERSION_PATCH}")
#-----------------------------------------------------------------------------
# Test for some required system information.
INCLUDE (${CMAKE_ROOT}/Modules/CMakeDetermineSystem.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityC.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
#-----------------------------------------------------------------------------
# On Mac, if we have MacPorts installed, we need to look for libraries in
# /opt/local.
MESSAGE(STATUS "System is " ${CMAKE_SYSTEM})
IF(CMAKE_SYSTEM MATCHES "Darwin.*")
IF(EXISTS /opt/local)
LIST(INSERT CMAKE_PREFIX_PATH 0 "/opt/local")
ENDIF(EXISTS /opt/local)
ENDIF(CMAKE_SYSTEM MATCHES "Darwin.*")
#-----------------------------------------------------------------------------
# Output directories.
IF(NOT LIBRARY_OUTPUT_PATH)
SET (LIBRARY_OUTPUT_PATH ${CMTK_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
ENDIF(NOT LIBRARY_OUTPUT_PATH)
IF(NOT EXECUTABLE_OUTPUT_PATH)
SET (EXECUTABLE_OUTPUT_PATH ${CMTK_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
ENDIF(NOT EXECUTABLE_OUTPUT_PATH)
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
IF(NOT CMTK_BUILD_LIB_DIR) # variable used for generating CMTKConfig.cmake for the build tree
SET(CMTK_BUILD_LIB_DIR "/bin")
ENDIF(NOT CMTK_BUILD_LIB_DIR)
SET(CMTK_LIBRARY_PATH "${LIBRARY_OUTPUT_PATH}")
SET(CMTK_EXECUTABLE_PATH "${EXECUTABLE_OUTPUT_PATH}")
SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
# set CMTK_DIR so it can be used by subprojects
SET(CMTK_DIR "${CMAKE_BINARY_DIR}" CACHE INTERNAL "CMTK dir to be used by subprojects")
#-----------------------------------------------------------------------------
# Setup install target directories
IF(NOT CMTK_INSTALL_BIN_DIR)
SET(CMTK_INSTALL_BIN_DIR bin CACHE PATH "Binary files will be installed here")
ENDIF(NOT CMTK_INSTALL_BIN_DIR)
IF(NOT CMTK_INSTALL_LIB_DIR)
# 64 bit libraries are not installed in the same directories on solaris
# Ref: http://docs.sun.com/app/docs/doc/816-5138/6mba6ua5m?a=view
SET(sun64 )
IF(CMAKE_SYSTEM MATCHES "SunOS.*" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
EXEC_PROGRAM("uname"
ARGS "-p"
OUTPUT_VARIABLE sunproc
)
IF("${sunproc}" STREQUAL "sparc")
SET(sun64 "/sparcv9")
ENDIF("${sunproc}" STREQUAL "sparc")
IF("${sunproc}" STREQUAL "i386")
SET(sun64 "/amd64")
ENDIF("${sunproc}" STREQUAL "i386")
IF("${sun64}" STREQUAL "")
# sun64 is not set - solaris has been ported to a new architecture?
MESSAGE("Warning: Unknown processor '${sunproc}'. The libraries may not be installed in the right place.")
ENDIF("${sun64}" STREQUAL "")
ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(CMTK_INSTALL_LIB_DIR "lib${sun64}/cmtk" CACHE PATH "Library files will be installed here")
ENDIF(NOT CMTK_INSTALL_LIB_DIR)
IF(NOT CMTK_INSTALL_DATA_DIR)
SET(CMTK_INSTALL_DATA_DIR "share/cmtk" CACHE PATH "Data files will be installed here")
ENDIF(NOT CMTK_INSTALL_DATA_DIR)
IF(NOT CMTK_INSTALL_INCLUDE_DIR)
SET(CMTK_INSTALL_INCLUDE_DIR "include/cmtk" CACHE PATH "Include files will be installed here")
ENDIF(NOT CMTK_INSTALL_INCLUDE_DIR)
#-----------------------------------------------------------------------------
# Check for system headers.
INCLUDE (CheckIncludeFiles)
CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H)
CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H)
CHECK_INCLUDE_FILES (fcntl.h HAVE_FCNTL_H)
CHECK_INCLUDE_FILES (ieeefp.h HAVE_IEEEFP_H)
CHECK_INCLUDE_FILES (inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
CHECK_INCLUDE_FILES (pthread.h HAVE_PTHREAD_H)
CHECK_INCLUDE_FILES (stdint.h HAVE_STDINT_H)
CHECK_INCLUDE_FILES (termios.h HAVE_TERMIOS_H)
CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILES (values.h HAVE_VALUES_H)
CHECK_INCLUDE_FILES (sys/ioctl.h HAVE_SYS_IOCTL_H)
CHECK_INCLUDE_FILES (sys/procfs.h HAVE_SYS_PROCFS_H)
CHECK_INCLUDE_FILES (sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILES (sys/time.h HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILES (sys/times.h HAVE_SYS_TIMES_H)
CHECK_INCLUDE_FILES (sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES (sys/utsname.h HAVE_SYS_UTSNAME_H)
IF(HAVE_SYS_STAT_H)
SET(CMAKE_EXTRA_INCLUDE_FILES sys/stat.h)
ENDIF(HAVE_SYS_STAT_H)
CHECK_TYPE_SIZE("((struct stat*)0)->st_mode" SIZEOF_ST_SIZE)
IF(SIZEOF_ST_SIZE EQUAL 4)
CHECK_TYPE_SIZE("struct stat64" CMTK_USE_STAT64)
ENDIF(SIZEOF_ST_SIZE EQUAL 4)
SET(CMAKE_EXTRA_INCLUDE_FILES)
INCLUDE(TestBigEndian)
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
#-----------------------------------------------------------------------------
# Test NaN high bit
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestQnanhibit.cmake)
TEST_QNANHIBIT(QNANHIBIT_VALUE ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
IF(QNANHIBIT_VALUE)
SET(QNANHIBIT 1 CACHE INTERNAL "The 22nd bit of 32-bit floating-point quiet NaN.")
ELSE(QNANHIBIT_VALUE)
SET(QNANHIBIT 0 CACHE INTERNAL "The 22nd bit of 32-bit floating-point quiet NaN.")
ENDIF(QNANHIBIT_VALUE)
#-----------------------------------------------------------------------------
# Check for at least one of the typical STL hash map implementations
INCLUDE (CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX(unordered_map HAVE_UNORDERED_MAP)
IF(NOT HAVE_UNORDERED_MAP)
CHECK_INCLUDE_FILE_CXX(hash_map HAVE_HASH_MAP)
IF(NOT HAVE_HASH_MAP)
CHECK_INCLUDE_FILE_CXX(hash_map.h HAVE_HASH_MAP_H)
ENDIF(NOT HAVE_HASH_MAP)
ENDIF(NOT HAVE_UNORDERED_MAP)
# set a single flag is we have ANY hash map implementation in STL
SET(HAVE_STL_HASH_MAP ${HAVE_UNORDERED_MAP}${HAVE_HASH_MAP}${HAVE_HASH_MAP_H} CACHE INTERNAL "Flag for presence of ANY hash map implementation in the C++ STL")
#-----------------------------------------------------------------------------
# build configuration options.
OPTION(BUILD_SHARED_LIBS "Build CMTK with shared libraries." OFF)
SET(CMTK_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
OPTION(CMTK_BUILD_WRAPPER "Build 'cmtk' wrapper script and install all actual executables in a private directory to avoid name collisions" ON)
MARK_AS_ADVANCED(CMTK_BUILD_WRAPPER)
OPTION(CMTK_BUILD_UNSTABLE "Build 'unstable' library and tools" OFF)
MARK_AS_ADVANCED(CMTK_BUILD_UNSTABLE)
OPTION(CMTK_BUILD_STACKTRACE "Build tools with stack trace printing in case of crash (increases build time)" ON)
MARK_AS_ADVANCED(CMTK_BUILD_STACKTRACE)
OPTION(CMTK_BUILD_DEMO "Build demonstration code. Strange things will happen if you turn this on." OFF)
MARK_AS_ADVANCED(CMTK_BUILD_DEMO)
IF(CMTK_BUILD_DEMO)
MESSAGE( WARNING "Demo mode is enabled. Make sure not to use this build for production use!")
ENDIF(CMTK_BUILD_DEMO)
#-----------------------------------------------------------------------------
# Add an option to use or not to use SMP multi-core parallelism
OPTION(CMTK_USE_SMP "Enable shared-memory parallelism (requires at least POSIX Threads, OpenMP, or Windows threads)" ON)
#-----------------------------------------------------------------------------
# Add an option to enable or disable POSIX threads if pthread.h header exists
IF(HAVE_PTHREAD_H)
OPTION(CMTK_USE_PTHREADS "Use POSIX Threads for SMP parallelism" ON)
MARK_AS_ADVANCED(CMTK_USE_PTHREADS)
IF(NOT CMTK_USE_SMP)
SET(CMTK_USE_PTHREADS OFF)
ENDIF(NOT CMTK_USE_SMP)
ENDIF(HAVE_PTHREAD_H)
#-----------------------------------------------------------------------------
# for the gnu compiler a -D_PTHREADS is needed on sun
# for the native compiler a -mt flag is needed on the sun
IF(CMTK_USE_PTHREADS)
IF(${CMAKE_SYSTEM} MATCHES "SunOS.*")
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMTK_REQUIRED_CXX_FLAGS "${CMTK_REQUIRED_CXX_FLAGS} -D_PTHREADS")
ELSE(CMAKE_COMPILER_IS_GNUCXX)
SET(CMTK_REQUIRED_CXX_FLAGS "${CMTK_REQUIRED_CXX_FLAGS} -mt")
SET(CMTK_REQUIRED_C_FLAGS "${CMTK_REQUIRED_C_FLAGS} -mt")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(${CMAKE_SYSTEM} MATCHES "SunOS.*")
ENDIF(CMTK_USE_PTHREADS)
# mingw thread support
IF(MINGW)
SET(CMTK_REQUIRED_CXX_FLAGS "${CMTK_REQUIRED_CXX_FLAGS} -mthreads")
SET(CMTK_REQUIRED_C_FLAGS "${CMTK_REQUIRED_C_FLAGS} -mthreads")
SET(CMTK_REQUIRED_LINK_FLAGS "${CMTK_REQUIRED_LINK_FLAGS} -mthreads")
ENDIF(MINGW)
#-----------------------------------------------------------------------------
# Check for, and configure, OpenMP
IF(NOT DEFINED CMTK_USE_OPENMP)
FIND_PACKAGE(OpenMP)
IF(OPENMP_FOUND)
OPTION(CMTK_USE_OPENMP "Use OpenMP for SMP parallelism" ON)
MARK_AS_ADVANCED(CMTK_USE_OPENMP)
IF(NOT CMTK_USE_SMP)
SET(CMTK_USE_OPENMP OFF)
ENDIF(NOT CMTK_USE_SMP)
ENDIF(OPENMP_FOUND)
ENDIF(NOT DEFINED CMTK_USE_OPENMP)
IF(CMTK_USE_OPENMP)
SET(CMTK_REQUIRED_CXX_FLAGS "${CMTK_REQUIRED_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
SET(CMTK_REQUIRED_LINK_FLAGS "${CMTK_REQUIRED_LINK_FLAGS} ${OpenMP_C_FLAGS}")
ENDIF(CMTK_USE_OPENMP)
#-----------------------------------------------------------------------------
# Check for, and configure, Grand Central Dispatch
CHECK_INCLUDE_FILES(dispatch/dispatch.h HAVE_DISPATCH_H)
IF(HAVE_DISPATCH_H)
OPTION(CMTK_USE_GCD "Use Grand Central Dispatch for SMP parallelism with system-level load balancing" ON)
IF(NOT CMTK_USE_SMP)
SET(CMTK_USE_GCD OFF)
ENDIF(NOT CMTK_USE_SMP)
IF(CMTK_USE_GCD)
ENDIF(CMTK_USE_GCD)
ENDIF(HAVE_DISPATCH_H)
#-----------------------------------------------------------------------------
# Check for, and configure, CUDA
OPTION(CMTK_USE_CUDA "Use CUDA for GPU computing" OFF)
IF(CMTK_USE_CUDA)
# check using cmake's own FindCUDA above v2.8 or use our own for earlier versions
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS 2.8)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindCUDA.cmake)
ELSE (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS 2.8)
FIND_PACKAGE(CUDA)
ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS 2.8)
ENDIF(CMTK_USE_CUDA)
#-----------------------------------------------------------------------------
# Check whether compiler supports variable-size automatic arrays, i.e.,
# things like "const int size = 10; const char string[size];" rather than
# "const char string[10];"
INCLUDE(${CMAKE_ROOT}/Modules/CheckCXXSourceCompiles.cmake)
CHECK_CXX_SOURCE_COMPILES("class A {}; class B : public A {}; int main() { int size = 10; B array[size]; }" CMTK_COMPILER_VAR_AUTO_ARRAYSIZE)
#-----------------------------------------------------------------------------
# Configure Dart testing support. This should be done before any
# MESSAGE(FATAL_ERROR ...) commands are invoked.
INCLUDE(${CMAKE_ROOT}/Modules/CTest.cmake)
MARK_AS_ADVANCED(TCL_TCLSH DART_ROOT)
ENABLE_TESTING()
IF(BUILD_TESTING)
SET(BUILDNAME "${BUILDNAME}" CACHE STRING "Name of build on the dashboard")
MARK_AS_ADVANCED(BUILDNAME)
OPTION(CMTK_TESTING_MEMORYCHECK "Test using memory checking" OFF)
MARK_AS_ADVANCED(CMTK_TESTING_MEMORYCHECK)
IF(NOT CMTK_DATA_ROOT)
GET_FILENAME_COMPONENT(CMTK_SVN_ROOT ${CMAKE_CURRENT_SOURCE_DIR} PATH)
SET(CMTK_DATA_ROOT ${CMTK_SVN_ROOT}/data CACHE PATH "Root directory of the CMTK data tree")
ENDIF(NOT CMTK_DATA_ROOT)
MARK_AS_ADVANCED(CMTK_DATA_ROOT)
ENDIF(BUILD_TESTING)
SET(CMTK_ROOT_PATH_SRI24 "CMTK_ROOT_PATH_SRI24-NOTFOUND" CACHE PATH "Root path of the SRI24 atlas data (usually ends with \"sri24\")" )
#-----------------------------------------------------------------------------
# Configure Doxygen support
FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND)
OPTION(BUILD_DOCUMENTATION "Build html-based library API documentation using Doxygen" OFF)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
IF(BUILD_DOCUMENTATION)
ADD_CUSTOM_TARGET(doc COMMAND doxygen DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${CMTK_INSTALL_DATA_DIR}/doc/html/ COMPONENT documentation)
ENDIF(BUILD_DOCUMENTATION)
ENDIF(DOXYGEN_FOUND)
#-----------------------------------------------------------------------------
# Add an option to use double-precision floats for coordinates.
OPTION(CMTK_COORDINATES_DOUBLE "Use double precision floats for coordinates (turn off to save memory)" ON)
MARK_AS_ADVANCED(CMTK_COORDINATES_DOUBLE)
OPTION(CMTK_DATA_DOUBLE "Use double precision floats for data exchange between typed arrays" ON)
MARK_AS_ADVANCED(CMTK_DATA_DOUBLE)
OPTION(CMTK_NUMERICS_DOUBLE "Use double precision floats for numerical algorithms" ON)
MARK_AS_ADVANCED(CMTK_NUMERICS_DOUBLE)
#-----------------------------------------------------------------------------
# Add an option to use or not use zlib library
OPTION(CMTK_BUILD_ZLIB "Build bundled zlib library, even if system zlib exists" OFF)
FIND_PACKAGE(ZLIB)
IF(CMTK_BUILD_ZLIB)
MESSAGE( STATUS "Building bundled zlib by user configuration" )
SET(CMTK_BUILD_ZLIB 1)
SET(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/zlib")
SET(ZCONF_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/Utilities/zlib")
SET(ZLIB_LIBRARIES "cmtkZlib" CACHE INTERNAL "")
SET(ZLIB_INCLUDE_DIRS ${ZCONF_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
ELSE(CMTK_BUILD_ZLIB)
IF(ZLIB_FOUND)
MESSAGE( STATUS "Using system zlib" )
ELSE(ZLIB_FOUND)
MESSAGE( STATUS "Building bundled zlib due to missing system zlib" )
SET(CMTK_BUILD_ZLIB 1)
SET(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/zlib")
SET(ZCONF_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/Utilities/zlib")
SET(ZLIB_LIBRARIES "cmtkZlib" CACHE INTERNAL "")
SET(ZLIB_INCLUDE_DIRS ${ZCONF_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
ENDIF(ZLIB_FOUND)
ENDIF(CMTK_BUILD_ZLIB)
INCLUDE_DIRECTORIES(BEFORE ${ZLIB_INCLUDE_DIRS})
#-----------------------------------------------------------------------------
# Add an option to use or not use mxml library
OPTION(CMTK_BUILD_MXML "Build bundled mxml library, even if system library exists" OFF)
FIND_PACKAGE(MXML)
IF(CMTK_BUILD_MXML)
MESSAGE( STATUS "Building bundled mxml by user configuration" )
SET(CMTK_BUILD_MXML 1)
SET(MXML_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/mxml")
INCLUDE_DIRECTORIES(BEFORE ${MXML_INCLUDE_DIR})
SET(MXML_LIBRARIES "cmtkMxml" CACHE INTERNAL "")
ELSE(CMTK_BUILD_MXML)
IF(NOT MXML_FOUND OR ${MXML_VERSION} STRLESS 2.7)
IF(NOT MXML_FOUND)
MESSAGE( STATUS "Building bundled mxml due to missing system mxml" )
ELSE(NOT MXML_FOUND)
MESSAGE( STATUS "Building bundled mxml due to outdated system mxml (minimum version required is 2.7, installed version is ${MXML_VERSION})" )
ENDIF(NOT MXML_FOUND)
SET(CMTK_BUILD_MXML 1)
SET(MXML_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/mxml")
INCLUDE_DIRECTORIES(BEFORE ${MXML_INCLUDE_DIR})
SET(MXML_LIBRARIES "cmtkMxml" CACHE INTERNAL "")
ELSE(NOT MXML_FOUND OR ${MXML_VERSION} STRLESS 2.7)
MESSAGE( STATUS "Using system mxml version ${MXML_VERSION}" )
ENDIF(NOT MXML_FOUND OR ${MXML_VERSION} STRLESS 2.7)
ENDIF(CMTK_BUILD_MXML)
#-----------------------------------------------------------------------------
# Add an option to use or not use bzip2 library
OPTION(CMTK_USE_BZIP2 "Compile support for on-the-fly BZip2 decompression" ON)
IF(CMTK_USE_BZIP2)
FIND_PACKAGE(BZip2)
IF(BZIP2_FOUND)
MESSAGE( STATUS "Found system libbz2" )
SET(CMTK_BZIP2_LIBS ${BZIP2_LIBRARIES})
ELSE(BZIP2_FOUND)
SET(CMTK_USE_BZIP2 OFF)
ENDIF(BZIP2_FOUND)
ENDIF(CMTK_USE_BZIP2)
#-----------------------------------------------------------------------------
# Add an option to use or not use lzma decompression library
OPTION(CMTK_USE_LZMA "Compile support for on-the-fly LZMA decompression" ON)
IF(CMTK_USE_LZMA)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindLZMA.cmake)
IF(LZMA_FOUND)
MESSAGE( STATUS "Found system lzma library" )
SET(CMTK_LZMA_LIBS ${LZMA_LIBRARY})
ELSE(LZMA_FOUND)
SET(CMTK_USE_LZMA OFF)
ENDIF(LZMA_FOUND)
ENDIF(CMTK_USE_LZMA)
IF(CMTK_USE_LZMA)
INCLUDE_DIRECTORIES(${LZMA_INCLUDE_DIR})
ENDIF(CMTK_USE_LZMA)
#-----------------------------------------------------------------------------
# Add an option to build with DICOM support
OPTION(CMTK_USE_DCMTK "Build with optional DICOM support" ON)
IF(CMTK_USE_DCMTK)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindConfigDCMTK.cmake)
OPTION(CMTK_BUILD_DCMTK "Build bundled DCMTK library, even if system library exists" OFF)
IF(NOT DCMTK_FOUND)
MESSAGE( STATUS "DCMTK library not found - defaulting to bundled version." )
SET(CMTK_BUILD_DCMTK ON CACHE BOOL "Build bundled DCMTK library, even if system library exists" FORCE )
ENDIF(NOT DCMTK_FOUND)
IF(CMTK_BUILD_DCMTK)
MESSAGE( STATUS "Building bundled DCMTK library for DICOM support." )
SET(DCMTK_SOURCE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/dcmtk)
SET(DCMTK_BINARY_ROOT ${CMAKE_CURRENT_BINARY_DIR}/Utilities/dcmtk)
SET(DCMTK_INCLUDE_DIR "${DCMTK_SOURCE_ROOT}")
SET(DCMTK_INCLUDE_DIRS "${DCMTK_BINARY_ROOT};${DCMTK_INCLUDE_DIR};${DCMTK_INCLUDE_DIR}/dcmtk/dcmjpeg;${DCMTK_INCLUDE_DIR}/dcmtk/dcmimage;${DCMTK_INCLUDE_DIR}/dcmtk/dcmimgle;${DCMTK_INCLUDE_DIR}/dcmtk/dcmdata;${DCMTK_INCLUDE_DIR}/dcmtk/ofstd")
INCLUDE_DIRECTORIES(BEFORE ${DCMTK_INCLUDE_DIRS})
SET(DCMTK_LIBRARIES "D4CMTK")
ELSE(CMTK_BUILD_DCMTK)
MESSAGE( STATUS "Using system DCMTK library." )
# system DCMTK should support jpeg
ADD_DEFINITIONS(-DCMTK_USE_DCMTK_JPEG)
ENDIF(CMTK_BUILD_DCMTK)
IF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
SET(CMTK_REQUIRED_CXX_FLAGS "${CMTK_REQUIRED_CXX_FLAGS} -DHAVE_CONFIG_H")
ENDIF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
ELSE(CMTK_USE_DCMTK)
MESSAGE( STATUS "Building without DICOM support." )
SET(CMTK_BUILD_DCMTK OFF)
UNSET(DCMTK_INCLUDE_DIRS CACHE)
UNSET(DCMTK_LIBRARIES CACHE)
ENDIF(CMTK_USE_DCMTK)
#-----------------------------------------------------------------------------
# Add an option to use or not use sqlite3 library
OPTION(CMTK_USE_SQLITE "Use sqlite3 library for optional database support" OFF)
IF(CMTK_USE_SQLITE)
OPTION(CMTK_BUILD_SQLITE "Build bundled sqlite3 library, even if system library exists" OFF)
IF(CMTK_BUILD_SQLITE)
MESSAGE( STATUS "Building bundled sqlite3 library by user configuration" )
SET(CMTK_BUILD_SQLITE 1)
SET(SQLITE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/sqlite3")
SET(CMTK_SQLITE_LIB "cmtksqlite3" CACHE INTERNAL "")
INCLUDE_DIRECTORIES(BEFORE ${SQLITE_INCLUDE_DIR})
ELSE(CMTK_BUILD_SQLITE)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindSQLite3.cmake)
IF(SQLITE3_FOUND AND SQLITE3_VERSION STRGREATER "3.5.0")
MESSAGE( STATUS "Using system sqlite3 library" )
SET(SQLITE_INCLUDE_DIR "${SQLITE3_INCLUDE_DIR}")
SET(CMTK_SQLITE_LIB ${SQLITE3_LIBRARIES} CACHE INTERNAL "")
ELSE(SQLITE3_FOUND AND SQLITE3_VERSION STRGREATER "3.5.0")
MESSAGE( STATUS "Building bundled sqlite3 library due to missing or outdated system library" )
SET(CMTK_BUILD_SQLITE 1)
SET(SQLITE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/sqlite3")
SET(CMTK_SQLITE_LIB "cmtksqlite3" CACHE INTERNAL "")
INCLUDE_DIRECTORIES(BEFORE ${SQLITE_INCLUDE_DIR})
ENDIF(SQLITE3_FOUND AND SQLITE3_VERSION STRGREATER "3.5.0")
ENDIF(CMTK_BUILD_SQLITE)
# if we're using SQLite and building with test support, then we need the "sqlite3" tool.
IF(BUILD_TESTING)
FIND_PROGRAM(SQLITE3_EXECUTABLE sqlite3)
ENDIF(BUILD_TESTING)
ENDIF(CMTK_USE_SQLITE)
#-----------------------------------------------------------------------------
# Add an option to use or not use TEEM (for NrrdIO support)
OPTION(CMTK_BUILD_NRRD "Build NrrdIO library for NRRD import/export" ON)
IF(CMTK_BUILD_NRRD)
ADD_DEFINITIONS(-DTEEM_ZLIB)
SET(CMTK_REQUIRED_CXX_FLAGS "${CMTK_REQUIRED_CXX_FLAGS} -DTEEM_ZLIB")
SET(NRRD_LIBRARIES "NrrdIO" CACHE INTERNAL "The library name for the NrrdIO library")
SET(NRRD_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/Utilities/NrrdIO ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/NrrdIO)
ENDIF(CMTK_BUILD_NRRD)
#-----------------------------------------------------------------------------
# Set up CPack support, to be able to distribute binary packages.
#
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cmtkConfigureCPack.cmake)
#-----------------------------------------------------------------------------
# Configure bundled utilities.
ADD_SUBDIRECTORY(Utilities)
#-----------------------------------------------------------------------------
# Add an option to enable or disable QT support and GUI applications
OPTION(CMTK_USE_QT "Use Qt (GUI applications need this)" OFF)
IF(CMTK_USE_QT)
SET (QT_MT_REQUIRED true)
SET (QT_MIN_VERSION "4.3.0")
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui REQUIRED)
IF (QT_FOUND)
MESSAGE("Qt4 Found OK (${qt_version_str})")
INCLUDE(${QT_USE_FILE})
ELSE(QT_FOUND)
MESSAGE(FATAL_ERROR "No Qt4")
ENDIF(QT_FOUND)
ENDIF(CMTK_USE_QT)
#-----------------------------------------------------------------------------
# Add options to enable or disable different compoments
OPTION(BUILD_APPS "Build command line tools" ON)
IF(BUILD_APPS)
SUBDIRS(apps)
ENDIF(BUILD_APPS)
IF(CMTK_USE_QT)
OPTION(BUILD_GUI "Build GUI applications" ON)
ENDIF(CMTK_USE_QT)
#-----------------------------------------------------------------------------
# Add an option to use FFTW library
OPTION(CMTK_USE_FFTW "Use FFTW library for fast Fourier transform (required for some specialized tools)" ON)
IF(CMTK_USE_FFTW)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindFFTW.cmake)
IF(FFTWD_FOUND)
SET(FFTW_LIBS ${FFTWD_LIB})
IF(CMTK_USE_SMP)
IF(CMTK_USE_OPENMP AND FFTWD_OMP_LIB)
SET(FFTW_LIBS ${FFTWD_OMP_LIB} ${FFTWD_LIB})
ELSE(CMTK_USE_OPENMP AND FFTWD_OMP_LIB)
IF(FFTWD_THREADS_LIB)
SET(FFTW_LIBS ${FFTWD_THREADS_LIB} ${FFTWD_LIB})
ENDIF(FFTWD_THREADS_LIB)
ENDIF(CMTK_USE_OPENMP AND FFTWD_OMP_LIB)
ENDIF(CMTK_USE_SMP)
SET(CMTK_FFTW_LIBRARIES ${FFTW_LIBS} CACHE INTERNAL "Link libraries for FFTW support.")
SET(CMTK_USE_FFTW_FOUND ON)
ELSE(FFTWD_FOUND)
MESSAGE( WARNING "Cannot find FFTW3 library - disabling FFT support.")
SET(CMTK_USE_FFTW_FOUND OFF)
UNSET(CMTK_FFTW_LIBRARIES CACHE)
ENDIF(FFTWD_FOUND)
ENDIF(CMTK_USE_FFTW)
#-----------------------------------------------------------------------------
# Add an option to enable building of test code
OPTION(BUILD_TESTING "Build test code" ON)
IF (BUILD_TESTING)
SUBDIRS(testing)
ENDIF (BUILD_TESTING)
#-----------------------------------------------------------------------------
# Create the list of include directories needed for header files.
INCLUDE(${CMTK_SOURCE_DIR}/cmtkIncludeDirectories.cmake)
INCLUDE_DIRECTORIES(
${CMTK_INCLUDE_DIRS_BUILD_TREE}
${CMTK_INCLUDE_DIRS_SYSTEM}
)
SUBDIRS(libs)
LINK_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR} ${DCMTK_LIBRARY_DIR}
)
SET(CMTK_SYSTEM_LIBRARIES ${CMAKE_THREAD_LIBS})
#-----------------------------------------------------------------------------
# Dispatch the build into the proper subdirectories.
IF(BUILD_GUI)
SUBDIRS(gui)
ENDIF(BUILD_GUI)
SUBDIRS(scripts)
#-----------------------------------------------------------------------------
# Configure this tree
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.ctest.in ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.ctest @ONLY)
#-----------------------------------------------------------------------------
# Help other projects use CMTK.
# Copy the UseCMTK.cmake file to the binary tree for backward compatability.
CONFIGURE_FILE(${CMTK_SOURCE_DIR}/UseCMTK.cmake.in ${CMTK_BINARY_DIR}/UseCMTK.cmake COPYONLY IMMEDIATE)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/UseCMTK.cmake DESTINATION ${CMTK_INSTALL_LIB_DIR} COMPONENT libraries)
# Create the CMTKConfig.cmake file containing the CMTK configuration.
INCLUDE(${CMTK_SOURCE_DIR}/cmtkGenerateCMTKConfig.cmake)
#-----------------------------------------------------------------------------
# Add compiler flags CMTK needs to work on this platform. This must be
# done AFTER the call to CMAKE_EXPORT_BUILD_SETTINGS.
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMTK_REQUIRED_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMTK_REQUIRED_CXX_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMTK_REQUIRED_LINK_FLAGS}")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMTK_REQUIRED_LINK_FLAGS}")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMTK_REQUIRED_LINK_FLAGS}")
#-----------------------------------------------------------------------------
# Settings for rpath when building shared libraries
# Disable rpath altogether if we don't use shared libraries
IF(CMTK_BUILD_SHARED_LIBS)
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# the RPATH to be used when installing
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMTK_INSTALL_LIB_DIR}")
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
ELSE(CMTK_BUILD_SHARED_LIBS)
SET(CMAKE_SKIP_RPATH TRUE)
ENDIF(CMTK_BUILD_SHARED_LIBS)
# Save library dependencies.
EXPORT_LIBRARY_DEPENDENCIES(${CMTK_BINARY_DIR}/CMTKLibraryDepends.cmake)
INSTALL(FILES ${CMTK_BINARY_DIR}/CMTKLibraryDepends.cmake DESTINATION ${CMTK_INSTALL_LIB_DIR} COMPONENT libraries)
#-----------------------------------------------------------------------------
# After everything else is done, do we want to build man pages?
OPTION(BUILD_MANPAGES "Create application manpages" OFF)
#-----------------------------------------------------------------------------
# Configure third-party contributions.
OPTION(BUILD_CONTRIB "Build, install, and package third-party contributions" OFF)
IF(BUILD_CONTRIB)
ADD_SUBDIRECTORY(contrib)
ENDIF(BUILD_CONTRIB)
cmtk-3.0.0/DISCLAIMER 0000644 0001777 0000017 00000000754 11210045173 013046 0 ustar torsten man This software is provided as is, with no warranty whatsoever. It may or may
not compile on your system. Should you get it to compile, it may or may not
run. It may crash at any time. It may destroy your data, format your harddisk,
set your CPU on fire, and give you herpes.
So make sure you have backups of all your valuable data. Be sure not to run
the software as root. And please please PLEASE, do not use it for clinical
purposes, because none of this is approved.
Otherwise, have fun!
cmtk-3.0.0/README.txt 0000644 0001777 0000017 00000010663 12263604537 013223 0 ustar torsten man
The Computational Morphometry Toolkit
==========================================================================
Release Notes -- CMTK 3.0.0
===========================
CHANGES THAT BREAK BACKWARD COMPATIBILITY:
------------------------------------------
1. Affine Transformations:
Affine transformation matrices were broken when shear and non-isotropic scale
were used. Existing transformation files will continue to be read and generate
the same matrices as before, but these matrices will not strictly be
containing the specified scale and shear components. Newly-created
transformation files will use a different meaning of the "shear" coefficients.
https://www.nitrc.org/tracker/index.php?func=detail&aid=7179&group_id=212&atid=877
2. NIFTI Image Import/Export:
Handling of NIFTI qform and sform has changed in a way that breaks regression
tests, but should otherwise be benign. This should also make CMTK largely
NIFTI-compliant in the it puts image-to-physical coordinates into the header's
qform fields, rather than sform as before.
https://www.nitrc.org/tracker/index.php?func=detail&aid=7169&group_id=212&atid=877
OTHER USER-VISIBLE CHANGES:
---------------------------
1. Contributed pipeline scripts from the N-CANDA project, which briefly appeared
in the CMTK code tree, have been moved into their own, project-specific
repository.
2. unwarp_image_phantom default behaviour has been changed to multi-iteration
fitting. Also now supports residual-controlled fitting.
3. mk_analyze_hdr and mk_nifti_hdr default behaviour has changed - data type now
defaults to "byte" and orientation (for Analyze) now defaults to "axial",
rather than being "UNKNOWN"
4. dcm2image default behaviour has changed - potentially identifiable metadata is
no longer embedded in the "Description" field of NIFTI or Analyze images
created from DICOM files.
5. xform2scalar now puts padding pixels where application of transformation
sequence failed (e.g., due to failed numerical inversion of nonrigid
transformation).
6. fit_spline_xform was broken due to two bugs in the spline fitting code. These
have been fixed, but as a result, the tool now generates different output (as
it should, since the previous output was plain invalid).
Platform Support
================
CMTK has been built and tested on the following platforms:
- Linux 64bit (Fedora 20), gcc 4.8.2, CUDA 3.2
- Linux 64bit (Fedora 20), clang 3.3
- Linux 64bit (Fedora 19), gcc 4.8.2, CUDA 3.2
- Linux, i386, Oracle Solaris Studio 12.3 C++ 5.12 2011/11/16
- MacOSX 10.6, x86_64, gcc 4.2.1, CUDA 4.1
- MacOSX 10.6, x86_64, MacPorts gcc 4.8.2, CUDA 4.1
- MacOSX 10.6, x86_64, llvm-gcc-4.2.1
- MacOSX 10.6, x86_64, clang 2.0
- Cygwin, gcc 4.8.2
- Windows XP, VisualStudio 10SP1 (2010 Express Edition), CUDA 4.1
- Windows 7 64bit, VisualStudio 2012 Express for Desktop, CUDA 4.1
Platform-Specific Issues
========================
MacOS-X
-------
- Code coverage tests are only supported with gcc compiler and SDK 10.6. Older
SDKs or the clang and llvm compiler front-ends do not support code coverage.
http://www.nitrc.org/tracker/index.php?func=detail&aid=5450&group_id=212&atid=877
- To use a pre-compiled binary distribution of CMTK on MacOS, the following
MacPorts packages have to be installed under /opt/local:
- qt4
- sqlite3
- dcmtk
SolarisStudio Compiler, Linux/Intel
-----------------------------------
- SolarisStudio C++ 12.2 crashes when compiling the "Numerics" library with
full optimization, -O3. A bug report has been filed with, and accepted by,
Oracle:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6989625
Workaround: build "MinSizeRel" configuration, which sets optimization level
to O2. Note that OpenMP must be disabled, because otherwise optimization
is bumped back to O3 by default.
This problem is also fixed in SolarisStudio 12.3, but see next issue.
- SolarisStudio C++ 12.3 crashes when compiling the file
"cmtkEchoPlanarUnwarpFunctional.cxx" with OpenMP support turned on.
Workaround: set "CMTK_USE_OPENMP" configuration option to "OFF"; this will
lead to much of CMTK's functionality executing single-threaded.
Open64 Compiler
---------------
- CMTK does not build in Release mode with the Open64 compiler due to internal
compiler errors.
==========================================================================
This software is available from
http://www.nitrc.org/projects/cmtk/
==========================================================================
cmtk-3.0.0/Utilities/ 0000755 0001777 0000017 00000000000 12263615445 013472 5 ustar torsten man cmtk-3.0.0/Utilities/mxml/ 0000755 0001777 0000017 00000000000 12263615446 014450 5 ustar torsten man cmtk-3.0.0/Utilities/mxml/test.xml 0000644 0001777 0000017 00000001543 11210045173 016135 0 ustar torsten man
123Now is the time for all good men to come to the aid of their
country.
cmtk-3.0.0/Utilities/mxml/install-sh 0000755 0001777 0000017 00000012671 11210045173 016444 0 ustar torsten man #!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
:
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
:
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
:
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
:
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
:
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0
cmtk-3.0.0/Utilities/mxml/mxml-get.c 0000644 0001777 0000017 00000022012 11747570117 016344 0 ustar torsten man /*
* "$Id: mxml-get.c 427 2011-01-03 02:03:29Z mike $"
*
* Node get functions for Mini-XML, a small XML-like file parsing library.
*
* Copyright 2011 by Michael R Sweet.
*
* These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "COPYING"
* which should have been included with this file. If this file is
* missing or damaged, see the license at:
*
* http://www.minixml.org/
*
* Contents:
*
* mxmlGetCDATA() - Get the value for a CDATA node.
* mxmlGetCustom() - Get the value for a custom node.
* mxmlGetElement() - Get the name for an element node.
* mxmlGetFirstChild() - Get the first child of an element node.
* mxmlGetInteger() - Get the integer value from the specified node or its
* first child.
* mxmlGetLastChild() - Get the last child of an element node.
* mxmlGetNextSibling() - Get the next node for the current parent.
* mxmlGetOpaque() - Get an opaque string value for a node or its first
* child.
* mxmlGetParent() - Get the parent node.
* mxmlGetPrevSibling() - Get the previous node for the current parent.
* mxmlGetReal() - Get the real value for a node or its first child.
* mxmlGetText() - Get the text value for a node or its first child.
* mxmlGetType() - Get the node type.
* mxmlGetUserData() - Get the user data pointer for a node.
*/
/*
* Include necessary headers...
*/
#include "config.h"
#include "mxml.h"
/*
* 'mxmlGetCDATA()' - Get the value for a CDATA node.
*
* @code NULL@ is returned if the node is not a CDATA element.
*
* @since Mini-XML 2.7@
*/
const char * /* O - CDATA value or NULL */
mxmlGetCDATA(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node || node->type != MXML_ELEMENT ||
strncmp(node->value.element.name, "![CDATA[", 8))
return (NULL);
/*
* Return the text following the CDATA declaration...
*/
return (node->value.element.name + 8);
}
/*
* 'mxmlGetCustom()' - Get the value for a custom node.
*
* @code NULL@ is returned if the node (or its first child) is not a custom
* value node.
*
* @since Mini-XML 2.7@
*/
const void * /* O - Custom value or NULL */
mxmlGetCustom(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node)
return (NULL);
/*
* Return the integer value...
*/
if (node->type == MXML_CUSTOM)
return (node->value.custom.data);
else if (node->type == MXML_ELEMENT &&
node->child &&
node->child->type == MXML_CUSTOM)
return (node->child->value.custom.data);
else
return (NULL);
}
/*
* 'mxmlGetElement()' - Get the name for an element node.
*
* @code NULL@ is returned if the node is not an element node.
*
* @since Mini-XML 2.7@
*/
const char * /* O - Element name or NULL */
mxmlGetElement(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node || node->type != MXML_ELEMENT)
return (NULL);
/*
* Return the element name...
*/
return (node->value.element.name);
}
/*
* 'mxmlGetFirstChild()' - Get the first child of an element node.
*
* @code NULL@ is returned if the node is not an element node or if the node
* has no children.
*
* @since Mini-XML 2.7@
*/
mxml_node_t * /* O - First child or NULL */
mxmlGetFirstChild(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node || node->type != MXML_ELEMENT)
return (NULL);
/*
* Return the first child node...
*/
return (node->child);
}
/*
* 'mxmlGetInteger()' - Get the integer value from the specified node or its
* first child.
*
* 0 is returned if the node (or its first child) is not an integer value node.
*
* @since Mini-XML 2.7@
*/
int /* O - Integer value or 0 */
mxmlGetInteger(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node)
return (0);
/*
* Return the integer value...
*/
if (node->type == MXML_INTEGER)
return (node->value.integer);
else if (node->type == MXML_ELEMENT &&
node->child &&
node->child->type == MXML_INTEGER)
return (node->child->value.integer);
else
return (0);
}
/*
* 'mxmlGetLastChild()' - Get the last child of an element node.
*
* @code NULL@ is returned if the node is not an element node or if the node
* has no children.
*
* @since Mini-XML 2.7@
*/
mxml_node_t * /* O - Last child or NULL */
mxmlGetLastChild(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node || node->type != MXML_ELEMENT)
return (NULL);
/*
* Return the node type...
*/
return (node->last_child);
}
/*
* 'mxmlGetNextSibling()' - Get the next node for the current parent.
*
* @code NULL@ is returned if this is the last child for the current parent.
*
* @since Mini-XML 2.7@
*/
mxml_node_t *
mxmlGetNextSibling(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node)
return (NULL);
/*
* Return the node type...
*/
return (node->next);
}
/*
* 'mxmlGetOpaque()' - Get an opaque string value for a node or its first child.
*
* @code NULL@ is returned if the node (or its first child) is not an opaque
* value node.
*
* @since Mini-XML 2.7@
*/
const char * /* O - Opaque string or NULL */
mxmlGetOpaque(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node)
return (NULL);
/*
* Return the integer value...
*/
if (node->type == MXML_OPAQUE)
return (node->value.opaque);
else if (node->type == MXML_ELEMENT &&
node->child &&
node->child->type == MXML_OPAQUE)
return (node->child->value.opaque);
else
return (NULL);
}
/*
* 'mxmlGetParent()' - Get the parent node.
*
* @code NULL@ is returned for a root node.
*
* @since Mini-XML 2.7@
*/
mxml_node_t * /* O - Parent node or NULL */
mxmlGetParent(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node)
return (NULL);
/*
* Return the node type...
*/
return (node->parent);
}
/*
* 'mxmlGetPrevSibling()' - Get the previous node for the current parent.
*
* @code NULL@ is returned if this is the first child for the current parent.
*
* @since Mini-XML 2.7@
*/
mxml_node_t * /* O - Previous node or NULL */
mxmlGetPrevSibling(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node)
return (NULL);
/*
* Return the node type...
*/
return (node->prev);
}
/*
* 'mxmlGetReal()' - Get the real value for a node or its first child.
*
* 0.0 is returned if the node (or its first child) is not a real value node.
*
* @since Mini-XML 2.7@
*/
double /* O - Real value or 0.0 */
mxmlGetReal(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node)
return (0.0);
/*
* Return the integer value...
*/
if (node->type == MXML_REAL)
return (node->value.real);
else if (node->type == MXML_ELEMENT &&
node->child &&
node->child->type == MXML_REAL)
return (node->child->value.real);
else
return (0.0);
}
/*
* 'mxmlGetText()' - Get the text value for a node or its first child.
*
* @code NULL@ is returned if the node (or its first child) is not a text node.
* The "whitespace" argument can be NULL.
*
* @since Mini-XML 2.7@
*/
const char * /* O - Text string or NULL */
mxmlGetText(mxml_node_t *node, /* I - Node to get */
int *whitespace) /* O - 1 if string is preceded by whitespace, 0 otherwise */
{
/*
* Range check input...
*/
if (!node)
{
if (whitespace)
*whitespace = 0;
return (NULL);
}
/*
* Return the integer value...
*/
if (node->type == MXML_TEXT)
{
if (whitespace)
*whitespace = node->value.text.whitespace;
return (node->value.text.string);
}
else if (node->type == MXML_ELEMENT &&
node->child &&
node->child->type == MXML_TEXT)
{
if (whitespace)
*whitespace = node->child->value.text.whitespace;
return (node->child->value.text.string);
}
else
{
if (whitespace)
*whitespace = 0;
return (NULL);
}
}
/*
* 'mxmlGetType()' - Get the node type.
*
* @code MXML_IGNORE@ is returned if "node" is @code NULL@.
*
* @since Mini-XML 2.7@
*/
mxml_type_t /* O - Type of node */
mxmlGetType(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node)
return (MXML_IGNORE);
/*
* Return the node type...
*/
return (node->type);
}
/*
* 'mxmlGetUserData()' - Get the user data pointer for a node.
*
* @since Mini-XML 2.7@
*/
void * /* O - User data pointer */
mxmlGetUserData(mxml_node_t *node) /* I - Node to get */
{
/*
* Range check input...
*/
if (!node)
return (NULL);
/*
* Return the user data pointer...
*/
return (node->user_data);
}
/*
* End of "$Id: mxml-get.c 427 2011-01-03 02:03:29Z mike $".
*/
cmtk-3.0.0/Utilities/mxml/config.h.cmake 0000644 0001777 0000017 00000004271 11643636605 017152 0 ustar torsten man /*
* "$Id: config.h.in 387 2009-04-18 17:05:52Z mike $"
*
* Configuration file for Mini-XML, a small XML-like file parsing library.
*
* Copyright 2003-2009 by Michael Sweet.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
/*
* Include necessary headers...
*/
/*
* add "cmtk_" prefix to exported symbols - we are building this library bundled with CMTK
*/
#include
#include
#include
#include
#include
#include
/*
* Version number...
*/
#define MXML_VERSION "@MXML_VERSION@"
/*
* Inline function support...
*/
#define inline @C_INLINE@
/*
* Long long support...
*/
#cmakedefine HAVE_LONG_LONG
/*
* Do we have the snprintf() and vsnprintf() functions?
*/
#cmakedefine HAVE_SNPRINTF
#cmakedefine HAVE_VSNPRINTF
/*
* Do we have the strXXX() functions?
*/
#cmakedefine HAVE_STRDUP
/*
* Do we have threading support?
*/
#cmakedefine HAVE_PTHREAD_H
/*
* Define prototypes for string functions as needed...
*/
# ifndef HAVE_STRDUP
extern char *_mxml_strdup(const char *);
# define strdup _mxml_strdup
# endif /* !HAVE_STRDUP */
extern char *_mxml_strdupf(const char *, ...);
extern char *_mxml_vstrdupf(const char *, va_list);
# ifndef HAVE_SNPRINTF
extern int _mxml_snprintf(char *, size_t, const char *, ...);
# define snprintf _mxml_snprintf
# endif /* !HAVE_SNPRINTF */
# ifndef HAVE_VSNPRINTF
extern int _mxml_vsnprintf(char *, size_t, const char *, va_list);
# define vsnprintf _mxml_vsnprintf
# endif /* !HAVE_VSNPRINTF */
#ifdef _MSC_VER
#if _MSC_VER >= 1400
/* disable warnings about "deprecated" C runtime functions */
#pragma warning( disable : 4996 )
#endif
#endif
/*
* End of "$Id: config.h.in 387 2009-04-18 17:05:52Z mike $".
*/
cmtk-3.0.0/Utilities/mxml/mxml-entity.c 0000644 0001777 0000017 00000024432 11747570117 017111 0 ustar torsten man /*
* "$Id: mxml-entity.c 408 2010-09-19 05:26:46Z mike $"
*
* Character entity support code for Mini-XML, a small XML-like
* file parsing library.
*
* Copyright 2003-2010 by Michael R Sweet.
*
* These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "COPYING"
* which should have been included with this file. If this file is
* missing or damaged, see the license at:
*
* http://www.minixml.org/
*
* Contents:
*
* mxmlEntityAddCallback() - Add a callback to convert entities to
* Unicode.
* mxmlEntityGetName() - Get the name that corresponds to the
* character value.
* mxmlEntityGetValue() - Get the character corresponding to a named
* entity.
* mxmlEntityRemoveCallback() - Remove a callback.
* _mxml_entity_cb() - Lookup standard (X)HTML entities.
*/
/*
* Include necessary headers...
*/
#include "mxml-private.h"
/*
* 'mxmlEntityAddCallback()' - Add a callback to convert entities to Unicode.
*/
int /* O - 0 on success, -1 on failure */
mxmlEntityAddCallback(
mxml_entity_cb_t cb) /* I - Callback function to add */
{
_mxml_global_t *global = _mxml_global();
/* Global data */
if (global->num_entity_cbs < (int)(sizeof(global->entity_cbs) / sizeof(global->entity_cbs[0])))
{
global->entity_cbs[global->num_entity_cbs] = cb;
global->num_entity_cbs ++;
return (0);
}
else
{
mxml_error("Unable to add entity callback!");
return (-1);
}
}
/*
* 'mxmlEntityGetName()' - Get the name that corresponds to the character value.
*
* If val does not need to be represented by a named entity, NULL is returned.
*/
const char * /* O - Entity name or NULL */
mxmlEntityGetName(int val) /* I - Character value */
{
switch (val)
{
case '&' :
return ("amp");
case '<' :
return ("lt");
case '>' :
return ("gt");
case '\"' :
return ("quot");
default :
return (NULL);
}
}
/*
* 'mxmlEntityGetValue()' - Get the character corresponding to a named entity.
*
* The entity name can also be a numeric constant. -1 is returned if the
* name is not known.
*/
int /* O - Character value or -1 on error */
mxmlEntityGetValue(const char *name) /* I - Entity name */
{
int i; /* Looping var */
int ch; /* Character value */
_mxml_global_t *global = _mxml_global();
/* Global data */
for (i = 0; i < global->num_entity_cbs; i ++)
if ((ch = (global->entity_cbs[i])(name)) >= 0)
return (ch);
return (-1);
}
/*
* 'mxmlEntityRemoveCallback()' - Remove a callback.
*/
void
mxmlEntityRemoveCallback(
mxml_entity_cb_t cb) /* I - Callback function to remove */
{
int i; /* Looping var */
_mxml_global_t *global = _mxml_global();
/* Global data */
for (i = 0; i < global->num_entity_cbs; i ++)
if (cb == global->entity_cbs[i])
{
/*
* Remove the callback...
*/
global->num_entity_cbs --;
if (i < global->num_entity_cbs)
memmove(global->entity_cbs + i, global->entity_cbs + i + 1,
(global->num_entity_cbs - i) * sizeof(global->entity_cbs[0]));
return;
}
}
/*
* '_mxml_entity_cb()' - Lookup standard (X)HTML entities.
*/
int /* O - Unicode value or -1 */
_mxml_entity_cb(const char *name) /* I - Entity name */
{
int diff, /* Difference between names */
current, /* Current entity in search */
first, /* First entity in search */
last; /* Last entity in search */
static const struct
{
const char *name; /* Entity name */
int val; /* Character value */
} entities[] =
{
{ "AElig", 198 },
{ "Aacute", 193 },
{ "Acirc", 194 },
{ "Agrave", 192 },
{ "Alpha", 913 },
{ "Aring", 197 },
{ "Atilde", 195 },
{ "Auml", 196 },
{ "Beta", 914 },
{ "Ccedil", 199 },
{ "Chi", 935 },
{ "Dagger", 8225 },
{ "Delta", 916 },
{ "Dstrok", 208 },
{ "ETH", 208 },
{ "Eacute", 201 },
{ "Ecirc", 202 },
{ "Egrave", 200 },
{ "Epsilon", 917 },
{ "Eta", 919 },
{ "Euml", 203 },
{ "Gamma", 915 },
{ "Iacute", 205 },
{ "Icirc", 206 },
{ "Igrave", 204 },
{ "Iota", 921 },
{ "Iuml", 207 },
{ "Kappa", 922 },
{ "Lambda", 923 },
{ "Mu", 924 },
{ "Ntilde", 209 },
{ "Nu", 925 },
{ "OElig", 338 },
{ "Oacute", 211 },
{ "Ocirc", 212 },
{ "Ograve", 210 },
{ "Omega", 937 },
{ "Omicron", 927 },
{ "Oslash", 216 },
{ "Otilde", 213 },
{ "Ouml", 214 },
{ "Phi", 934 },
{ "Pi", 928 },
{ "Prime", 8243 },
{ "Psi", 936 },
{ "Rho", 929 },
{ "Scaron", 352 },
{ "Sigma", 931 },
{ "THORN", 222 },
{ "Tau", 932 },
{ "Theta", 920 },
{ "Uacute", 218 },
{ "Ucirc", 219 },
{ "Ugrave", 217 },
{ "Upsilon", 933 },
{ "Uuml", 220 },
{ "Xi", 926 },
{ "Yacute", 221 },
{ "Yuml", 376 },
{ "Zeta", 918 },
{ "aacute", 225 },
{ "acirc", 226 },
{ "acute", 180 },
{ "aelig", 230 },
{ "agrave", 224 },
{ "alefsym", 8501 },
{ "alpha", 945 },
{ "amp", '&' },
{ "and", 8743 },
{ "ang", 8736 },
{ "apos", '\'' },
{ "aring", 229 },
{ "asymp", 8776 },
{ "atilde", 227 },
{ "auml", 228 },
{ "bdquo", 8222 },
{ "beta", 946 },
{ "brkbar", 166 },
{ "brvbar", 166 },
{ "bull", 8226 },
{ "cap", 8745 },
{ "ccedil", 231 },
{ "cedil", 184 },
{ "cent", 162 },
{ "chi", 967 },
{ "circ", 710 },
{ "clubs", 9827 },
{ "cong", 8773 },
{ "copy", 169 },
{ "crarr", 8629 },
{ "cup", 8746 },
{ "curren", 164 },
{ "dArr", 8659 },
{ "dagger", 8224 },
{ "darr", 8595 },
{ "deg", 176 },
{ "delta", 948 },
{ "diams", 9830 },
{ "die", 168 },
{ "divide", 247 },
{ "eacute", 233 },
{ "ecirc", 234 },
{ "egrave", 232 },
{ "empty", 8709 },
{ "emsp", 8195 },
{ "ensp", 8194 },
{ "epsilon", 949 },
{ "equiv", 8801 },
{ "eta", 951 },
{ "eth", 240 },
{ "euml", 235 },
{ "euro", 8364 },
{ "exist", 8707 },
{ "fnof", 402 },
{ "forall", 8704 },
{ "frac12", 189 },
{ "frac14", 188 },
{ "frac34", 190 },
{ "frasl", 8260 },
{ "gamma", 947 },
{ "ge", 8805 },
{ "gt", '>' },
{ "hArr", 8660 },
{ "harr", 8596 },
{ "hearts", 9829 },
{ "hellip", 8230 },
{ "hibar", 175 },
{ "iacute", 237 },
{ "icirc", 238 },
{ "iexcl", 161 },
{ "igrave", 236 },
{ "image", 8465 },
{ "infin", 8734 },
{ "int", 8747 },
{ "iota", 953 },
{ "iquest", 191 },
{ "isin", 8712 },
{ "iuml", 239 },
{ "kappa", 954 },
{ "lArr", 8656 },
{ "lambda", 955 },
{ "lang", 9001 },
{ "laquo", 171 },
{ "larr", 8592 },
{ "lceil", 8968 },
{ "ldquo", 8220 },
{ "le", 8804 },
{ "lfloor", 8970 },
{ "lowast", 8727 },
{ "loz", 9674 },
{ "lrm", 8206 },
{ "lsaquo", 8249 },
{ "lsquo", 8216 },
{ "lt", '<' },
{ "macr", 175 },
{ "mdash", 8212 },
{ "micro", 181 },
{ "middot", 183 },
{ "minus", 8722 },
{ "mu", 956 },
{ "nabla", 8711 },
{ "nbsp", 160 },
{ "ndash", 8211 },
{ "ne", 8800 },
{ "ni", 8715 },
{ "not", 172 },
{ "notin", 8713 },
{ "nsub", 8836 },
{ "ntilde", 241 },
{ "nu", 957 },
{ "oacute", 243 },
{ "ocirc", 244 },
{ "oelig", 339 },
{ "ograve", 242 },
{ "oline", 8254 },
{ "omega", 969 },
{ "omicron", 959 },
{ "oplus", 8853 },
{ "or", 8744 },
{ "ordf", 170 },
{ "ordm", 186 },
{ "oslash", 248 },
{ "otilde", 245 },
{ "otimes", 8855 },
{ "ouml", 246 },
{ "para", 182 },
{ "part", 8706 },
{ "permil", 8240 },
{ "perp", 8869 },
{ "phi", 966 },
{ "pi", 960 },
{ "piv", 982 },
{ "plusmn", 177 },
{ "pound", 163 },
{ "prime", 8242 },
{ "prod", 8719 },
{ "prop", 8733 },
{ "psi", 968 },
{ "quot", '\"' },
{ "rArr", 8658 },
{ "radic", 8730 },
{ "rang", 9002 },
{ "raquo", 187 },
{ "rarr", 8594 },
{ "rceil", 8969 },
{ "rdquo", 8221 },
{ "real", 8476 },
{ "reg", 174 },
{ "rfloor", 8971 },
{ "rho", 961 },
{ "rlm", 8207 },
{ "rsaquo", 8250 },
{ "rsquo", 8217 },
{ "sbquo", 8218 },
{ "scaron", 353 },
{ "sdot", 8901 },
{ "sect", 167 },
{ "shy", 173 },
{ "sigma", 963 },
{ "sigmaf", 962 },
{ "sim", 8764 },
{ "spades", 9824 },
{ "sub", 8834 },
{ "sube", 8838 },
{ "sum", 8721 },
{ "sup", 8835 },
{ "sup1", 185 },
{ "sup2", 178 },
{ "sup3", 179 },
{ "supe", 8839 },
{ "szlig", 223 },
{ "tau", 964 },
{ "there4", 8756 },
{ "theta", 952 },
{ "thetasym", 977 },
{ "thinsp", 8201 },
{ "thorn", 254 },
{ "tilde", 732 },
{ "times", 215 },
{ "trade", 8482 },
{ "uArr", 8657 },
{ "uacute", 250 },
{ "uarr", 8593 },
{ "ucirc", 251 },
{ "ugrave", 249 },
{ "uml", 168 },
{ "upsih", 978 },
{ "upsilon", 965 },
{ "uuml", 252 },
{ "weierp", 8472 },
{ "xi", 958 },
{ "yacute", 253 },
{ "yen", 165 },
{ "yuml", 255 },
{ "zeta", 950 },
{ "zwj", 8205 },
{ "zwnj", 8204 }
};
/*
* Do a binary search for the named entity...
*/
first = 0;
last = (int)(sizeof(entities) / sizeof(entities[0]) - 1);
while ((last - first) > 1)
{
current = (first + last) / 2;
if ((diff = strcmp(name, entities[current].name)) == 0)
return (entities[current].val);
else if (diff < 0)
last = current;
else
first = current;
}
/*
* If we get here, there is a small chance that there is still
* a match; check first and last...
*/
if (!strcmp(name, entities[first].name))
return (entities[first].val);
else if (!strcmp(name, entities[last].name))
return (entities[last].val);
else
return (-1);
}
/*
* End of "$Id: mxml-entity.c 408 2010-09-19 05:26:46Z mike $".
*/
cmtk-3.0.0/Utilities/mxml/mxml-string.c 0000644 0001777 0000017 00000023214 11747570117 017100 0 ustar torsten man /*
* "$Id: mxml-string.c 424 2010-12-25 16:21:50Z mike $"
*
* String functions for Mini-XML, a small XML-like file parsing library.
*
* Copyright 2003-2010 by Michael R Sweet.
*
* These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "COPYING"
* which should have been included with this file. If this file is
* missing or damaged, see the license at:
*
* http://www.minixml.org/
*
* Contents:
*
* _mxml_snprintf() - Format a string.
* _mxml_strdup() - Duplicate a string.
* _mxml_strdupf() - Format and duplicate a string.
* _mxml_vsnprintf() - Format a string into a fixed size buffer.
* _mxml_vstrdupf() - Format and duplicate a string.
*/
/*
* Include necessary headers...
*/
#include "config.h"
/*
* The va_copy macro is part of C99, but many compilers don't implement it.
* Provide a "direct assignment" implmentation when va_copy isn't defined...
*/
#ifndef va_copy
# ifdef __va_copy
# define va_copy(dst,src) __va_copy(dst,src)
# else
# define va_copy(dst,src) memcpy(&dst, &src, sizeof(va_list))
# endif /* __va_copy */
#endif /* va_copy */
#ifndef HAVE_SNPRINTF
/*
* '_mxml_snprintf()' - Format a string.
*/
int /* O - Number of bytes formatted */
_mxml_snprintf(char *buffer, /* I - Output buffer */
size_t bufsize, /* I - Size of output buffer */
const char *format, /* I - Printf-style format string */
...) /* I - Additional arguments as needed */
{
va_list ap; /* Argument list */
int bytes; /* Number of bytes formatted */
va_start(ap, format);
bytes = vsnprintf(buffer, bufsize, format, ap);
va_end(ap);
return (bytes);
}
#endif /* !HAVE_SNPRINTF */
/*
* '_mxml_strdup()' - Duplicate a string.
*/
#ifndef HAVE_STRDUP
char * /* O - New string pointer */
_mxml_strdup(const char *s) /* I - String to duplicate */
{
char *t; /* New string pointer */
if (s == NULL)
return (NULL);
if ((t = malloc(strlen(s) + 1)) == NULL)
return (NULL);
return (strcpy(t, s));
}
#endif /* !HAVE_STRDUP */
/*
* '_mxml_strdupf()' - Format and duplicate a string.
*/
char * /* O - New string pointer */
_mxml_strdupf(const char *format, /* I - Printf-style format string */
...) /* I - Additional arguments as needed */
{
va_list ap; /* Pointer to additional arguments */
char *s; /* Pointer to formatted string */
/*
* Get a pointer to the additional arguments, format the string,
* and return it...
*/
va_start(ap, format);
s = _mxml_vstrdupf(format, ap);
va_end(ap);
return (s);
}
#ifndef HAVE_VSNPRINTF
/*
* '_mxml_vsnprintf()' - Format a string into a fixed size buffer.
*/
int /* O - Number of bytes formatted */
_mxml_vsnprintf(char *buffer, /* O - Output buffer */
size_t bufsize, /* O - Size of output buffer */
const char *format, /* I - Printf-style format string */
va_list ap) /* I - Pointer to additional arguments */
{
char *bufptr, /* Pointer to position in buffer */
*bufend, /* Pointer to end of buffer */
sign, /* Sign of format width */
size, /* Size character (h, l, L) */
type; /* Format type character */
int width, /* Width of field */
prec; /* Number of characters of precision */
char tformat[100], /* Temporary format string for sprintf() */
*tptr, /* Pointer into temporary format */
temp[1024]; /* Buffer for formatted numbers */
char *s; /* Pointer to string */
int slen; /* Length of string */
int bytes; /* Total number of bytes needed */
/*
* Loop through the format string, formatting as needed...
*/
bufptr = buffer;
bufend = buffer + bufsize - 1;
bytes = 0;
while (*format)
{
if (*format == '%')
{
tptr = tformat;
*tptr++ = *format++;
if (*format == '%')
{
if (bufptr && bufptr < bufend) *bufptr++ = *format;
bytes ++;
format ++;
continue;
}
else if (strchr(" -+#\'", *format))
{
*tptr++ = *format;
sign = *format++;
}
else
sign = 0;
if (*format == '*')
{
/*
* Get width from argument...
*/
format ++;
width = va_arg(ap, int);
snprintf(tptr, sizeof(tformat) - (tptr - tformat), "%d", width);
tptr += strlen(tptr);
}
else
{
width = 0;
while (isdigit(*format & 255))
{
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
width = width * 10 + *format++ - '0';
}
}
if (*format == '.')
{
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
format ++;
if (*format == '*')
{
/*
* Get precision from argument...
*/
format ++;
prec = va_arg(ap, int);
snprintf(tptr, sizeof(tformat) - (tptr - tformat), "%d", prec);
tptr += strlen(tptr);
}
else
{
prec = 0;
while (isdigit(*format & 255))
{
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
prec = prec * 10 + *format++ - '0';
}
}
}
else
prec = -1;
if (*format == 'l' && format[1] == 'l')
{
size = 'L';
if (tptr < (tformat + sizeof(tformat) - 2))
{
*tptr++ = 'l';
*tptr++ = 'l';
}
format += 2;
}
else if (*format == 'h' || *format == 'l' || *format == 'L')
{
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
size = *format++;
}
if (!*format)
break;
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
type = *format++;
*tptr = '\0';
switch (type)
{
case 'E' : /* Floating point formats */
case 'G' :
case 'e' :
case 'f' :
case 'g' :
if ((width + 2) > sizeof(temp))
break;
sprintf(temp, tformat, va_arg(ap, double));
bytes += strlen(temp);
if (bufptr)
{
if ((bufptr + strlen(temp)) > bufend)
{
strncpy(bufptr, temp, (size_t)(bufend - bufptr));
bufptr = bufend;
}
else
{
strcpy(bufptr, temp);
bufptr += strlen(temp);
}
}
break;
case 'B' : /* Integer formats */
case 'X' :
case 'b' :
case 'd' :
case 'i' :
case 'o' :
case 'u' :
case 'x' :
if ((width + 2) > sizeof(temp))
break;
#ifdef HAVE_LONG_LONG
if (size == 'L')
sprintf(temp, tformat, va_arg(ap, long long));
else
#endif /* HAVE_LONG_LONG */
sprintf(temp, tformat, va_arg(ap, int));
bytes += strlen(temp);
if (bufptr)
{
if ((bufptr + strlen(temp)) > bufend)
{
strncpy(bufptr, temp, (size_t)(bufend - bufptr));
bufptr = bufend;
}
else
{
strcpy(bufptr, temp);
bufptr += strlen(temp);
}
}
break;
case 'p' : /* Pointer value */
if ((width + 2) > sizeof(temp))
break;
sprintf(temp, tformat, va_arg(ap, void *));
bytes += strlen(temp);
if (bufptr)
{
if ((bufptr + strlen(temp)) > bufend)
{
strncpy(bufptr, temp, (size_t)(bufend - bufptr));
bufptr = bufend;
}
else
{
strcpy(bufptr, temp);
bufptr += strlen(temp);
}
}
break;
case 'c' : /* Character or character array */
bytes += width;
if (bufptr)
{
if (width <= 1)
*bufptr++ = va_arg(ap, int);
else
{
if ((bufptr + width) > bufend)
width = bufend - bufptr;
memcpy(bufptr, va_arg(ap, char *), (size_t)width);
bufptr += width;
}
}
break;
case 's' : /* String */
if ((s = va_arg(ap, char *)) == NULL)
s = "(null)";
slen = strlen(s);
if (slen > width && prec != width)
width = slen;
bytes += width;
if (bufptr)
{
if ((bufptr + width) > bufend)
width = bufend - bufptr;
if (slen > width)
slen = width;
if (sign == '-')
{
strncpy(bufptr, s, (size_t)slen);
memset(bufptr + slen, ' ', (size_t)(width - slen));
}
else
{
memset(bufptr, ' ', (size_t)(width - slen));
strncpy(bufptr + width - slen, s, (size_t)slen);
}
bufptr += width;
}
break;
case 'n' : /* Output number of chars so far */
*(va_arg(ap, int *)) = bytes;
break;
}
}
else
{
bytes ++;
if (bufptr && bufptr < bufend)
*bufptr++ = *format;
format ++;
}
}
/*
* Nul-terminate the string and return the number of characters needed.
*/
*bufptr = '\0';
return (bytes);
}
#endif /* !HAVE_VSNPRINTF */
/*
* '_mxml_vstrdupf()' - Format and duplicate a string.
*/
char * /* O - New string pointer */
_mxml_vstrdupf(const char *format, /* I - Printf-style format string */
va_list ap) /* I - Pointer to additional arguments */
{
int bytes; /* Number of bytes required */
char *buffer, /* String buffer */
temp[256]; /* Small buffer for first vsnprintf */
va_list apcopy; /* Copy of argument list */
/*
* First format with a tiny buffer; this will tell us how many bytes are
* needed...
*/
va_copy(apcopy, ap);
bytes = vsnprintf(temp, sizeof(temp), format, apcopy);
if (bytes < sizeof(temp))
{
/*
* Hey, the formatted string fits in the tiny buffer, so just dup that...
*/
return (strdup(temp));
}
/*
* Allocate memory for the whole thing and reformat to the new, larger
* buffer...
*/
if ((buffer = calloc(1, bytes + 1)) != NULL)
vsnprintf(buffer, bytes + 1, format, ap);
/*
* Return the new string...
*/
return (buffer);
}
/*
* End of "$Id: mxml-string.c 424 2010-12-25 16:21:50Z mike $".
*/
cmtk-3.0.0/Utilities/mxml/config.h.in 0000644 0001777 0000017 00000003345 11747570117 016501 0 ustar torsten man /*
* "$Id: config.h.in 408 2010-09-19 05:26:46Z mike $"
*
* Configuration file for Mini-XML, a small XML-like file parsing library.
*
* Copyright 2003-2010 by Michael R Sweet.
*
* These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "COPYING"
* which should have been included with this file. If this file is
* missing or damaged, see the license at:
*
* http://www.minixml.org/
*/
/*
* Include necessary headers...
*/
#include
#include
#include
#include
#include
/*
* Version number...
*/
#define MXML_VERSION ""
/*
* Inline function support...
*/
#define inline
/*
* Long long support...
*/
#undef HAVE_LONG_LONG
/*
* Do we have the snprintf() and vsnprintf() functions?
*/
#undef HAVE_SNPRINTF
#undef HAVE_VSNPRINTF
/*
* Do we have the strXXX() functions?
*/
#undef HAVE_STRDUP
/*
* Do we have threading support?
*/
#undef HAVE_PTHREAD_H
/*
* Define prototypes for string functions as needed...
*/
# ifndef HAVE_STRDUP
extern char *_mxml_strdup(const char *);
# define strdup _mxml_strdup
# endif /* !HAVE_STRDUP */
extern char *_mxml_strdupf(const char *, ...);
extern char *_mxml_vstrdupf(const char *, va_list);
# ifndef HAVE_SNPRINTF
extern int _mxml_snprintf(char *, size_t, const char *, ...);
# define snprintf _mxml_snprintf
# endif /* !HAVE_SNPRINTF */
# ifndef HAVE_VSNPRINTF
extern int _mxml_vsnprintf(char *, size_t, const char *, va_list);
# define vsnprintf _mxml_vsnprintf
# endif /* !HAVE_VSNPRINTF */
/*
* End of "$Id: config.h.in 408 2010-09-19 05:26:46Z mike $".
*/
cmtk-3.0.0/Utilities/mxml/testmxml.c 0000644 0001777 0000017 00000043263 11747570117 016502 0 ustar torsten man /*
* "$Id: testmxml.c 439 2011-04-13 15:43:32Z mike $"
*
* Test program for Mini-XML, a small XML-like file parsing library.
*
* Copyright 2003-2011 by Michael R Sweet.
*
* These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "COPYING"
* which should have been included with this file. If this file is
* missing or damaged, see the license at:
*
* http://www.minixml.org/
*
* Contents:
*
* main() - Main entry for test program.
* sax_cb() - SAX callback.
* type_cb() - XML data type callback for mxmlLoadFile()...
* whitespace_cb() - Let the mxmlSaveFile() function know when to insert
* newlines and tabs...
*/
/*
* Include necessary headers...
*/
#include "config.h"
#include "mxml.h"
#ifndef WIN32
# include
#endif /* !WIN32 */
#include
#ifndef O_BINARY
# define O_BINARY 0
#endif /* !O_BINARY */
/*
* Globals...
*/
int event_counts[6];
/*
* Local functions...
*/
void sax_cb(mxml_node_t *node, mxml_sax_event_t event, void *data);
mxml_type_t type_cb(mxml_node_t *node);
const char *whitespace_cb(mxml_node_t *node, int where);
/*
* 'main()' - Main entry for test program.
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line args */
char *argv[]) /* I - Command-line args */
{
int i; /* Looping var */
FILE *fp; /* File to read */
int fd; /* File descriptor */
mxml_node_t *tree, /* XML tree */
*node; /* Node which should be in test.xml */
mxml_index_t *ind; /* XML index */
char buffer[16384]; /* Save string */
static const char *types[] = /* Strings for node types */
{
"MXML_ELEMENT",
"MXML_INTEGER",
"MXML_OPAQUE",
"MXML_REAL",
"MXML_TEXT"
};
/*
* Check arguments...
*/
if (argc != 2)
{
fputs("Usage: testmxml filename.xml\n", stderr);
return (1);
}
/*
* Test the basic functionality...
*/
tree = mxmlNewElement(MXML_NO_PARENT, "element");
if (!tree)
{
fputs("ERROR: No parent node in basic test!\n", stderr);
return (1);
}
if (tree->type != MXML_ELEMENT)
{
fprintf(stderr, "ERROR: Parent has type %s (%d), expected MXML_ELEMENT!\n",
tree->type < MXML_ELEMENT || tree->type > MXML_TEXT ?
"UNKNOWN" : types[tree->type], tree->type);
mxmlDelete(tree);
return (1);
}
if (strcmp(tree->value.element.name, "element"))
{
fprintf(stderr, "ERROR: Parent value is \"%s\", expected \"element\"!\n",
tree->value.element.name);
mxmlDelete(tree);
return (1);
}
mxmlNewInteger(tree, 123);
mxmlNewOpaque(tree, "opaque");
mxmlNewReal(tree, 123.4f);
mxmlNewText(tree, 1, "text");
mxmlLoadString(tree, "string string string",
MXML_NO_CALLBACK);
mxmlLoadString(tree, "1 2 3",
MXML_INTEGER_CALLBACK);
mxmlLoadString(tree, "1.0 2.0 3.0",
MXML_REAL_CALLBACK);
mxmlLoadString(tree, "opaque opaque opaque",
MXML_OPAQUE_CALLBACK);
mxmlLoadString(tree, "valuevalue2"
"", MXML_OPAQUE_CALLBACK);
node = tree->child;
if (!node)
{
fputs("ERROR: No first child node in basic test!\n", stderr);
mxmlDelete(tree);
return (1);
}
if (node->type != MXML_INTEGER)
{
fprintf(stderr, "ERROR: First child has type %s (%d), expected MXML_INTEGER!\n",
node->type < MXML_ELEMENT || node->type > MXML_TEXT ?
"UNKNOWN" : types[node->type], node->type);
mxmlDelete(tree);
return (1);
}
if (node->value.integer != 123)
{
fprintf(stderr, "ERROR: First child value is %d, expected 123!\n",
node->value.integer);
mxmlDelete(tree);
return (1);
}
node = node->next;
if (!node)
{
fputs("ERROR: No second child node in basic test!\n", stderr);
mxmlDelete(tree);
return (1);
}
if (node->type != MXML_OPAQUE)
{
fprintf(stderr, "ERROR: Second child has type %s (%d), expected MXML_OPAQUE!\n",
node->type < MXML_ELEMENT || node->type > MXML_TEXT ?
"UNKNOWN" : types[node->type], node->type);
mxmlDelete(tree);
return (1);
}
if (!node->value.opaque || strcmp(node->value.opaque, "opaque"))
{
fprintf(stderr, "ERROR: Second child value is \"%s\", expected \"opaque\"!\n",
node->value.opaque ? node->value.opaque : "(null)");
mxmlDelete(tree);
return (1);
}
node = node->next;
if (!node)
{
fputs("ERROR: No third child node in basic test!\n", stderr);
mxmlDelete(tree);
return (1);
}
if (node->type != MXML_REAL)
{
fprintf(stderr, "ERROR: Third child has type %s (%d), expected MXML_REAL!\n",
node->type < MXML_ELEMENT || node->type > MXML_TEXT ?
"UNKNOWN" : types[node->type], node->type);
mxmlDelete(tree);
return (1);
}
if (node->value.real != 123.4f)
{
fprintf(stderr, "ERROR: Third child value is %f, expected 123.4!\n",
node->value.real);
mxmlDelete(tree);
return (1);
}
node = node->next;
if (!node)
{
fputs("ERROR: No fourth child node in basic test!\n", stderr);
mxmlDelete(tree);
return (1);
}
if (node->type != MXML_TEXT)
{
fprintf(stderr, "ERROR: Fourth child has type %s (%d), expected MXML_TEXT!\n",
node->type < MXML_ELEMENT || node->type > MXML_TEXT ?
"UNKNOWN" : types[node->type], node->type);
mxmlDelete(tree);
return (1);
}
if (!node->value.text.whitespace ||
!node->value.text.string || strcmp(node->value.text.string, "text"))
{
fprintf(stderr, "ERROR: Fourth child value is %d,\"%s\", expected 1,\"text\"!\n",
node->value.text.whitespace,
node->value.text.string ? node->value.text.string : "(null)");
mxmlDelete(tree);
return (1);
}
for (i = 0; i < 4; i ++)
{
node = node->next;
if (!node)
{
fprintf(stderr, "ERROR: No group #%d child node in basic test!\n", i + 1);
mxmlDelete(tree);
return (1);
}
if (node->type != MXML_ELEMENT)
{
fprintf(stderr, "ERROR: Group child #%d has type %s (%d), expected MXML_ELEMENT!\n",
i + 1, node->type < MXML_ELEMENT || node->type > MXML_TEXT ?
"UNKNOWN" : types[node->type], node->type);
mxmlDelete(tree);
return (1);
}
}
/*
* Test mxmlFindPath...
*/
node = mxmlFindPath(tree, "*/two");
if (!node)
{
fputs("ERROR: Unable to find value for \"*/two\".\n", stderr);
mxmlDelete(tree);
return (1);
}
else if (node->type != MXML_OPAQUE || strcmp(node->value.opaque, "value"))
{
fputs("ERROR: Bad value for \"*/two\".\n", stderr);
mxmlDelete(tree);
return (1);
}
node = mxmlFindPath(tree, "foo/*/two");
if (!node)
{
fputs("ERROR: Unable to find value for \"foo/*/two\".\n", stderr);
mxmlDelete(tree);
return (1);
}
else if (node->type != MXML_OPAQUE || strcmp(node->value.opaque, "value"))
{
fputs("ERROR: Bad value for \"foo/*/two\".\n", stderr);
mxmlDelete(tree);
return (1);
}
node = mxmlFindPath(tree, "foo/bar/one/two");
if (!node)
{
fputs("ERROR: Unable to find value for \"foo/bar/one/two\".\n", stderr);
mxmlDelete(tree);
return (1);
}
else if (node->type != MXML_OPAQUE || strcmp(node->value.opaque, "value"))
{
fputs("ERROR: Bad value for \"foo/bar/one/two\".\n", stderr);
mxmlDelete(tree);
return (1);
}
/*
* Test indices...
*/
ind = mxmlIndexNew(tree, NULL, NULL);
if (!ind)
{
fputs("ERROR: Unable to create index of all nodes!\n", stderr);
mxmlDelete(tree);
return (1);
}
if (ind->num_nodes != 10)
{
fprintf(stderr, "ERROR: Index of all nodes contains %d "
"nodes; expected 10!\n", ind->num_nodes);
mxmlIndexDelete(ind);
mxmlDelete(tree);
return (1);
}
mxmlIndexReset(ind);
if (!mxmlIndexFind(ind, "group", NULL))
{
fputs("ERROR: mxmlIndexFind for \"group\" failed!\n", stderr);
mxmlIndexDelete(ind);
mxmlDelete(tree);
return (1);
}
mxmlIndexDelete(ind);
ind = mxmlIndexNew(tree, "group", NULL);
if (!ind)
{
fputs("ERROR: Unable to create index of groups!\n", stderr);
mxmlDelete(tree);
return (1);
}
if (ind->num_nodes != 4)
{
fprintf(stderr, "ERROR: Index of groups contains %d "
"nodes; expected 4!\n", ind->num_nodes);
mxmlIndexDelete(ind);
mxmlDelete(tree);
return (1);
}
mxmlIndexReset(ind);
if (!mxmlIndexEnum(ind))
{
fputs("ERROR: mxmlIndexEnum failed!\n", stderr);
mxmlIndexDelete(ind);
mxmlDelete(tree);
return (1);
}
mxmlIndexDelete(ind);
ind = mxmlIndexNew(tree, NULL, "type");
if (!ind)
{
fputs("ERROR: Unable to create index of type attributes!\n", stderr);
mxmlDelete(tree);
return (1);
}
if (ind->num_nodes != 3)
{
fprintf(stderr, "ERROR: Index of type attributes contains %d "
"nodes; expected 3!\n", ind->num_nodes);
mxmlIndexDelete(ind);
mxmlDelete(tree);
return (1);
}
mxmlIndexReset(ind);
if (!mxmlIndexFind(ind, NULL, "string"))
{
fputs("ERROR: mxmlIndexFind for \"string\" failed!\n", stderr);
mxmlIndexDelete(ind);
mxmlDelete(tree);
return (1);
}
mxmlIndexDelete(ind);
ind = mxmlIndexNew(tree, "group", "type");
if (!ind)
{
fputs("ERROR: Unable to create index of elements and attributes!\n", stderr);
mxmlDelete(tree);
return (1);
}
if (ind->num_nodes != 3)
{
fprintf(stderr, "ERROR: Index of elements and attributes contains %d "
"nodes; expected 3!\n", ind->num_nodes);
mxmlIndexDelete(ind);
mxmlDelete(tree);
return (1);
}
mxmlIndexReset(ind);
if (!mxmlIndexFind(ind, "group", "string"))
{
fputs("ERROR: mxmlIndexFind for \"string\" failed!\n", stderr);
mxmlIndexDelete(ind);
mxmlDelete(tree);
return (1);
}
mxmlIndexDelete(ind);
/*
* Check the mxmlDelete() works properly...
*/
for (i = 0; i < 9; i ++)
{
if (tree->child)
mxmlDelete(tree->child);
else
{
fprintf(stderr, "ERROR: Child pointer prematurely NULL on child #%d\n",
i + 1);
mxmlDelete(tree);
return (1);
}
}
if (tree->child)
{
fputs("ERROR: Child pointer not NULL after deleting all children!\n", stderr);
return (1);
}
if (tree->last_child)
{
fputs("ERROR: Last child pointer not NULL after deleting all children!\n", stderr);
return (1);
}
mxmlDelete(tree);
/*
* Open the file...
*/
if (argv[1][0] == '<')
tree = mxmlLoadString(NULL, argv[1], type_cb);
else if ((fp = fopen(argv[1], "rb")) == NULL)
{
perror(argv[1]);
return (1);
}
else
{
/*
* Read the file...
*/
tree = mxmlLoadFile(NULL, fp, type_cb);
fclose(fp);
}
if (!tree)
{
fputs("Unable to read XML file!\n", stderr);
return (1);
}
if (!strcmp(argv[1], "test.xml"))
{
/*
* Verify that mxmlFindElement() and indirectly mxmlWalkNext() work
* properly...
*/
if ((node = mxmlFindElement(tree, tree, "choice", NULL, NULL,
MXML_DESCEND)) == NULL)
{
fputs("Unable to find first element in XML tree!\n", stderr);
mxmlDelete(tree);
return (1);
}
if (!mxmlFindElement(node, tree, "choice", NULL, NULL, MXML_NO_DESCEND))
{
fputs("Unable to find second element in XML tree!\n", stderr);
mxmlDelete(tree);
return (1);
}
}
/*
* Print the XML tree...
*/
mxmlSaveFile(tree, stdout, whitespace_cb);
/*
* Save the XML tree to a string and print it...
*/
if (mxmlSaveString(tree, buffer, sizeof(buffer), whitespace_cb) > 0)
fputs(buffer, stderr);
/*
* Delete the tree...
*/
mxmlDelete(tree);
/*
* Read from/write to file descriptors...
*/
if (argv[1][0] != '<')
{
/*
* Open the file again...
*/
if ((fd = open(argv[1], O_RDONLY | O_BINARY)) < 0)
{
perror(argv[1]);
return (1);
}
/*
* Read the file...
*/
tree = mxmlLoadFd(NULL, fd, type_cb);
close(fd);
/*
* Create filename.xmlfd...
*/
snprintf(buffer, sizeof(buffer), "%sfd", argv[1]);
if ((fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666)) < 0)
{
perror(buffer);
mxmlDelete(tree);
return (1);
}
/*
* Write the file...
*/
mxmlSaveFd(tree, fd, whitespace_cb);
close(fd);
/*
* Delete the tree...
*/
mxmlDelete(tree);
}
/*
* Test SAX methods...
*/
memset(event_counts, 0, sizeof(event_counts));
if (argv[1][0] == '<')
mxmlSAXLoadString(NULL, argv[1], type_cb, sax_cb, NULL);
else if ((fp = fopen(argv[1], "rb")) == NULL)
{
perror(argv[1]);
return (1);
}
else
{
/*
* Read the file...
*/
mxmlSAXLoadFile(NULL, fp, type_cb, sax_cb, NULL);
fclose(fp);
}
if (!strcmp(argv[1], "test.xml"))
{
if (event_counts[MXML_SAX_CDATA] != 1)
{
fprintf(stderr, "MXML_SAX_CDATA seen %d times, expected 1 times!\n",
event_counts[MXML_SAX_CDATA]);
return (1);
}
if (event_counts[MXML_SAX_COMMENT] != 1)
{
fprintf(stderr, "MXML_SAX_COMMENT seen %d times, expected 1 times!\n",
event_counts[MXML_SAX_COMMENT]);
return (1);
}
if (event_counts[MXML_SAX_DATA] != 60)
{
fprintf(stderr, "MXML_SAX_DATA seen %d times, expected 60 times!\n",
event_counts[MXML_SAX_DATA]);
return (1);
}
if (event_counts[MXML_SAX_DIRECTIVE] != 1)
{
fprintf(stderr, "MXML_SAX_DIRECTIVE seen %d times, expected 1 times!\n",
event_counts[MXML_SAX_DIRECTIVE]);
return (1);
}
if (event_counts[MXML_SAX_ELEMENT_CLOSE] != 20)
{
fprintf(stderr, "MXML_SAX_ELEMENT_CLOSE seen %d times, expected 20 times!\n",
event_counts[MXML_SAX_ELEMENT_CLOSE]);
return (1);
}
if (event_counts[MXML_SAX_ELEMENT_OPEN] != 20)
{
fprintf(stderr, "MXML_SAX_ELEMENT_OPEN seen %d times, expected 20 times!\n",
event_counts[MXML_SAX_ELEMENT_OPEN]);
return (1);
}
}
/*
* Return...
*/
return (0);
}
/*
* 'sax_cb()' - Process nodes via SAX.
*/
void
sax_cb(mxml_node_t *node, /* I - Current node */
mxml_sax_event_t event, /* I - SAX event */
void *data) /* I - SAX user data */
{
/*
* This SAX callback just counts the different events.
*/
event_counts[event] ++;
}
/*
* 'type_cb()' - XML data type callback for mxmlLoadFile()...
*/
mxml_type_t /* O - Data type */
type_cb(mxml_node_t *node) /* I - Element node */
{
const char *type; /* Type string */
/*
* You can lookup attributes and/or use the element name, hierarchy, etc...
*/
if ((type = mxmlElementGetAttr(node, "type")) == NULL)
type = node->value.element.name;
if (!strcmp(type, "integer"))
return (MXML_INTEGER);
else if (!strcmp(type, "opaque") || !strcmp(type, "pre"))
return (MXML_OPAQUE);
else if (!strcmp(type, "real"))
return (MXML_REAL);
else
return (MXML_TEXT);
}
/*
* 'whitespace_cb()' - Let the mxmlSaveFile() function know when to insert
* newlines and tabs...
*/
const char * /* O - Whitespace string or NULL */
whitespace_cb(mxml_node_t *node, /* I - Element node */
int where) /* I - Open or close tag? */
{
mxml_node_t *parent; /* Parent node */
int level; /* Indentation level */
const char *name; /* Name of element */
static const char *tabs = "\t\t\t\t\t\t\t\t";
/* Tabs for indentation */
/*
* We can conditionally break to a new line before or after any element.
* These are just common HTML elements...
*/
name = node->value.element.name;
if (!strcmp(name, "html") || !strcmp(name, "head") || !strcmp(name, "body") ||
!strcmp(name, "pre") || !strcmp(name, "p") ||
!strcmp(name, "h1") || !strcmp(name, "h2") || !strcmp(name, "h3") ||
!strcmp(name, "h4") || !strcmp(name, "h5") || !strcmp(name, "h6"))
{
/*
* Newlines before open and after close...
*/
if (where == MXML_WS_BEFORE_OPEN || where == MXML_WS_AFTER_CLOSE)
return ("\n");
}
else if (!strcmp(name, "dl") || !strcmp(name, "ol") || !strcmp(name, "ul"))
{
/*
* Put a newline before and after list elements...
*/
return ("\n");
}
else if (!strcmp(name, "dd") || !strcmp(name, "dt") || !strcmp(name, "li"))
{
/*
* Put a tab before
's,
's, and
's, and a newline after them...
*/
if (where == MXML_WS_BEFORE_OPEN)
return ("\t");
else if (where == MXML_WS_AFTER_CLOSE)
return ("\n");
}
else if (!strncmp(name, "?xml", 4))
{
if (where == MXML_WS_AFTER_OPEN)
return ("\n");
else
return (NULL);
}
else if (where == MXML_WS_BEFORE_OPEN ||
((!strcmp(name, "choice") || !strcmp(name, "option")) &&
where == MXML_WS_BEFORE_CLOSE))
{
for (level = -1, parent = node->parent;
parent;
level ++, parent = parent->parent);
if (level > 8)
level = 8;
else if (level < 0)
level = 0;
return (tabs + 8 - level);
}
else if (where == MXML_WS_AFTER_CLOSE ||
((!strcmp(name, "group") || !strcmp(name, "option") ||
!strcmp(name, "choice")) &&
where == MXML_WS_AFTER_OPEN))
return ("\n");
else if (where == MXML_WS_AFTER_OPEN && !node->child)
return ("\n");
/*
* Return NULL for no added whitespace...
*/
return (NULL);
}
/*
* End of "$Id: testmxml.c 439 2011-04-13 15:43:32Z mike $".
*/
cmtk-3.0.0/Utilities/mxml/README 0000644 0001777 0000017 00000014152 11747570117 015334 0 ustar torsten man README - 2011-12-20
-------------------
INTRODUCTION
This README file describes the Mini-XML library version 2.7.
Mini-XML is a small XML parsing library that you can use to read XML and
XML-like data files in your application without requiring large non-standard
libraries. Mini-XML only requires an ANSI C compatible compiler (GCC works,
as do most vendors' ANSI C compilers) and a "make" program.
Mini-XML provides the following functionality:
- Reading of UTF-8 and UTF-16 and writing of UTF-8 encoded XML files and
strings.
- Data is stored in a linked-list tree structure, preserving the XML
data hierarchy.
- Supports arbitrary element names, attributes, and attribute values
with no preset limits, just available memory.
- Supports integer, real, opaque ("cdata"), and text data types in
"leaf" nodes.
- Functions for creating and managing trees of data.
- "Find" and "walk" functions for easily locating and navigating trees
of data.
Mini-XML doesn't do validation or other types of processing on the data
based upon schema files or other sources of definition information.
BUILDING Mini-XML
Mini-XML comes with an autoconf-based configure script; just type the
following command to get things going:
./configure
The default install prefix is /usr/local, which can be overridden using the
--prefix option:
./configure --prefix=/foo
Other configure options can be found using the --help option:
./configure --help
Once you have configured the software, type "make" to do the build and run
the test program to verify that things are working, as follows:
make
If you are using Mini-XML under Microsoft Windows with Visual C++ 2008, use
the included project files in the "vcnet" subdirectory to build the library
instead.
INSTALLING Mini-XML
The "install" target will install Mini-XML in the lib and include
directories:
make install
Once you have installed it, use the "-lmxml" option to link your application
against it.
DOCUMENTATION
The documentation is available in the "doc" subdirectory in the files
"mxml.html" (HTML) and "mxml.pdf" (PDF). You can also look at the
"testmxml.c" and "mxmldoc.c" source files for examples of using Mini-XML.
Mini-XML provides a single header file which you include:
#include
Nodes are defined by the "mxml_node_t" structure; the "type" member defines
the node type (element, integer, opaque, real, or text) which determines
which value you want to look at in the "value" union. New nodes can be
created using the "mxmlNewElement()", "mxmlNewInteger()", "mxmlNewOpaque()",
"mxmlNewReal()", and "mxmlNewText()" functions. Only elements can have
child nodes, and the top node must be an element, usually "?xml".
You load an XML file using the "mxmlLoadFile()" function:
FILE *fp;
mxml_node_t *tree;
fp = fopen("filename.xml", "r");
tree = mxmlLoadFile(NULL, fp, MXML_NO_CALLBACK);
fclose(fp);
Similarly, you save an XML file using the "mxmlSaveFile()" function:
FILE *fp;
mxml_node_t *tree;
fp = fopen("filename.xml", "w");
mxmlSaveFile(tree, fp, MXML_NO_CALLBACK);
fclose(fp);
The "mxmlLoadString()", "mxmlSaveAllocString()", and "mxmlSaveString()"
functions load XML node trees from and save XML node trees to strings:
char buffer[8192];
char *ptr;
mxml_node_t *tree;
...
tree = mxmlLoadString(NULL, buffer, MXML_NO_CALLBACK);
...
mxmlSaveString(tree, buffer, sizeof(buffer), MXML_NO_CALLBACK);
...
ptr = mxmlSaveAllocString(tree, MXML_NO_CALLBACK);
You can find a named element/node using the "mxmlFindElement()" function:
mxml_node_t *node = mxmlFindElement(tree, tree, "name", "attr",
"value", MXML_DESCEND);
The "name", "attr", and "value" arguments can be passed as NULL to act as
wildcards, e.g.:
/* Find the first "a" element */
node = mxmlFindElement(tree, tree, "a", NULL, NULL, MXML_DESCEND);
/* Find the first "a" element with "href" attribute */
node = mxmlFindElement(tree, tree, "a", "href", NULL, MXML_DESCEND);
/* Find the first "a" element with "href" to a URL */
node = mxmlFindElement(tree, tree, "a", "href",
"http://www.minixml.org/",
MXML_DESCEND);
/* Find the first element with a "src" attribute*/
node = mxmlFindElement(tree, tree, NULL, "src", NULL, MXML_DESCEND);
/* Find the first element with a "src" = "foo.jpg" */
node = mxmlFindElement(tree, tree, NULL, "src", "foo.jpg",
MXML_DESCEND);
You can also iterate with the same function:
mxml_node_t *node;
for (node = mxmlFindElement(tree, tree, "name", NULL, NULL,
MXML_DESCEND);
node != NULL;
node = mxmlFindElement(node, tree, "name", NULL, NULL,
MXML_DESCEND))
{
... do something ...
}
The "mxmlFindPath()" function finds the (first) value node under a specific
element using a "path":
mxml_node_t *value = mxmlFindPath(tree, "path/to/*/foo/bar");
The "mxmlGetInteger()", "mxmlGetOpaque()", "mxmlGetReal()", and
"mxmlGetText()" functions retrieve the value from a node:
mxml_node_t *node;
int intvalue = mxmlGetInteger(node);
const char *opaquevalue = mxmlGetOpaque(node);
double realvalue = mxmlGetReal(node);
int whitespacevalue;
const char *textvalue = mxmlGetText(node, &whitespacevalue);
Finally, once you are done with the XML data, use the "mxmlDelete()"
function to recursively free the memory that is used for a particular node
or the entire tree:
mxmlDelete(tree);
GETTING HELP AND REPORTING PROBLEMS
The Mini-XML web site provides access to a discussion forum and bug
reporting page:
http://www.minixml.org/
LEGAL STUFF
The Mini-XML library is Copyright 2003-2011 by Michael Sweet. License terms
are described in the file "COPYING".
cmtk-3.0.0/Utilities/mxml/mxml.list.in 0000644 0001777 0000017 00000006316 11210045173 016716 0 ustar torsten man #
# "$Id: mxml.list.in 399 2009-05-17 17:20:51Z mike $"
#
# EPM software list file for Mini-XML, a small XML library.
#
# Copyright 2003-2009 by Michael Sweet.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# Directories...
$prefix=@prefix@
$exec_prefix=@exec_prefix@
$bindir=@bindir@
$datarootdir=@datarootdir@
$docdir=@docdir@
$includedir=@includedir@
$libdir=@libdir@
$mandir=@mandir@
$srcdir=@srcdir@
$PICFLAG=@PICFLAG@
# Product information
%product mxml
%copyright 2003-2009 by Michael Sweet
%vendor Michael Sweet
%license ${srcdir}/COPYING
%readme ${srcdir}/README
%version @VERSION@
%description <