Error dialog on imagej exersice macro

Hi guys,

I’m training myself on macro writing and I’m working with “Bioimage Data Analysis Workflows” as a lead.

for some reason, I keep getting an error dialog for my code (which is the same code that is present in the book).
I’m working on the " EMBL › Samples › NPCsingleNucleus (997k)" sample data.

any solutions? what am I missing?

1 Like

Hey @Daniel_Waiger,

remove the quotation marks in lines 5 and 7. You want to use the variable c1name and not the string “c1name” as there is indeed no window headlined like this.

Cheers,
Robert

1 Like

@haesleinhuepf, haha, so embarrassing!

I’ve already compared the book to my code for 200 times and missed it everytime!

Damn A.D.D :rofl: :rofl: :rofl: :rofl:

Cheers!!!

1 Like

At some point your brain will get used to the colors: pink are strings, black are variables…

1 Like

Hi there,
Any insights for this error?

Yes, remove the +1 in line 13 and 17. Image slices are 1-based indiced in ImageJ macro. As your for-loop is counting from 1 to nSlices, you are trying to set the slice to nSlices + 1 in the last iteration.

Cheers,
Robert

1 Like

ok, I’ll try it.

but it’s wierd though, that’s how it’s presented in the book.

Thanks mate!

@haesleinhuepf, it worked!