def indices_specific_to_general(column_indices, row_indices, columns=@columns)
      if column_indices.is_a?(Array)
        indices = Array.new
        column_indices.each_index {|i| indices << column_indices[i] + row_indices[i] * columns}
        return indices
      else
        # Assume Fixnum or NArray:
        return column_indices + row_indices * columns
      end
    end
def indices_specific_to_general(column_indices, row_indices, columns=@columns)
      if column_indices.is_a?(Array)
        indices = Array.new
        column_indices.each_index {|i| indices << column_indices[i] + row_indices[i] * columns}
        return indices
      else
        # Assume Fixnum or NArray:
        return column_indices + row_indices * columns
      end
    end
Converts specific x and y indices to general image indices based on the
 the geometry of the image (the number of columns).

 @param [NArray, Array] column_indices specific pixel array column indices
 @param [NArray, Array] row_indices specific pixel array row indices
 @param [Integer] n_cols the number of columns in the reference image
 @return [NArray, Array] general pixel array indices