Mercurial > hg > minc-tools
changeset 1891:4cfab8eca7e4
* rewrote Makefile with no dependency on a minc distribution
* removed all references to the abominable minc_def.h
* I should autoconf this really, but this is old code that
is now replaced by Jon Harlaps PERL version..
author | rotor <rotor> |
---|---|
date | Fri, 29 Oct 2004 13:08:41 +0000 |
parents | a7441409eeeb |
children | b33e4574ed49 |
files | conversion/Acr_nema/Makefile conversion/Acr_nema/acr_io.c conversion/Acr_nema/acr_nema.h conversion/Acr_nema/acr_nema/element.h conversion/Acr_nema/acr_test.c conversion/Acr_nema/copy_acr_nema.c conversion/Acr_nema/dicom_client_routines.c conversion/Acr_nema/dicom_network.c conversion/Acr_nema/dicom_test.c conversion/Acr_nema/dump_acr_nema.c conversion/Acr_nema/element.c conversion/Acr_nema/extract_acr_nema.c conversion/Acr_nema/file_io.c conversion/Acr_nema/globals.c conversion/Acr_nema/group.c conversion/Acr_nema/message.c conversion/Acr_nema/read_acr_nema.c conversion/Acr_nema/sample_dicom_client.c conversion/Acr_nema/value_repr.c |
diffstat | 19 files changed, 144 insertions(+), 115 deletions(-) [+] |
line wrap: on
line diff
--- a/conversion/Acr_nema/Makefile +++ b/conversion/Acr_nema/Makefile @@ -1,91 +1,28 @@ -# -------------------------------------------------------------------- -# -# MINC Makefile -# - -ROOT = ../../minc -ACR_LIB_DIR = . -include $(ACR_LIB_DIR)/Make_acrdefs -include $(ROOT)/Make_machine_specific -include $(ROOT)/Make_configuration +PROGS = acr_test dump_acr_nema extract_acr_nema read_acr_nema dicom_test \ + sample_dicom_client copy_acr_nema +HEADERS = acr_io.h dicom_client_routines.h dicom_network.h \ + element.h file_io.h group.h message.h value_repr.h +OBJS = $(PROGS:=.o) +EXTR_OBJS = $(HEADERS:.h=.o) globals.o -# Executable names -PROGS = acr_test dump_acr_nema extract_acr_nema read_acr_nema dicom_test \ - sample_dicom_client copy_acr_nema -OBJS = file_io.o acr_io.o element.o value_repr.o group.o message.o \ - dicom_network.o dicom_client_routines.o -EXTRA_OBJS = globals.o -HEADERS = $(OBJS:.o=.h) acr_nema.h -CDEFINES = -DDEBUG# cpp defines -LDOPT = $(MACHINE_LDOPT) - -# -------------------------------------------------------------------- +CC=gcc -CFLAGS = $(CDEFINES) $(INCLUDES) $(OPT)# CFLAGS and LINTFLAGS should -LINTFLAGS = $(CDEFINES) $(INCLUDES)# be same, except for -g/-O - -PROG_OBJ = $(PROGS:=.o)# list of objects -LINT_LIST = $(PROG_OBJ:.o=.ln) -LINT_OBJS = $(OBJS:.o=.ln) $(EXTRA_OBJS:.o=.ln) -LINT_LIST_EXE = $(LINT_LIST:.ln=.)# list of executable names to lint - -# -------------------------------------------------------------------- - -#Suffixes for man pages -.SUFFIXES: .1 .man1 .3 .man3 +OPTIONS = -O3 +INCLUDES = -I. -I/usr/local/include +CFLAGS = $(OPTIONS) $(INCLUDES) -default: build - -all: build lint - -build: $(CC_ACR_LIB) $(PROGS) +LDINCLUDES = -L. +LDLIBS = +LDOPTS = $(LDINCLUDES) $(LDLIBS) -#Dependency on Makefile -$(PROG_OBJ) $(LINT_LIST) $(OBJS) $(EXTRA_OBJS) $(LINT_OBJS) : Makefile -.c.ln:# defines the rule for creating .ln - $(LINT) $(LINTFLAGS) -c $< -o $@ +all: $(EXTR_OBJS) $(PROGS) -.c.o:# defines the rule for creating .o +.c.o: $(CC) $(CFLAGS) -c $< -o $@ -#Dependency of .o and .ln on .h -$(PROG_OBJ) $(OBJS) $(EXTRA_OBJS): $(HEADERS) - -$(LINT_LIST) $(LINT_OBJS) : $(HEADERS) - -#How to create library -$(CC_ACR_LIB): $(OBJS) $(EXTRA_OBJS) - $(RM) $(RM_FLAGS) $(CC_ACR_LIB) - $(AR) $(AR_FLAGS) $(CC_ACR_LIB) $(OBJS) $(EXTRA_OBJS) - $(RANLIB) $(CC_ACR_LIB) - -# How to make executables -$(PROGS) : $(TARGET_IN_DEPENDENCY).o $(CC_ACR_LIB) - $(CC) -o $@ $@.o $(CC_ACR_LIB) $(MACHINE_LDOPT) - -# how to lint the executable source -lint: $(LINT_ACR_LIB) $(LINT_LIST_EXE) +$(PROGS): $(OBJS) + $(CC) $< $(EXTR_OBJS) -o $@ $(OPTIONS) $(LDOPTS) -# How to create lint library -$(LINT_ACR_LIB) : $(LINT_OBJS) - $(LINT) -o $(ACR_LIB) $(LINT_LIBOPTS) $(LINTFLAGS) $(LINT_OBJS) - -$(LINT_LIST_EXE) : $(TARGET_IN_DEPENDENCY)ln $(LINT_ACR_LIB) - $(LINT) $(LINT_PROGOPTS) $(LINTFLAGS) $@ln $(LINT_ACR_LIB) - -# how to make man pages -.man1.1: - $(NROFF) $(NROFF_FLAGS) $< > $@ - -# Remove all derived files in this directory -clean: mostlyclean - $(RM) $(RM_FLAGS) $(CC_ACR_LIB) $(LINT_ACR_LIB) - -mostlyclean: - $(RM) $(RM_FLAGS) $(LINT_LIST) $(PROGS) $(PROG_OBJ) \ - $(OBJS) $(EXTRA_OBJS) $(LINT_OBJS) $(MANPAGES) - -install: - @echo Nothing to install. - +clean: + rm -f *.o *~ $(PROGS)
--- a/conversion/Acr_nema/acr_io.c +++ b/conversion/Acr_nema/acr_io.c @@ -7,7 +7,13 @@ @CREATED : November 10, 1993 (Peter Neelin) @MODIFIED : * $Log: acr_io.c,v $ - * Revision 6.5 2000-08-16 15:53:46 neelin + * Revision 6.6 2004-10-29 13:08:41 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.5 2000/08/16 15:53:46 neelin * Added VR type UN (unknown) which has a length field similar to OB. * * Revision 6.4 2000/05/01 17:54:02 neelin @@ -96,7 +102,6 @@ #include <stdlib.h> #include <stdio.h> #include <limits.h> -#include <minc_def.h> #include <acr_nema.h> /* Define constants */
--- a/conversion/Acr_nema/acr_nema.h +++ b/conversion/Acr_nema/acr_nema.h @@ -6,7 +6,13 @@ @CREATED : November 10, 1993 (Peter Neelin) @MODIFIED : * $Log: acr_nema.h,v $ - * Revision 6.1 1999-10-29 17:51:50 neelin + * Revision 6.2 2004-10-29 13:08:41 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.1 1999/10/29 17:51:50 neelin * Fixed Log keyword * * Revision 6.0 1997/09/12 13:23:59 neelin @@ -83,3 +89,9 @@ #include <message.h> #include <dicom_network.h> #include <dicom_client_routines.h> + +/* these are pinched from minc_def.h */ +#define MALLOC(size) ((void *) malloc(size)) +#define FREE(ptr) free(ptr) +#define REALLOC(ptr, size) ((void *) realloc(ptr, size)) +#define CALLOC(nelem, elsize) ((void *) calloc(nelem, elsize))
--- a/conversion/Acr_nema/acr_nema/element.h +++ b/conversion/Acr_nema/acr_nema/element.h @@ -6,7 +6,13 @@ @CREATED : November 10, 1993 (Peter Neelin) @MODIFIED : * $Log: element.h,v $ - * Revision 6.1 1999-10-29 17:51:52 neelin + * Revision 6.2 2004-10-29 13:08:41 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.1 1999/10/29 17:51:52 neelin * Fixed Log keyword * * Revision 6.0 1997/09/12 13:23:59 neelin @@ -71,6 +77,9 @@ express or implied warranty. ---------------------------------------------------------------------------- */ +#ifndef ELEMENT_H +#define ELEMENT_H + /* Element type */ typedef struct Acr_Element { int group_id; @@ -192,3 +201,5 @@ int max_values, double values[]); public void acr_dump_element_list(FILE *file_pointer, Acr_Element element_list); + +#endif
--- a/conversion/Acr_nema/acr_test.c +++ b/conversion/Acr_nema/acr_test.c @@ -5,7 +5,6 @@ #define GLOBAL_ELEMENT_DEFINITION #include <acr_nema.h> -#include <minc_def.h> GLOBAL_ELEMENT(ACR_Recognition_code, 0x0, 0x10, LO); GLOBAL_ELEMENT(Shadow_Recognition_code, 0x1, 0x10, LO);
--- a/conversion/Acr_nema/copy_acr_nema.c +++ b/conversion/Acr_nema/copy_acr_nema.c @@ -7,7 +7,13 @@ @CREATED : November 9, 2000 (Peter Neelin) @MODIFIED : * $Log: copy_acr_nema.c,v $ - * Revision 6.4 2001-11-08 14:17:05 neelin + * Revision 6.5 2004-10-29 13:08:41 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.4 2001/11/08 14:17:05 neelin * Added acr_test_dicom_file to allow reading of DICOM part 10 format * files. This function also calls acr_test_byte_order to set up the stream * properly and can be used as a direct replacement for that function. @@ -39,7 +45,6 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <minc_def.h> #include <acr_nema.h> #define UNKNOWN_VR_ENCODING ((Acr_VR_encoding_type) -1)
--- a/conversion/Acr_nema/dicom_client_routines.c +++ b/conversion/Acr_nema/dicom_client_routines.c @@ -6,7 +6,13 @@ @CREATED : May 6, 1997 (Peter Neelin) @MODIFIED : * $Log: dicom_client_routines.c,v $ - * Revision 6.19 2001-03-19 18:31:55 neelin + * Revision 6.20 2004-10-29 13:08:41 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.19 2001/03/19 18:31:55 neelin * Modifications to allow opening a stream to stdout (with no input) so * that a dicom stream can be captured. * @@ -110,7 +116,7 @@ ---------------------------------------------------------------------------- */ #ifndef lint -static char rcsid[]="$Header: /private-cvsroot/minc/conversion/Acr_nema/dicom_client_routines.c,v 6.19 2001-03-19 18:31:55 neelin Exp $"; +static char rcsid[]="$Header: /private-cvsroot/minc/conversion/Acr_nema/dicom_client_routines.c,v 6.20 2004-10-29 13:08:41 rotor Exp $"; #endif #include <stdio.h> @@ -131,8 +137,8 @@ #include <string.h> #include <ctype.h> #include <time.h> -#include <minc_def.h> #include <acr_nema.h> +#include <dicom_network.h> /* Constants */ #ifndef public
--- a/conversion/Acr_nema/dicom_network.c +++ b/conversion/Acr_nema/dicom_network.c @@ -6,7 +6,13 @@ @CREATED : February 10, 1997 (Peter Neelin) @MODIFIED : * $Log: dicom_network.c,v $ - * Revision 6.10 2001-03-19 18:30:32 neelin + * Revision 6.11 2004-10-29 13:08:41 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.10 2001/03/19 18:30:32 neelin * Added function to set implementation uid and changed name of function * that gets it. * @@ -91,7 +97,6 @@ #include <ctype.h> #include <string.h> #include <time.h> -#include <minc_def.h> #include <acr_nema.h> /* Constants */
--- a/conversion/Acr_nema/dicom_test.c +++ b/conversion/Acr_nema/dicom_test.c @@ -3,7 +3,6 @@ #include <limits.h> #include <acr_nema.h> -#include <minc_def.h> #if 0 #define WRITING
--- a/conversion/Acr_nema/dump_acr_nema.c +++ b/conversion/Acr_nema/dump_acr_nema.c @@ -6,7 +6,13 @@ @CREATED : November 24, 1993 (Peter Neelin) @MODIFIED : * $Log: dump_acr_nema.c,v $ - * Revision 6.5 2001-11-08 14:17:05 neelin + * Revision 6.6 2004-10-29 13:08:41 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.5 2001/11/08 14:17:05 neelin * Added acr_test_dicom_file to allow reading of DICOM part 10 format * files. This function also calls acr_test_byte_order to set up the stream * properly and can be used as a direct replacement for that function. @@ -85,7 +91,6 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <minc_def.h> #include <acr_nema.h> #define UNKNOWN_VR_ENCODING ((Acr_VR_encoding_type) -1)
--- a/conversion/Acr_nema/element.c +++ b/conversion/Acr_nema/element.c @@ -6,7 +6,13 @@ @CREATED : November 10, 1993 (Peter Neelin) @MODIFIED : * $Log: element.c,v $ - * Revision 6.3 2002-12-07 01:37:24 neelin + * Revision 6.4 2004-10-29 13:08:41 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.3 2002/12/07 01:37:24 neelin * Added missing type * * Revision 6.2 2001/12/12 19:00:54 neelin @@ -93,7 +99,6 @@ #include <string.h> #include <ctype.h> #include <math.h> -#include <minc_def.h> #include <acr_nema.h> /* Private functions */
--- a/conversion/Acr_nema/extract_acr_nema.c +++ b/conversion/Acr_nema/extract_acr_nema.c @@ -6,7 +6,13 @@ @CREATED : November 24, 1993 (Peter Neelin) @MODIFIED : * $Log: extract_acr_nema.c,v $ - * Revision 6.5 2001-11-08 14:17:05 neelin + * Revision 6.6 2004-10-29 13:08:41 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.5 2001/11/08 14:17:05 neelin * Added acr_test_dicom_file to allow reading of DICOM part 10 format * files. This function also calls acr_test_byte_order to set up the stream * properly and can be used as a direct replacement for that function. @@ -71,7 +77,6 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <minc_def.h> #include <acr_nema.h> #define UNKNOWN_VR_ENCODING ((Acr_VR_encoding_type) -1)
--- a/conversion/Acr_nema/file_io.c +++ b/conversion/Acr_nema/file_io.c @@ -6,7 +6,13 @@ @CREATED : November 9, 1993 (Peter Neelin) @MODIFIED : * $Log: file_io.c,v $ - * Revision 6.4 2001-11-08 14:17:05 neelin + * Revision 6.5 2004-10-29 13:08:41 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.4 2001/11/08 14:17:05 neelin * Added acr_test_dicom_file to allow reading of DICOM part 10 format * files. This function also calls acr_test_byte_order to set up the stream * properly and can be used as a direct replacement for that function. @@ -88,9 +94,14 @@ #include <unistd.h> #include <errno.h> #include <limits.h> -#include <minc_def.h> #include <file_io.h> +/* these are pinched from minc_def.h */ +#define MALLOC(size) ((void *) malloc(size)) +#define FREE(ptr) free(ptr) +#define REALLOC(ptr, size) ((void *) realloc(ptr, size)) +#define CALLOC(nelem, elsize) ((void *) calloc(nelem, elsize)) + /* Define some constants */ #define ACR_MAX_BUFFER_LENGTH (64*1024) #define ACR_BUFFER_MARGIN 256
--- a/conversion/Acr_nema/globals.c +++ b/conversion/Acr_nema/globals.c @@ -24,5 +24,4 @@ #include <stdio.h> #include <limits.h> #include <ctype.h> -#include <minc_def.h> #include <acr_nema.h>
--- a/conversion/Acr_nema/group.c +++ b/conversion/Acr_nema/group.c @@ -6,7 +6,13 @@ @CREATED : November 10, 1993 (Peter Neelin) @MODIFIED : * $Log: group.c,v $ - * Revision 6.6 2002-12-08 22:31:34 neelin + * Revision 6.7 2004-10-29 13:08:42 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.6 2002/12/08 22:31:34 neelin * When a last fragment is received, the dicom watchpoint is only updated when the next read happens, so the peek ahead will fail after the watchpoint test in acr_input_group_with_max. * * Revision 6.5 2001/11/08 14:17:05 neelin @@ -113,7 +119,6 @@ #include <stdio.h> #include <ctype.h> #include <string.h> -#include <minc_def.h> #include <acr_nema.h> /* Private functions */
--- a/conversion/Acr_nema/message.c +++ b/conversion/Acr_nema/message.c @@ -6,7 +6,13 @@ @CREATED : November 16, 1993 (Peter Neelin) @MODIFIED : * $Log: message.c,v $ - * Revision 6.6 2002-12-08 21:43:08 neelin + * Revision 6.7 2004-10-29 13:08:42 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.6 2002/12/08 21:43:08 neelin * Fixed excessive memory freeing on error when reading message (seen in linux) * * Revision 6.5 2002/11/13 03:00:27 neelin @@ -86,7 +92,6 @@ #include <stdlib.h> #include <stdio.h> #include <limits.h> -#include <minc_def.h> #include <acr_nema.h> /* Message length group and element id */
--- a/conversion/Acr_nema/read_acr_nema.c +++ b/conversion/Acr_nema/read_acr_nema.c @@ -7,7 +7,13 @@ @CREATED : March 14, 1994 (Peter Neelin) @MODIFIED : * $Log: read_acr_nema.c,v $ - * Revision 6.2 2001-11-08 14:17:06 neelin + * Revision 6.3 2004-10-29 13:08:42 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.2 2001/11/08 14:17:06 neelin * Added acr_test_dicom_file to allow reading of DICOM part 10 format * files. This function also calls acr_test_byte_order to set up the stream * properly and can be used as a direct replacement for that function. @@ -60,7 +66,6 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <minc_def.h> #include <acr_nema.h> /* Define some constants */
--- a/conversion/Acr_nema/sample_dicom_client.c +++ b/conversion/Acr_nema/sample_dicom_client.c @@ -5,7 +5,13 @@ @CREATED : May 6, 1997 (Peter Neelin) @MODIFIED : * $Log: sample_dicom_client.c,v $ - * Revision 6.2 2001-11-08 14:17:06 neelin + * Revision 6.3 2004-10-29 13:08:42 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.2 2001/11/08 14:17:06 neelin * Added acr_test_dicom_file to allow reading of DICOM part 10 format * files. This function also calls acr_test_byte_order to set up the stream * properly and can be used as a direct replacement for that function. @@ -54,13 +60,12 @@ ---------------------------------------------------------------------------- */ #ifndef lint -static char rcsid[]="$Header: /private-cvsroot/minc/conversion/Acr_nema/sample_dicom_client.c,v 6.2 2001-11-08 14:17:06 neelin Exp $"; +static char rcsid[]="$Header: /private-cvsroot/minc/conversion/Acr_nema/sample_dicom_client.c,v 6.3 2004-10-29 13:08:42 rotor Exp $"; #endif #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <minc_def.h> #include <acr_nema.h> #ifndef public
--- a/conversion/Acr_nema/value_repr.c +++ b/conversion/Acr_nema/value_repr.c @@ -6,7 +6,13 @@ @CREATED : January 31, 1997 (Peter Neelin) @MODIFIED : * $Log: value_repr.c,v $ - * Revision 6.2 2000-08-16 15:53:46 neelin + * Revision 6.3 2004-10-29 13:08:42 rotor + * * rewrote Makefile with no dependency on a minc distribution + * * removed all references to the abominable minc_def.h + * * I should autoconf this really, but this is old code that + * is now replaced by Jon Harlaps PERL version.. + * + * Revision 6.2 2000/08/16 15:53:46 neelin * Added VR type UN (unknown) which has a length field similar to OB. * * Revision 6.1 1999/10/29 17:51:54 neelin @@ -47,7 +53,6 @@ #include <string.h> #include <ctype.h> #include <math.h> -#include <minc_def.h> #include <acr_nema.h> /* Types for VR table entries and conversion functions */