closest_simplified_direction_matrix bug + bounding box artifact
https://github.com/ANTsX/ANTsPyNet/blob/d39ee8333149a84f6bb72b217419dacfd3872a0d/antspynet/utilities/white_matter_hyperintensity_segmentation.py#L76-L79
causes an error in some installations of python / numpy / tensorflow / antspynet ( can reproduced on ubuntu 18.04 with recent install )
the issue is in multiplying float with int. fixed with this https://github.com/ANTsX/ANTsPyNet/commit/ffe9b2496973b4445856995403d377a9c2b29d6a:
def closest_simplified_direction_matrix(direction):
closest = (np.abs(direction) + 0.5).astype(int).astype(float)
closest[direction < 0] *= -1.0
return closest
looked at results and saw:

maybe multiply the output probabilities with brain mask after mapping back to original space?
Yeah, that's a good idea. The original implementation uses simple thresholding for "brain extraction." I'll work on this later today or tomorrow.
here is what I recommended to a colleague for real processing scenarios:
- run the flair through antspynet.sysu_media_wmh_segmentation
- get the T1 from the same session
- register the T1 and the Flair --- either before or after brain extraction probably does not matter much
- mask the output of the WMH map with the white matter segmentation of the T1
what do you think? I guess the last step could cause some loss of "real" WMH but it would remove some of the spurious signal in the cortex. maybe it would be better to just set all CSF ( and maybe cortex) to zero?
Yes, I've played with that in the development of our own pipeline because I think it's a good idea. I don't think I'd include it in the sysu function itself as I've tried to keep it as close to the original as possible.