<div dir="ltr">Dear 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Christophe<span> </span></span>

,<div><br></div><div><br></div><div>Thanks for your answer! I spent many hours triyng to figure the behaviour of NiftiLabelsMasker</div><div>I do not understand how to iterate over each mask ROI.</div><div><br></div><div>How one can iterate over each label of a masker?</div><div><br></div><div>`# Obtain AAL Atlas</div><div><div>aal = datasets.fetch_atlas_aal('SPM12')</div><div>aal_labels = aal.labels</div><div><br></div><div># Obtain mask</div><div>masker = input_data.NiftiLabelsMasker(aal.maps)<br></div><div><br></div><div># Input image to compute the mean value for each</div><div>patient_img = image.load_img(path_nii)<br></div><div>

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">patient_img<span> </span></span>

 =

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">patient_img</span>.get_data()<br></div><div><br></div><div># Fit the mask to the image</div><div>masker_fit(patient_img)</div><div>mask_img = masker_fit.mask_img_</div><div><br></div><div>Thanks in advance,</div><div><br></div><div><br></div><div>Gabriel</div><div><br></div><div><br></div><div><br></div><div></div></div></div>