Re: Antwort: Re: How to define a 3D array?

Posted by Sasmita Rath on
URL: http://imagej.273.s1.nabble.com/How-to-define-a-3D-array-tp3695869p3695872.html

Thank you guys for your inputs.Now I understand I need to work with an array.This is my real Problem........If you could look into it.

Where k=slices,i=height,j=width.I wrote the macro as follows:

Z=0;
for(k=0;k<10;k++) {

run("Text Image... ", "open=[C:\\Documents and Settings\\...\\Desktop\\20080423-152704--58C-255x-985ms\\" +1000+k + ".dat]");
for(i=0;i<10;i++){
                for(j=0; j<10; j++) {
                                   
                                y=getPixel(i,j);
                                a[z]=y;
                                print(a[z]);
                                z=z+1; }
                                        }
                                close();
                                        }

When I run the macro it gives me the following erroe message.

java.lang.OutOfMemoryError: Java heap space
        at ij.macro.Functions.newArray(Functions.java:1146)
        at ij.macro.Functions.getArrayFunction(Functions.java:250)
        at ij.macro.Interpreter.doArrayAssignment(Interpreter.java:819)
        at ij.macro.Interpreter.doAssignment(Interpreter.java:627)
        at ij.macro.Interpreter.doStatement(Interpreter.java:214)
        at ij.macro.Interpreter.doStatements(Interpreter.java:195)
        at ij.macro.Interpreter.run(Interpreter.java:99)
        at ij.macro.Interpreter.run(Interpreter.java:65)
        at ij.macro.MacroRunner.run(MacroRunner.java:103)
        at java.lang.Thread.run(Unknown Source)



I appreciate your help.
Sasmita