def _load_pil_image(self, filename):
self._channel_data = []<EOL>self._original_channel_data = []<EOL>im = Image.open(filename)<EOL>self._image = ImageOps.grayscale(im)<EOL>im.load()<EOL>file_data = np.asarray(im, float)<EOL>file_data = file_data / file_data.max()<EOL>if( len(file_data.shape) == <NUM_LIT:3> ):<EOL><INDENT>num_channels = file_data.shape[<NUM_LIT:2>]<EOL>for i in range(num_channels):<EOL><INDENT>self._channel_data.append( file_data[:, :, i])<EOL>self._original_channel_data.append( file_data[:, :, i] )<EOL><DEDENT><DEDENT>
Load image using PIL.