[ENH]: Add non zero mean as an aggregation function for structural images #219

Closed
opened 2023-04-06 13:43:57 +00:00 by antogeo · 5 comments
antogeo commented 2023-04-06 13:43:57 +00:00 (Migrated from github.com)

Are you requiring a new dataset or marker?

  • I understand this is not a marker or dataset request

Which feature do you want to include?

How do you imagine this integrated in junifer?

additional parameter

Do you have a sample code that implements this outside of junifer?

numpy.mean(numpy.nonzero(a))

Anything else to say?

no

### Are you requiring a new dataset or marker? - [X] I understand this is not a marker or dataset request ### Which feature do you want to include? ### How do you imagine this integrated in junifer? additional parameter ### Do you have a sample code that implements this outside of junifer? ```shell numpy.mean(numpy.nonzero(a)) ``` ### Anything else to say? no
fraimondo commented 2023-04-07 07:19:23 +00:00 (Migrated from github.com)

Can you provide more information as requested (e.g. by properly filling the issue template)?

np.nonzero gives the indexes of the non-zero elements.

Also, doing a non-zero mean of floating point values will only work if values are exactly 0.

Can you provide more information as requested (e.g. by properly filling the issue template)? `np.nonzero` gives the indexes of the non-zero elements. Also, doing a non-zero mean of floating point values will only work if values are exactly 0.
antogeo commented 2023-04-11 11:34:40 +00:00 (Migrated from github.com)

0 values indicate those voxels that despite belonging to a parcel they are certainly not part of tissue of interest. Therefore, should not be involved in the mean process. A cut-off value could also be a more general solution (eg a threshold applied in the tissue of interest).

0 values indicate those voxels that despite belonging to a parcel they are certainly not part of tissue of interest. Therefore, should not be involved in the mean process. A cut-off value could also be a more general solution (eg a threshold applied in the tissue of interest).
LeSasse commented 2023-04-11 11:42:18 +00:00 (Migrated from github.com)

0 values indicate those voxels that despite belonging to a parcel they are certainly not part of tissue of interest. Therefore, should not be involved in the mean process. A cut-off value could also be a more general solution (eg a threshold applied in the tissue of interest).

By 0 values, do you mean voxels where the actual data is 0 (or below some threshold) or do you mean voxels where they are 0 (or below some threshold) in an additional probabilistic mask?

> 0 values indicate those voxels that despite belonging to a parcel they are certainly not part of tissue of interest. Therefore, should not be involved in the mean process. A cut-off value could also be a more general solution (eg a threshold applied in the tissue of interest). By 0 values, do you mean voxels where the actual data is 0 (or below some threshold) or do you mean voxels where they are 0 (or below some threshold) in an additional probabilistic mask?
fraimondo commented 2023-04-11 12:59:00 +00:00 (Migrated from github.com)

I still do not get how this would be preferred instead of using a GM mask or something like that.

It's just basically thresholding whatever values you will aggregate.

How will this work with timeseries?

I still do not get how this would be preferred instead of using a GM mask or something like that. It's just basically thresholding whatever values you will aggregate. How will this work with timeseries?
github-actions[bot] commented 2025-09-17 02:01:13 +00:00 (Migrated from github.com)

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
juaml/junifer#219
No description provided.