Closed ntustison closed 7 months ago
https://github.com/ANTsX/ANTsPy/pull/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 )
https://github.com/ANTsX/ANTsPy/pull/607