# How to format the outputs of several properties of ComponentMeasurements?

I know someone may have asked similar questions but the solution doesn't work to me.

My code is like this:

a = ComponentMeasurements[
MorphologicalComponents[rb], {"Centroid" , "Area"}, #2 > 60 &]


My output is

{1 -> {{134.861, 140.779}, 65.5}, 2 -> {{168.362, 140.052}, 62.5}}


How can I make the output be {{134.861,140.799},{168.362,140.052}}?

• Please format your code properly. Have a look at the FAQ for how it is done. I'll do it for you this time... – Ajasja Nov 5 '13 at 16:50
• @Ajasja Thank you very much!:) – KathyLL Nov 5 '13 at 19:25

You can use Part, or the short hand notation [[]].

out = {1 -> {{134.861, 140.779}, 65.5}, 2 -> {{168.362, 140.052}, 62.5}}
out[[All, 2, 1]]


produces the desired result.

They are rules:

out = {1 -> {{134.861, 140.779}, 65.5}, 2 -> {{168.362, 140.052}, 62.5}};
First /@ (Range@2 /. out)
(*
{{134.861, 140.779}, {168.362, 140.052}}
*)