2
$\begingroup$

I performed MorphologicalComponents on an image, and from there used SelectComponents to filter out my desired components. Is there a way to extract out the unique values from the entire array? i.e. get a list of the labelled component values

I tried using DeleteDuplicates, but that only works on a list, and also tried using Select with a search criteria #>0, but that didn't work out as well.

Thank you!

$\endgroup$
3
  • $\begingroup$ DeleteDuplicates@*Flatten? $\endgroup$ Commented Apr 24, 2019 at 21:13
  • $\begingroup$ That works, thank you! $\endgroup$
    – Gnaprs
    Commented Apr 24, 2019 at 21:20
  • $\begingroup$ You're welcome. Actually, you gave the answer yourself: "but that only works on a list" ;) $\endgroup$ Commented Apr 24, 2019 at 21:23

1 Answer 1

5
$\begingroup$

The solution was given by Henrik:

DeleteDuplicates@*Flatten@array. 

Thank you!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.