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

ENH: histogram matching Nyul/bspline variant w/ masking. #398

Merged
merged 3 commits into from
Apr 13, 2024

Conversation

ntustison
Copy link
Member

@ntustison ntustison commented Apr 13, 2024

ANTsX/ANTsPy#607

sourceImage <- antsImageRead( getANTsRData( "r16" ) )
referenceImage <- antsImageRead( getANTsRData( "r64" ) )
sourceMask <- getMask( sourceImage )
referenceMask <- getMask( referenceImage )
tx <- histogramMatchImage2( sourceImage, referenceImage, sourceMask, referenceMask )

# antsImageWrite( tx, "txR.nii.gz" )

sourceHist <- hist( sourceImage[sourceMask != 0] )
referenceHist <- hist( referenceImage[referenceMask != 0] )
txHist <- hist( tx[sourceMask != 0] ) 

plot( sourceHist, col = rgb( 1, 0, 0, 0.25 ) )
plot( referenceHist, col = rgb( 0, 1, 0, 0.25 ), add = TRUE )
plot( txHist, col = rgb( 0, 0, 1, 0.25 ), add = TRUE )

@ntustison ntustison merged commit e40ee39 into master Apr 13, 2024
1 check passed
@ntustison ntustison deleted the NyulBspline branch April 13, 2024 05:17
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.

1 participant