Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use minimum of average template as its offset #207

Open
raacampbell opened this issue Jun 29, 2023 · 5 comments
Open

Use minimum of average template as its offset #207

raacampbell opened this issue Jun 29, 2023 · 5 comments
Assignees

Comments

@raacampbell
Copy link
Contributor

See 19bfe8e

This stops weird patterns emerging on the image. We test for a while on dev before accepting fully.

@raacampbell raacampbell self-assigned this Jun 29, 2023
@raacampbell
Copy link
Contributor Author

The subtraction as implemented above will mean that different offset subtraction types are doing very similar things, if I understand correctly.

@raacampbell
Copy link
Contributor Author

This is not working optimally. DG from Crick sends dataset AEW_A146 where the negative numbers are not present in the template we divide with but still there is some "brightness" in the darker corners. In the image below, the version with no background correction is on the right and on the left is the version with correction.
image

Part of the problem is low signal. But maybe we can do better?

@raacampbell
Copy link
Contributor Author

raacampbell commented Nov 29, 2023

Ok... It seems the problem is the change I made to the illuminationCorrector where I took this code:

 if userConfig.tile.doOffsetSubtraction
      m = stitchit.tools.getOffset(coords);
else
     m = 0;
end

and turned it into this:

if userConfig.tile.doOffsetSubtraction
        mO = min(aveTemplate.oddRows(:));
        mE = min(aveTemplate.evenRows(:));
        mP = min(aveTemplate.pooledRows(:));
else
        mO = 0;
        mE = 0;
        mP = 0;
end

Previously the template was seeing a subtraction that was controlled by the offsetType setting in the INI file. After this change, this ceased. It's true that this change helped with things on OG, but it has broken stuff elsewhere. The correct thing is likely to revert and alter the behavior of stitchit.tools.getOffset to handle OG, should this still be needed.

Specifically, the averageMinTile option is doing:

        aveTemplate = stitchit.tileload.loadBruteForceMeanAveFile(coords,userConfig);
        m=min(aveTemplate.pooledRows(:));
        if m>0
            m=0;
        end
        offset.(offsetType) = m;

So if the average is positive it doesn't subtract it. This maybe is not the right choice but this is where I should be looking for fixes. What I implemented previously was a hack.

@raacampbell
Copy link
Contributor Author

raacampbell commented Nov 29, 2023

Reverted the change and after bugfixes to the reversion: ba68071

But we still have issues with OG data. So we fix these specifically whilst not messing up the others...
EDIT: provisionally it looks like using averageTileMin is good enough for OG.

@raacampbell
Copy link
Contributor Author

See Issue #145 - I noticed that the offset file is not updated when collate average images runs. We now delete the offset files whenever collateAverageImages is run. 16db7d3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant