def get_image_data(self, ids=None, voxels=None, dense=True):
if dense and ids is None and voxels is None:<EOL><INDENT>logger.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>result = self.data<EOL>if ids is not None:<EOL><INDENT>idxs = np.where(np.in1d(np.array(self.ids), np.array(ids)))[<NUM_LIT:0>]<EOL>result = result[:, idxs]<EOL><DEDENT>if voxels is not None:<EOL><INDENT>result = result[voxels, :]<EOL><DEDENT>return result.toarray() if dense else result<EOL>
Slices and returns a subset of image data.

        Args:
            ids (list, array): A list or 1D numpy array of study ids to
                return. If None, returns data for all studies.
            voxels (list, array): A list or 1D numpy array of voxel indices
                (i.e., rows) to return. If None, returns data for all voxels.
            dense (bool): Optional boolean. When True (default), convert the
                result to a dense array before returning. When False, keep as
                sparse matrix.

        Returns:
          A 2D numpy array with voxels in rows and studies in columns.