Skip to content

Commit

Permalink
Corrected some smaller installation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianGaser committed Jan 7, 2024
1 parent a478ee6 commit de2ba7f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 35 deletions.
26 changes: 0 additions & 26 deletions 3rdparty/volume_io/Prog_utils/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,32 +248,6 @@ VIOAPI STRING get_clock_time( void )
return( create_string( str ) );
}

/* ----------------------------- MNI Header -----------------------------------
@NAME : sleep_program
@INPUT : seconds
@OUTPUT :
@RETURNS :
@DESCRIPTION: Make the program sleep for the specified number of seconds.
@METHOD :
@GLOBALS :
@CALLS :
@CREATED : 1993 David MacDonald
@MODIFIED :
---------------------------------------------------------------------------- */

VIOAPI void sleep_program( Real seconds )
{
#if HAVE_SELECT
struct timeval timeout;

timeout.tv_sec = (long) seconds;
timeout.tv_usec = (long) (1.0e6 * (seconds - (Real) timeout.tv_sec) + 0.5);

(void) select( 0, NULL, NULL, NULL, &timeout );
#else
sleep((unsigned int) seconds);
#endif
}

/* ----------------------------- MNI Header -----------------------------------
@NAME : get_date
Expand Down
4 changes: 4 additions & 0 deletions Include/CAT_Kmeans.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

#include "CAT_Vol.h"

#ifndef HUGE
#define HUGE 1e15
#endif

double Kmeans(float *src, unsigned char *label, unsigned char *mask, int NI, int n_clusters, double *mean, double *voxelsize, int *dims, int thresh_mask, int thresh_kmeans);

#endif
2 changes: 0 additions & 2 deletions Lib/CAT_Sanlm.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,6 @@ void anlm(float* ima, int v, int f, int use_rician, const int* dims)

#if defined(_WIN32)

/* printf("Windows system detected\n");fflush(stdout); */

/* Reserve room for handles of threads in ThreadList*/
ThreadList = (HANDLE*) malloc(Nthreads*sizeof( HANDLE ));
ThreadArgs = (myargument*) malloc( Nthreads*sizeof(myargument));
Expand Down
10 changes: 5 additions & 5 deletions Lib/CAT_Vol.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,10 @@ double
get_masked_mean_array_float(float arr[], int size, unsigned char mask[])
{
double sum = 0.0;
int n = 0;
int i, n = 0;

/* Calculate mean */
for(int i = 0; i < size; i++) {
for (i = 0; i < size; i++) {
if (!isnan(arr[i]) && ((mask && mask[i] > 0) || !mask)) {
sum += arr[i];
n++;
Expand Down Expand Up @@ -429,10 +429,10 @@ double
get_masked_std_array_float(float arr[], int size, unsigned char mask[])
{
double mean = 0.0, variance = 0.0;
int n = 0;
int i, n = 0;

/* Calculate mean */
for(int i = 0; i < size; i++) {
for (i = 0; i < size; i++) {
if (!isnan(arr[i]) && ((mask && mask[i] > 0) || !mask)) {
mean += arr[i];
n++;
Expand All @@ -441,7 +441,7 @@ get_masked_std_array_float(float arr[], int size, unsigned char mask[])
mean = mean / (double)n;

/* Calculate variance */
for(int i = 0; i < size; i++)
for (i = 0; i < size; i++)
if (!isnan(arr[i]) && ((mask && mask[i] > 0) || !mask))
variance += pow(arr[i] - mean, 2);
variance /= (double)n;
Expand Down
9 changes: 7 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ SUBDIRS = . Progs
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = -I m4

AM_CFLAGS = -pthread -DHAVE_ZLIB -I$(top_srcdir)/Include -I$(top_srcdir)/3rdparty/MarchingCubes -I$(top_srcdir)/3rdparty/nifti -I$(top_srcdir)/3rdparty/zlib -I$(top_srcdir)/3rdparty/volume_io/Include -I$(top_srcdir)/3rdparty/bicpl-surface/Include -I$(top_srcdir)/3rdparty/bicpl-surface/Include/bicpl
#AM_CPPFLAGS = -pthread -DHAVE_ZLIB -I$(top_srcdir)/Include -I$(top_srcdir)/3rdparty/MarchingCubes -I$(top_srcdir)/3rdparty/nifti -I$(top_srcdir)/3rdparty/zlib -I$(top_srcdir)/3rdparty/bicpl-surface/Include/bicpl
CFLAGS0 = -DHAVE_ZLIB -I$(top_srcdir)/Include -I$(top_srcdir)/3rdparty/MarchingCubes -I$(top_srcdir)/3rdparty/nifti -I$(top_srcdir)/3rdparty/zlib -I$(top_srcdir)/3rdparty/volume_io/Include -I$(top_srcdir)/3rdparty/bicpl-surface/Include -I$(top_srcdir)/3rdparty/bicpl-surface/Include/bicpl

if WINDOWS
AM_CFLAGS = ${CFLAGS0}
else
AM_CFLAGS = -pthread ${CFLAGS0}
endif

lib_LTLIBRARIES = libCAT.la

Expand Down

0 comments on commit de2ba7f

Please sign in to comment.