From jgsled@bottom.bic.mni.mcgill.ca  Fri Mar  9 15:55:23 2001
>From jgsled  Fri Mar  9 15:55:23 2001
Return-Path: <jgsled>
Received: (from jgsled@localhost)
	by bottom.bic.mni.mcgill.ca (8.9.3/8.9.3) id PAA07097
	for stever@bic.mni.mcgill.ca; Fri, 9 Mar 2001 15:55:23 -0500 (EST)
Date: Fri, 9 Mar 2001 15:55:22 -0500
From: John SLED <jgsled@bic.mni.mcgill.ca>
To: Steve ROBBINS <stever@bic.mni.mcgill.ca>
Subject: Re: Questions about your minc software from MPI Cologne N3 package
Message-ID: <20010309155522.C24475@bottom.bic.mni.mcgill.ca>
References: <200103011621.RAA22152@minto.mpg.de> <20010305105913.D13705@bottom.bic.mni.mcgill.ca>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="gKMricLos+KVdGMg"
Content-Disposition: inline
User-Agent: Mutt/1.3.9i
In-Reply-To: <20010305105913.D13705@bottom.bic.mni.mcgill.ca>; from stever@bic.mni.mcgill.ca on Mon, Mar 05, 2001 at 10:59:13AM -0500
Status: RO
Content-Length: 5822
Lines: 173


--gKMricLos+KVdGMg
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline


Dear Helmut,

My C++ code dates from a time when C++ compilers were more lax.
I've attached to this message a set of patches which should clean
up the difficulties you mentioned.  If N3 is a subdirectory of the 
current directory then

patch -p0 < mni_n3_1.04_patch_20010309

should make some changes.  In addition, a colleague had forwarded me some 
changes that are specific to solaris which I have included at the end of
this message.

with regards,

John Sled

McConnell Brain Imaging Centre            Tel: (514) 398-8547
Montreal Neurological Institute           Fax: (514) 398-2975
3801 University Street, Room WB208        Email: jgsled@bic.mni.mcgill.ca
Montreal, Quebec  H3A 2B4 Canada

---------------------------------------

PREAMBLE:
N3 built on Sun-Ultra60 running Solaris 7, gcc 2.95.2 and gnu-make 3.78.
All the other required packages (PERL, NETCDF, MINC, MNI-PERLLIB)
built as per instructions with no problems. All file paths will be relative to 
the N3 source directory.

BEFORE RUNNING CONFIGURE
Add double-quotes (") around $CPP_COMPILER on line 1071 of N3/configure

AFTER RUNNING CONFIGURE

In N3/Makefile.include add 
	-Wno-non-template-friend
to the CCFLAGS line

In N3/extern/src/CLAPACK/make.inc
	Change cc to gcc (twice).

In N3/extern/src/CLAPACK/F2CLIBS/libF77/makefile
	Change cc to gcc.
	Remove the -x option from the ld line (obsoleted by Solaris).

In N3/src/Base/templates/Matrix.c
	Line 253 change "0" to "(Type)0"
	Line 1684 change "factor" to "(double) factor"
	Line 2987, 3006 change "m" to "(double)m"

In N3/src/Base/templates/Matrix.h
	Line 565, 573 change "nElements()" to "(double)nElements()"

In N3/src/Base/templates/SimpleArray.c
	Line 28 insert "#include <ieeefp.h>" (for the finite() function).

In N3/src/SharpenHist/sharpen_hist.c
	Line 44 insert "#include <ieeefp.h>" (for the finite() function).

THEN
	make build
	make test
	make install

Also an unadvertised feature is that gzip/gunzip should be in the path
when running the software. N3 then passes the test-suite.








--gKMricLos+KVdGMg
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="mni_n3_1.04_patch_20010309"

diff -r -Nau --exclude-from=exclude_from_diff N3.sav/src/Base/include/Spline.h N3/src/Base/include/Spline.h
--- N3.sav/src/Base/include/Spline.h	Fri Aug 23 15:36:39 1996
+++ N3/src/Base/include/Spline.h	Tue Mar  6 10:08:26 2001
@@ -101,7 +101,7 @@
     return fit(coord2FlMat(coord), values); }
 #endif
 
-  operator ! () const      { return !_fitted; }
+  int operator ! () const      { return !_fitted; }
   operator double () const { return operator () (_tempPoint); }
 
   virtual double operator () (const float *point = 0) const = 0;
diff -r -Nau --exclude-from=exclude_from_diff N3.sav/src/Base/include/backProp.h N3/src/Base/include/backProp.h
--- N3.sav/src/Base/include/backProp.h	Tue Feb 18 16:38:18 1997
+++ N3/src/Base/include/backProp.h	Tue Mar  6 10:12:14 2001
@@ -60,9 +60,9 @@
   Boolean   _softmaxAtOutputLayer;
 
 // Consts and default values
-  static const       _LUT_LENGTH;
+  static const int   _LUT_LENGTH;
   static const long  _SEED;
-  static const       _N_CYCLES;
+  static const int   _N_CYCLES;
   static const float _LEARNING_RATE, _MOMENTUM, _TEMPERATURE;
   static const float _MAX_ERROR, _MAX_D_ERROR;
   static const unsigned _SHUFFLE_INTERVAL;
diff -r -Nau --exclude-from=exclude_from_diff N3.sav/src/Base/src/TrainingSet.c N3/src/Base/src/TrainingSet.c
--- N3.sav/src/Base/src/TrainingSet.c	Sat Oct  4 17:25:07 1997
+++ N3/src/Base/src/TrainingSet.c	Tue Mar  6 10:11:36 2001
@@ -22,7 +22,7 @@
 #include <assert.h>
 #include <stdlib.h>
 
-const DEFAULT_TRAINING_SET_SIZE = 250;
+const int DEFAULT_TRAINING_SET_SIZE = 250;
 
 /***************
  * Example class
diff -r -Nau --exclude-from=exclude_from_diff N3.sav/src/Base/src/dcomplex.c N3/src/Base/src/dcomplex.c
--- N3.sav/src/Base/src/dcomplex.c	Fri Aug 29 13:44:49 1997
+++ N3/src/Base/src/dcomplex.c	Tue Mar  6 10:13:03 2001
@@ -23,7 +23,7 @@
 
 // A few functions that define (bogus) math ops for complex
 
-static _errorCount_dcomplex = 100;
+static int _errorCount_dcomplex = 100;
 
 int operator < (const dcomplex&, const dcomplex&) {
   if (_errorCount_dcomplex) {
diff -r -Nau --exclude-from=exclude_from_diff N3.sav/src/Base/src/fcomplex.c N3/src/Base/src/fcomplex.c
--- N3.sav/src/Base/src/fcomplex.c	Thu Aug 28 17:43:33 1997
+++ N3/src/Base/src/fcomplex.c	Tue Mar  6 10:12:42 2001
@@ -21,7 +21,7 @@
 
 // A few functions that define (bogus) math ops for complex
 
-static _errorCount_fcomplex = 100;
+static int _errorCount_fcomplex = 100;
 
 int operator < (const fcomplex&, const fcomplex&) {
   if (_errorCount_fcomplex) {
diff -r -Nau --exclude-from=exclude_from_diff N3.sav/src/SharpenHist/sharpen_hist.c N3/src/SharpenHist/sharpen_hist.c
--- N3.sav/src/SharpenHist/sharpen_hist.c	Tue Aug 10 14:51:13 1999
+++ N3/src/SharpenHist/sharpen_hist.c	Tue Mar  6 11:40:51 2001
@@ -104,7 +104,7 @@
   if(args.blur_flag == FALSE) 
     {
       // compute filtered distribution f
-      f = real(ifft(pmultEquals(fft(X_padded,0,1), filter),0,1));
+      f = real(ifft(pmultEquals(asCompMat(X_padded).fft(0,1), filter),0,1));
 #ifdef HAVE_MATLAB      
       if(args.debug_flag == TRUE) 
 	f.saveMatlab("distribution.mat", "f");
@@ -127,8 +127,8 @@
 
   // compute mapping
   Mat<double> Y_padded = 
-    pdivEquals(real(ifft(pmultEquals(fft(moment,0,1), blur),0,1)),
-			real(ifft(pmultEquals(fft(f,0,1),blur),0,1)));
+    pdiv(real(ifft(pmultEquals(asCompMat(moment).fft(0,1), blur),0,1)),
+			real(ifft(pmultEquals(asCompMat(f).fft(0,1),blur),0,1)));
   Y = Y_padded(offset,offset+X.getrows()-1,0,0);
 
   // remove any NANs of INFs from Y 

--gKMricLos+KVdGMg--

