ANTsX / ANTsR

R interface to the ANTs biomedical image processing library
https://antsx.github.io/ANTsR
Apache License 2.0
127 stars 35 forks source link

labelClusters producing wrong output #263

Closed dorianps closed 5 years ago

dorianps commented 5 years ago

I use labelClusters to filter away small clusters from LESYMAP results. The function is supposed to return an image with each cluster found in the range minThresh to maxThresh.

Description: This will give a unique ID to each connected component 1 through N of size > minClusterSize

It used to work before, it is used routinely in LESYMAP, but now it returns a map with 0 where the cluster should be and 1 everywhere else. This sort of inverted mask is not useful anymore, it removes the good cluster in the following example.

Any idea what is going on?

To reproduce: temp.nii.gz tempclust.nii.gz

temp = antsImageRead('temp.nii.gz')
tempclust = labelClusters(abs(temp), minClusterSize = 150, minThresh = 0.099, maxThresh=1) 

Figure shows the mask returned by labelClusters in white, and the signal of the original image in red, which falls in the hole of the labelClusters mask. image

stnava commented 5 years ago

probably fixed with minor update to ants - meaning reinstall.

dorianps commented 5 years ago

Thanks @stnava, works now. Do you know how long has this bug been around?

stnava commented 5 years ago

i was not able to identify any clear issue. it may be a compiler change in handling of types or something like that. so no.

brian

On Wed, Mar 13, 2019 at 11:41 AM dorianps notifications@github.com wrote:

Thanks @stnava https://github.com/stnava, works now. Do you know how long has this bug been around?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTsR/issues/263#issuecomment-472478309, or mute the thread https://github.com/notifications/unsubscribe-auth/AATyfqegf99Psw8lmGFlmqR5lc3T7IDPks5vWRwsgaJpZM4bsWT8 .