NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 89 - `Import from text file' results in bogus min and max values
`Import from text file' results in bogus min and max values
Status: RESOLVED FIXED
Product: Fiji
Classification: Unclassified
Component: TrakEM2
unspecified
PC Linux
: P2 normal
Assigned To: Albert Cardona
Depends on:
Blocks:
 
Reported: 2009-10-12 11:50 CDT by Stephan Saalfeld
Modified: 2014-05-09 06:42 CDT
0 users

See Also:

Description Stephan Saalfeld 2009-10-12 11:50:28 CDT
I imported about 100 layers with a low number of images each with `import from text file' having `homogenize contrast layer wise' checked.  The result on screen is fine after the import, but if I go to `Project->reganerate mipmaps', the contrast is totally broken.  A brief look into the xml shows that the patches are saved with min and max = -1.

BTW---how complicated is it to build in an easy to use contrast brightness slider for the currently open layer?  My current procedure is: Select a patch, SHIFT+D, set B&C from ImageJ, `Adjust->Set min and max layer wise' and type in the remembered B&C values.  That's a bit mousy and not so much fun for about 100 sections ;)
Comment 1 Albert Cardona 2009-10-12 16:35:43 CDT
I'll look into the bug.

It's not too difficult: as we mentioned, we could now use the Display Mode to represent anything we want such as the adjustment of Brightness and Contrast, or a Gamma adjustment, or whatever: any function that will need to update the mipmaps in some way and that would be too expensive to do directly.
Comment 2 Albert Cardona 2009-10-12 17:30:47 CDT
I cannot reproduce the bug.
I have just test-run an "import from text file" with "homogenize contrast" checkbox ticked in.
After import, images are properly contrasted.
If I query any selected patch, its min and max fields are fine.
If I save it, its min and max fields are fine.
If I run "project - regenerate mipmaps (selected images)", they regenerate to identical images as already in the screen.

So what did you do different?

I've looked at the code and in no occasion are the min,max not set for a patch.
The procedure is as follows:
1. Compute min and max for a stack of images containing the images of the patches within the layer (or actually a subset of them, the middle 50% collection according to idependent stastistical measures of stdDev)
2. Set the min and max to each patch in the layer
3. Call generate mip maps for each patch.

So in no occasion could the min and max be one thing in the screen and another in the Patch fields, and thus in the xml.
Comment 3 Stephan Saalfeld 2009-10-14 17:40:07 CDT
It happened to me again:
I did:
1. Import a set of section montages from text-file without `homogenize' checked
2. Save the project
3. Set a CoordinateTransform to each by script (Patch.setCoordinateTransform)
4. Saved again
5. Enhance contrast layer-wise
6. Save again
7. Set min and max for a set of dirty layers manually
8. Save again.
9. Restart TrakEM2 and Fiji and re-open the project
10. Everything looks fine, but in all layers that were not manually corrected, min and max is -1

All mipmaps look fine, but if I would now regenerate, they would break.  How can this happen?
Comment 4 Albert Cardona 2009-10-17 00:54:44 CDT
Step 6, the saving after enhancing contrast layer-wise, was in occasions setting the min,max to 0,max(type), and these values were not saved in the XML.
Then, on re-read the XML, the absence of min,max left them as -1,-1,
since we are no longer using an obsolete method putMinAndMax, which was
putting them back into the Patch from the ImageProcessor.

From now on this issue should be fixed.

While at it, I reworked the contrast enhancement dialog and Loader's API.
Comment 5 Albert Cardona 2009-10-31 21:40:03 CDT
Haven't heard any more complaints and works for me after pushing fixes.