View Full Version : Errors and crash WAVE 8.5 writing multiple files

10-04-2007, 08:24 AM
I am trying to write 2D images files from a 3D array (1024,1024,401) looping through the slices and writing with IMAGE_WRITE. WAVE crashes with a MCF error after an irratic number of files (1,6,23,58, etc). The written files seem perfectly fine. I have plenty of disk space.

I've tried adding a WAIT and tried using the old DC_WRITE_TIFF...no help.

Any suggestions?


10-04-2007, 03:52 PM

Given the issue you described, I wrote a small PV-WAVE test case that attempts to duplicate the crash you're seeing in 8.5. I've tested this code on PV-WAVE v8.0, 8.5 and 9.0 - all of them work as expected.

Can you try running this code on your machine?

PRO tt
; Test procedure that creates 401 individual TIFF files
; from a 3-dimensional array. The files are created in the
; current directory.
; First, create the 3-D array of 'images'
bigimg = BINDGEN(1024,1024,401)
FOR jj = 0, 400 DO BEGIN
; Extract each 'image' from the array and create an
; Image Associative Array
img = IMAGE_CREATE(bigimg(*, *, jj))
; Create a filename based on the loop index and tell the
; user which file is being processed
fname = STRCOMPRESS('tiff' + STRTRIM(STRING(jj), 2) + '.tif')
PRINT, "Writing out: " + fname
; Now write out the Image Associative Array to a disk file
status = IMAGE_WRITE(fname, img)
END ; of FOR loop
END ; of procedure tt

Can you also check the code to see what might be different between this test case and your code? As you can see, there are no keywords being used in any of the PV-WAVE procedures or function in tt.pro. If you've added other keywords we'd be interested in knowing which ones you're using.


Don B.

10-07-2007, 02:25 PM

Your code works without a problem which makes me all the more curious as to why mine is erratic. IMAGE_CREATE expects the 3rd index to be the number of images which lets you use it in a loop that increments through the images in the 3D array. However, I want to slice my 3D pixel array side-to-side incrementing the first or the second index. If I try this in IMAGE_CREATE it fails to set up the associated array. So, I get each image in the loop and then include that 2D image in the IMAGE_CREATE proceedure. To me it seems logically clean, but it crashes as noted in my first posting. I'm assuming that I am not overlooking something seriously stupid!

Below is my faulty code.

PRO Side_View


for i = 0, 511 do begin ; increment 1st index

name = string(i)
name = "C:\WAVE\OUTPUT\SIDES_two" + name +".tif"
r = blk(i,*,*) ; get individual image
r=reform(r,512,401) ; make 2D
img = image_create(r)
s = image_write(name, img) ; crashes irregularly at this point


10-08-2007, 03:50 AM

I've been able to reproduce what you see on Windows XP SP2 + PV-WAVE 9.0. Could you please indicate us what version of PV-WAVE (WAVE> INFO, !Version, /Full) and Operating System you are working with?

Also, I've noticed that changing the .tif extension to .jpg seems to fix the issue...

10-08-2007, 12:38 PM
The problem cropped up with WAVE 8.00 under XP Pro 5.1 SP 2

I loaded 9.0 over the weekend and the program still crashed irratically (same OS).

I've just tried saving the images as jpeg and that worked without any problems at all. Functionally, I am where I want to be.


Bob Carney

10-09-2007, 05:15 AM
OK. For your information, a Correction Request (CR) has been filed on that.