[MINC-development] Bug in classify1.1.0 using bayesian priors (and a CMakeLists.txt)

Daniel Garcia (MNI) dgarcia at bic.mni.mcgill.ca
Fri Mar 18 11:52:32 EDT 2011


Hello,

I found a bug in 'classify -bayes' when including bayesian priors, the
classification won't work correctly but without priors it will.

I believe I found the bug in the bayes.cc file. In line 433, I changed :

          fuzzy_bayes_vector[i] *= apriori_vector[
mean_feature_class_vector[i] ];

for
          fuzzy_bayes_vector[i] *= apriori_vector[
mean_feature_class_vector[i] - 1 ];

and now it works. Items in the apriori_vector goes from 0 to (number of
classes -1) and the mean_feature_class_vector goes from 1 to (number of
classes).

Based in the CMakelists.txt in minc and ezminc, I also created a
CMakeLists.txt to do the compilation although some improvements are needed
to better handle the library paths (similar to the CMakeLists.txt in minc
2.0.18).
I don't know if you're interested.

Later


-- 
Daniel Garcia Lorenzo
Postdoctoral Researcher

McConnell Brain Imaging Center
Montreal Neurological Institute
3801 University St
Montreal, QC
CANADA, H3A 2B4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bic.mni.mcgill.ca/pipermail/minc-development/attachments/20110318/2921866f/attachment.htm>
-------------- next part --------------
# CMakeFiles.txt to compile the classify minctool
#
# March, 2011 :Daniel Garcia dgarcia at bic.mni.mcgill.ca
#
# 

cmake_minimum_required (VERSION 2.4) 
project(CLASSIFY)

# PROJECT VARIABLES
SET(CLASSIFY_MAJOR_VERSION "1")
SET(CLASSIFY_MINOR_VERSION "1")
SET(CLASSIFY_PATCH_VERSION "0")
SET(PACKAGE_BUGREPORT "Alex Zijdenbos <zijdenbos at gmail.com>")
SET(PACKAGE_URL "")


# Options to set minc libraries
SET(MINC_ROOT "/usr/local/bic" CACHE PATH "Minc library base")
OPTION(MINC2 "Use minc 2 library" OFF)

INCLUDE(FindPerl)
SET(PERL ${PERL_EXECUTABLE})

IF(MINC2)
  ADD_DEFINITIONS( -DMINC2 )
  set(MINC_LIBS EBTKS volume_io2 minc2 netcdf hdf5 m z)
ELSE(MINC2)
  set(MINC_LIBS EBTKS volume_io minc netcdf m)
ENDIF(MINC2)




# Variables of the classify tool
set(CLASSIFY_DIRS ann bayes fcm hcm knn mindist)
set(CLASSIFY_SOURCES 
  ann/ann.cc 
  bayes/bayes.cc 
  fcm/fcm.cc 
  hcm/hcm.cc 
  knn/knn.cc 
  mindist/mindist.cc
  time_stamp.c)

LINK_DIRECTORIES(
"${MINC_ROOT}/lib"
)
INCLUDE_DIRECTORIES( 
	"${MINC_ROOT}/include"
        ${CLASSIFY_DIRS} ${CLASSIFY_BINARY_DIR}
)

# Compiling executables
#######################
add_executable(classify classify.cc ${CLASSIFY_SOURCES})
target_link_libraries(classify ${MINC_LIBS})

add_executable(voldiff voldiff.c)
target_link_libraries(voldiff ${MINC_LIBS})

add_executable(cleantag  cleantag/cleantag.cc)
target_link_libraries(cleantag ${MINC_LIBS})

# Configure config.h
####################
INCLUDE(${CLASSIFY_SOURCE_DIR}/createConfig.cmake)


# Configure scripts (using @only)
################################
CONFIGURE_FILE(${CLASSIFY_SOURCE_DIR}/scripts/classify_clean.in ${CLASSIFY_BINARY_DIR}/classify_clean @ONLY)
CONFIGURE_FILE(${CLASSIFY_SOURCE_DIR}/scripts/insect.in ${CLASSIFY_BINARY_DIR}/insect @ONLY)

# Instalation
##################
INSTALL(TARGETS classify voldiff cleantag RUNTIME DESTINATION bin/)
INSTALL(FILES ${CLASSIFY_BINARY_DIR}/classify_clean ${CLASSIFY_BINARY_DIR}/insect DESTINATION bin/ PERMISSIONS WORLD_EXECUTE)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.h.in.cmake
Type: text/x-cmake
Size: 2146 bytes
Desc: not available
URL: <http://www.bic.mni.mcgill.ca/pipermail/minc-development/attachments/20110318/2921866f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: createConfig.cmake
Type: text/x-cmake
Size: 779 bytes
Desc: not available
URL: <http://www.bic.mni.mcgill.ca/pipermail/minc-development/attachments/20110318/2921866f/attachment-0001.bin>


More information about the MINC-development mailing list