<jupyter_start><jupyter_text>Intro to Image Processing: An Image as Numbers  **Purpose**: To view an image from a computers perspective (as an array of numbers) Created by: <NAME>Creation Date: 07/21/2020Last Update: *Step 1: Necessary Imports* In this step, we import all the packages that we will need later on in the document.  We decide to do this all at once rather than throughout because it is standard coding practice that helps create clean code.<jupyter_code>import numpy as np
from skimage import io #importing a specific mmodule from scikit-imgae

import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>*Step 2: User Inputs* When creating Jupyter Notebooks for use by collaborators and experamentalists, I find it best practice to have a step near the top specifically for the imuts they need for the notebook.In this case, the only input needed is the location of location of the cell.tif file included in this repository.<jupyter_code>#replace the example path from my computer with the path to the image on your computer

cell_im_location = '/Users/hhelmbre/Desktop/packages/textile/example_data/cell.tif'<jupyter_output><empty_output><jupyter_text>Note: This example image is from Nance Lab's Andrea Joseph and is a NueN stain in the contralateral hemisphere of a p10 rat at 240x zoom *Step 3: Reading in the image* The image doesn't exist within the Jupyter Notebook until you actually "read" it into the notebooks data storage. To do that we use the scikit-image command io.imreadGo ahead and check the imports to see that from skimage (scikit-image) we imported the io module<jupyter_code>cell_im = io.imread(cell_im_location)<jupyter_output><empty_output><jupyter_text>*Step 4: Viewing the Image* For now don't worry about the [0,:,:] next to the image. But focus on the fact that matplotlib is able to show the image using the function 'imshow'.  Where cmap is the color map we choose to apply and it has been set to gray.Matplotlib automatically includes x and y axis which designate in this case a numerical location for each pixel (0,0 in the top left and 500,500 in the bottom right).<jupyter_code>plt.imshow(cell_im[0,:,:], cmap='gray')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.05831826401446655, 'fraction_numerical': 0.012206148282097649, 'mean_word_length': 5.414492753623189, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '282562', 'license': 'MIT', 'n_tokens_mistral': 659, 'n_tokens_neox': 619, 'n_words': 311, 'path': 'modules/4_pre_module_Image_As_Numbers.ipynb', 'repo_name': 'Nance-Lab/TEXTILE', 'size': '2223'}