changeset 2638:9a50bb928cad

Added mincmorph build in CMakeLists.txt, changed -version to report minc library version
author Vladimir S. FONOV <vladimir.fonov@gmail.com>
date Tue, 13 Mar 2012 15:09:42 -0400
parents 0b9a5b816213
children 81e021d5b096
files progs/CMakeLists.txt progs/mincmorph/kernel_io.h progs/mincmorph/mincmorph.c
diffstat 3 files changed, 23 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/progs/CMakeLists.txt
+++ b/progs/CMakeLists.txt
@@ -102,18 +102,25 @@
 ADD_EXECUTABLE(minctoraw minctoraw/minctoraw.c)
 ADD_EXECUTABLE(mincwindow mincwindow/mincwindow.c)
 
+
+ADD_EXECUTABLE(mincmorph mincmorph/mincmorph.c
+                         mincmorph/kernel_io.c
+                         mincmorph/kernel_ops.c 
+                         mincmorph/kernel_io.h 
+                         mincmorph/kernel_ops.h )
+TARGET_LINK_LIBRARIES(mincmorph ${VOLUME_IO_LIBRARY} ${MINC2_LIBRARIES} m)
+
+
 ADD_EXECUTABLE(rawtominc rawtominc/rawtominc.c
                             Proglib/convert_origin_to_start.c)
 TARGET_LINK_LIBRARIES(rawtominc m)
 
-
 ADD_EXECUTABLE(voxeltoworld coordinates/voxeltoworld.c)
 TARGET_LINK_LIBRARIES(voxeltoworld ${VOLUME_IO_LIBRARY} ${MINC2_LIBRARIES} m)
 
 ADD_EXECUTABLE(worldtovoxel coordinates/worldtovoxel.c)
 TARGET_LINK_LIBRARIES(worldtovoxel ${VOLUME_IO_LIBRARY} ${MINC2_LIBRARIES} m)
 
-
 ADD_EXECUTABLE(transformtags xfm/transformtags.c)
 TARGET_LINK_LIBRARIES(transformtags ${VOLUME_IO_LIBRARY} ${MINC2_LIBRARIES} m)
 
@@ -146,6 +153,7 @@
    mincstats
    minctoraw
    mincwindow
+   mincmorph
    rawtominc
    voxeltoworld
    worldtovoxel
--- a/progs/mincmorph/kernel_io.h
+++ b/progs/mincmorph/kernel_io.h
@@ -6,7 +6,7 @@
 #define KERNEL_DIMS 5
 
 /* inbuilt kernels */
-int      n_inbuilt_kern;
+extern int      n_inbuilt_kern;
 
 typedef enum {
    K_NULL = 0,
--- a/progs/mincmorph/mincmorph.c
+++ b/progs/mincmorph/mincmorph.c
@@ -34,7 +34,7 @@
 char    *get_real_from_string(char *string, double *value);
 char    *get_string_from_string(char *string, char **value);
 void     calc_volume_range(VIO_Volume * vol, double *min, double *max);
-void     print_version_info(void);
+/* void     print_version_info(void);*/
 
 /* kernel names for pretty output */
 char    *KERN_names[] = { "NULL", "2D04", "2D08", "3D06", "3D26" };
@@ -94,8 +94,8 @@
 ArgvInfo argTable[] = {
    {NULL, ARGV_HELP, (char *)NULL, (char *)NULL,
     "General options:"},
-   {"-version", ARGV_FUNC, (char *)print_version_info, (char *)NULL,
-    "print version info and exit"},
+/*   {"-version", ARGV_FUNC, (char *)print_version_info, (char *)NULL,
+    "print version info and exit"},*/
    {"-verbose", ARGV_CONSTANT, (char *)TRUE, (char *)&verbose,
     "be verbose"},
    {"-clobber", ARGV_CONSTANT, (char *)TRUE, (char *)&clobber,
@@ -368,8 +368,7 @@
          if(op->kernel_id == K_NULL){
 
             /* set up and check for the real filename */
-            (void)realpath(tmp_str, tmp_filename);
-            if(access(tmp_filename, F_OK) != 0){
+            if(!realpath(tmp_str, tmp_filename) || access(tmp_filename, F_OK) != 0){
                fprintf(stderr, "%s: Couldn't find kernel file: %s\n\n", argv[0],
                        tmp_filename);
                exit(EXIT_FAILURE);
@@ -739,10 +738,11 @@
       }
    }
 
-void print_version_info(void)
-{
-   fprintf(stdout, "%s version %s\n", PACKAGE, VERSION);
-   fprintf(stdout, "Comments to %s\n", PACKAGE_BUGREPORT);
-   fprintf(stdout, "\n");
-   exit(EXIT_SUCCESS);
-   }
+/* void print_version_info(void)
+ {
+    fprintf(stdout, "%s version %s\n", PACKAGE, VERSION);
+    fprintf(stdout, "Comments to %s\n", PACKAGE_BUGREPORT);
+    fprintf(stdout, "\n");
+    exit(EXIT_SUCCESS);
+    }
+*/
\ No newline at end of file