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

Add per-channel contrast GUI for AbstractRGB images. #145

Closed
wants to merge 1 commit into from

Conversation

Cody-G
Copy link
Contributor

@Cody-G Cody-G commented Apr 20, 2018

Supersedes #142

Copy link
Member

@timholy timholy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once this passes Travis, I think it's good to go.

gsig = Signal(chanlims[2])
bsig = Signal(chanlims[3])
#make sure that changes to individual channels update the color clim signal and vice versa
bindmap!(clim, x->change_red(clim, x), rsig, x->channel_clim(red, x); initial = false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Travis run, bindmap! caused an error. Looks like bindmap! was merged to master in Reactive in Sept 2017 but Reactive hasn't been tagged since August 2017. If you need this then you might want to nudge them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I nudged here. I'll wait a bit and see whether I get a response. If not I can rework it to avoid using bindmap!.

@Evizero
Copy link
Member

Evizero commented Aug 20, 2018

should we merge this? 0.7 will need some error fixing anyway I assume

@Cody-G Cody-G force-pushed the cjg/color_contrast2 branch from 84de1c7 to 624abf7 Compare August 22, 2018 17:35
@Cody-G
Copy link
Contributor Author

Cody-G commented Aug 22, 2018

I just rebased and pushed again in case it's decided to merge this.

@timholy
Copy link
Member

timholy commented Aug 23, 2018

If tests can pass on at least 0.6 I think this is highly desired. But given that even 0.6 didn't pass, I need to finish the Interpolations rewrite before I can invest the time to figure out what is causing the trouble here. Apologies.

@Cody-G
Copy link
Contributor Author

Cody-G commented Aug 23, 2018

I just checked into this and when I run the tests locally (with fresh package directory) I get the error the first time I run the tests, but after the first time everything passes fine. My guess is that there's some kind of race condition with GTK that only causes an error when things are first compiling. I would also guess that the error is unrelated to this PR, but I didn't check that.

@Cody-G
Copy link
Contributor Author

Cody-G commented Aug 23, 2018

So I just tried this on master and there's also an error on the first run that disappears on later runs, but it's a different one:

INFO: Start installing ImageMagick...
INFO: Installing ImageMagick v0.5.2
INFO: Building FFTW
INFO: Building SpecialFunctions
INFO: Building ImageMagick
INFO: Package database updated
ERROR: LoadError: LoadError: MethodError: no method matching getindex(::Void, ::UnitRange{Int64}, ::UnitRange{Int64})
Stacktrace:
 [1] include_from_node1(::String) at ./loading.jl:576
 [2] include(::String) at ./sysimg.jl:14
 [3] include_from_node1(::String) at ./loading.jl:576
 [4] include(::String) at ./sysimg.jl:14
while loading /home/cody/Desktop/jpacks2/v0.6/ImageView/test/scalesigned.jl, in expression starting on line 6
while loading /home/cody/Desktop/jpacks2/v0.6/ImageView/test/runtests.jl, in expression starting on line 3

Maybe it's still explained by the same compilation race condition?

@timholy
Copy link
Member

timholy commented Aug 25, 2018

That smells like a garbage-collector induced problem to me. Are you creating a signal that you're not holding onto?

Compilation can expose GC issues because compilation allocates memory, and thus forces more frequent GCs. You could test by adding an explicit gc() (or perhaps several of them, sometimes it seems to take more than one) right above the line that failed; it should fail pretty reliably then.

@Cody-G
Copy link
Contributor Author

Cody-G commented Aug 25, 2018

Ah, I see. Well the stack trace for this PR (see Travis) doesn't show where to put the gc() statement, it only shows the assertion error, which I eventually found to be a line in Gtk.jl. I tried gc() (up to 10 in a row) for the error on master that I referenced, and I couldn't recreate the error. I did find a way to recreate it, but since it's on master and unrelated to this PR I opened #151

@timholy
Copy link
Member

timholy commented Aug 25, 2018

Didn't realize this happened on master. Will fix (tomorrow).

@timholy
Copy link
Member

timholy commented Aug 26, 2018

Tests do not fail on master with 0.6, see #152. I can't get it to fail locally either.

Next I will look into this PR to see what can be done to fix it.

@timholy timholy mentioned this pull request Aug 27, 2018
@timholy
Copy link
Member

timholy commented Aug 29, 2018

Merged in #153

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

Successfully merging this pull request may close these issues.

3 participants