title: ValueError: NumPy boolean array indexing assignment cannot assign 0 input values to the N output values where the mask is true
body: <p>I have a Dicom file and i would like to apply a number of masks with different operations in the voxels. However, I would like to keep the positions in the initial array because I want to reconstruct the image. This is what I have done:</p>
  
  <pre><code>#The dicom data    
  a=dicomm_data.pixel_array
  #start function
  my_modified_array = np.zeros_like(a)
  #mask 1
  m1=a[(a&gt;limit_1) &amp; (a&lt;limit_2)]
  m1=m1*chosen_number1 + chose_number2
  my_modified_array [(a&gt;limit_1) &amp; (a&lt;limit_2)] = m1
  
  #mask 2
  m2=a[(a&gt;limit_2+1) &amp; (a&lt;limit_3)]
  m2=m1*chosen_number3+chosen_number_4
  my_modified_array [(a&gt;limit_2+1) &amp; (a&lt;limit_3)] = m2
  </code></pre>
  
  <p>and I continue with more masks. 
  However, I am receiving the mentioned in the title error.
  I have read another post which uses the numpy.where function but still cannot fix it.</p>