mutual information and related methods#89
Open
bogovicj wants to merge 2 commits intoimglib:masterfrom
Open
Conversation
|
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/migrating-mutualinformation-into-imglib2-algorithm/44798/3 |
imagejan
reviewed
Nov 4, 2020
Comment on lines
+162
to
+170
| for( int i = 0; i < ni; i++ ) | ||
| { | ||
| count = subHistCount( hist, dim, i ); | ||
| ctot += count; | ||
| double p = 1.0 * count / total; | ||
|
|
||
| if( p > 0 ) | ||
| entropy -= p * Math.log( p ); | ||
| } |
hanslovsky
reviewed
Apr 15, 2021
Comment on lines
+33
to
+34
| final IterableInterval< T > dataA, | ||
| final IterableInterval< T > dataB, |
Member
There was a problem hiding this comment.
Is there a need to pass IterableInterval? Could it just be Iterable?
hanslovsky
reviewed
Apr 15, 2021
Comment on lines
+28
to
+29
| * @param rai the RandomAccessibleInterval | ||
| * @param ra the RandomAccessible |
Member
There was a problem hiding this comment.
Inconsistent with actual types of parameters in method signature
hanslovsky
reviewed
Apr 15, 2021
Comment on lines
+106
to
+108
| ArrayList< BinMapper1d< T > > binMappers = new ArrayList< BinMapper1d< T > >( 2 ); | ||
| binMappers.add( binMapper ); | ||
| binMappers.add( binMapper ); |
Member
There was a problem hiding this comment.
Not tested but something like this should be possible:
Suggested change
| ArrayList< BinMapper1d< T > > binMappers = new ArrayList< BinMapper1d< T > >( 2 ); | |
| binMappers.add( binMapper ); | |
| binMappers.add( binMapper ); | |
| List< BinMapper1d< T > > binMappers = Arrays.asList( binMapper, binMapper ); |
hanslovsky
reviewed
Apr 15, 2021
Comment on lines
+110
to
+112
| List< Iterable< T > > data = new ArrayList< Iterable< T > >( 2 ); | ||
| data.add( dataA ); | ||
| data.add( dataB ); |
Member
There was a problem hiding this comment.
Not tested but something like this should be possible:
Suggested change
| List< Iterable< T > > data = new ArrayList< Iterable< T > >( 2 ); | |
| data.add( dataA ); | |
| data.add( dataB ); | |
| List< Iterable< T > > data = Arrays.asList( dataA, dataB ); |
hanslovsky
reviewed
Apr 15, 2021
Comment on lines
+68
to
+72
| double HA = marginalEntropy( jointHist, 0 ); | ||
| double HB = marginalEntropy( jointHist, 1 ); | ||
| double HAB = entropy( jointHist ); | ||
|
|
||
| return HA + HB - HAB; |
Member
There was a problem hiding this comment.
This should call mutualInformation( jointHist ) instead of duplicating the code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.