changeset 1371:98b7db4d9682

Added code to read any remaining image data out of the get_image_cmd pipe in case the image size does not match the amount of data.
author neelin <neelin>
date Mon, 28 May 2001 18:56:44 +0000
parents 0d660c5166c1
children 90fe73555f8d
files conversion/mri_to_minc/mri_to_minc.pl
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/conversion/mri_to_minc/mri_to_minc.pl
+++ b/conversion/mri_to_minc/mri_to_minc.pl
@@ -578,6 +578,10 @@
             }
             open(GEDAT, $image_cmd . " |");
             read(GEDAT, $image_data, $image_data_len);
+            local($dummy, $nread);
+            do {
+               $nread = read(GEDAT, $dummy, 8192);
+            } while ($nread == 8192);
             close(GEDAT);
             if ($? != 0) {
                 warn("Error or signal while reading image.\n");