Mercurial > hg > minc-tools
changeset 1332:38a8fbf3fea8
Modified convert_imagenum to convert_modified_imagenum to account for
the fact that the image number has already been modified once in the
original conversion.
author | neelin <neelin> |
---|---|
date | Mon, 09 Apr 2001 23:51:25 +0000 |
parents | 796cd67262e6 |
children | 4caa1df8a1a4 |
files | conversion/gcomserver/fix_dicom_coords/fix_dicom_coords.c conversion/gcomserver/fix_dicom_coords/test_fix_dicom_coords.c |
diffstat | 2 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/conversion/gcomserver/fix_dicom_coords/fix_dicom_coords.c +++ b/conversion/gcomserver/fix_dicom_coords/fix_dicom_coords.c @@ -40,7 +40,7 @@ double position[], double row_dircos[], double col_dircos[], double *location); -int convert_imagenum(char *string); +int convert_modified_imagenum(char *string); /* Private function prototypes */ private void convert_coordinate(double coord[WORLD_NDIMS]); @@ -489,23 +489,26 @@ } /* ----------------------------- MNI Header ----------------------------------- -@NAME : convert_imagenum +@NAME : convert_modified_imagenum @INPUT : string - string to be converted in place @OUTPUT : string - modified date string @RETURNS : TRUE if string was modified, FALSE otherwise. @DESCRIPTION: Routine to convert an image number from gyroscan format to a valid dicom integer by making it smaller, if necessary. + This function differs from the original in that it assumes that + the string has already had two characters chopped off the end. @METHOD : @GLOBALS : @CALLS : @CREATED : March 5, 2001 (Peter Neelin) @MODIFIED : ---------------------------------------------------------------------------- */ -int convert_imagenum(char *string) +int convert_modified_imagenum(char *string) { int istart, iend, iold, inew, oldlen, ipos; static Acr_max_IS_len = 8; - static int chars_to_remove[] = {1,2,5,6,13}; +/* static int chars_to_remove[] = {1,2,5,6,13}; */ + static int chars_to_remove[] = {3,4,11}; static int nchars_to_remove = sizeof(chars_to_remove) / sizeof(chars_to_remove[0]); int ichar;
--- a/conversion/gcomserver/fix_dicom_coords/test_fix_dicom_coords.c +++ b/conversion/gcomserver/fix_dicom_coords/test_fix_dicom_coords.c @@ -39,7 +39,7 @@ double position[], double row_dircos[], double col_dircos[], double *location); -int convert_imagenum(char *string); +int convert_modified_imagenum(char *string); /* MAIN PROGRAM */ @@ -114,7 +114,7 @@ /* Fix the image num string */ (void) strcpy(imagenum, acr_find_string(group_list, ACR_Image_Number, "")); - (void) convert_imagenum(imagenum); + (void) convert_modified_imagenum(imagenum); (void) printf("\"%s\"\n", imagenum); return EXIT_SUCCESS;