diff --git a/demos/notebooks/demo_motion_correction.ipynb b/demos/notebooks/demo_motion_correction.ipynb index 84cec1967..d3c6fcc81 100644 --- a/demos/notebooks/demo_motion_correction.ipynb +++ b/demos/notebooks/demo_motion_correction.ipynb @@ -156,7 +156,7 @@ "source": [ "

Rigid motion correction

\n", "

The original file exhibits a lot of motion. In order to correct for it we are first trying a simple rigid motion correction algorithm. This has already been selected by setting the parameter `pw_rigid=False` during the construction of the `MotionCorrect` object. The algorithm first creates a template by averaging frames from the video. It then tries to match each frame to this template. In addition the template will get updated during the matching process, resulting in a single precise template that is used for subpixel registration.

\n", - "" + "" ] }, { diff --git a/demos/notebooks/demo_pipeline.ipynb b/demos/notebooks/demo_pipeline.ipynb index 507819619..ba23488f7 100644 --- a/demos/notebooks/demo_pipeline.ipynb +++ b/demos/notebooks/demo_pipeline.ipynb @@ -7,7 +7,7 @@ "# CNMF demo pipeline: Intro\n", "This demo provides a full pipeline for the analysis of a two-photon calcium imaging dataset using the CaImAn software package. It demonstrates how to use Caiman for the following analysis steps:\n", "\n", - "![Full CNMF Workflow](../../docs/img/full_cnmf_workflow.jpg)\n", + "![Full CNMF Workflow](images/full_cnmf_workflow.jpg)\n", "\n", "1) Apply the nonrigid motion correction (NoRMCorre) algorithm for motion correction.\n", "2) Apply the constrained nonnegative matrix factorization (CNMF) source separation algorithm to extract initial estimates of neuronal spatial footprints and calcium traces. \n", @@ -465,7 +465,7 @@ "## Motion Correction\n", "The first substantive step in our analysis pipeline is to remove motion artifacts from the original movie:\n", "\n", - "\"motion\n", + "\"motion\n", "\n", "It is *very* important to get rid of motion artifacts, as the subsequent CNMF source separation algorithm assumes that each pixel represents the same region of space\n", "\n", @@ -662,7 +662,7 @@ "\n", "Everything is now set up for running CNMF. This algorithm simultaneously extracts the *spatial footprint* and corresponding *calcium trace* for each component. \n", "\n", - "![cnmf patch flow image](../../docs/img/cnmf_workflow.jpg)\n", + "![cnmf patch flow image](images/cnmf_workflow.jpg)\n", "\n", "It also performs *deconvolution*, providing an estimate of the spike count that generated the calcium signal in the movie. " ] @@ -673,7 +673,7 @@ "source": [ "The algorithm is parallelized as illustrated here:\n", "\n", - "\"cnmf\n", + "\"cnmf\n", "\n", "1) The movie field of view is split into overlapping patches.\n", "2) These patches are processed in parallel by the CNMF algorithm. The degree of parallelization depends on your available computing power: if you have just one CPU then the patches will be processed sequentially. \n", @@ -935,7 +935,7 @@ "# Component Evaluation\n", "As already mentioned, the initial estimates produced by CNMF contains many spurious components. Our next step is to do some some quality control, cutting out the bad estimates to arrive at our final set of estimates:\n", "\n", - "![component evaluation image](../../docs/img/evaluation_workflow.jpg)" + "![component evaluation image](images/evaluation_workflow.jpg)" ] }, { @@ -950,7 +950,7 @@ "\n", "The first two criteria are illustrated schematically here (see also Figure 2 of the Caiman paper):\n", "\n", - "![component evaluation image](../../docs/img/component_evaluation.jpg)" + "![component evaluation image](images/component_evaluation.jpg)" ] }, { diff --git a/demos/notebooks/demo_pipeline_cnmfE.ipynb b/demos/notebooks/demo_pipeline_cnmfE.ipynb index 9e3d44d01..839b44075 100644 --- a/demos/notebooks/demo_pipeline_cnmfE.ipynb +++ b/demos/notebooks/demo_pipeline_cnmfE.ipynb @@ -7,7 +7,7 @@ "# CNMF-E demo pipeline: Intro \n", "This notebook demonstrates how to use Caiman for processing 1p microendoscopic data. It shows how to use Caiman for the following steps:\n", "\n", - "![workflow diagram](../../docs/img/full_cnmfe_workflow.jpg)\n", + "![workflow diagram](images/full_cnmfe_workflow.jpg)\n", "\n", "1. Apply the nonrigid motion correction (NoRMCorre) algorithm for motion correction to the original movie.\n", "2. Apply the constrained nonnegative matrix factorization endoscopic (CNMF-E) source separation algorithm to extract an initial estimate of neuronal spatial footprint and calcium traces.\n", @@ -475,7 +475,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "\n", + "\n", "Using `nb_inspect_correlation_pnr()`, you can inspect the correlation and PNR images to find threshold values for these quantities: `min_corr` and `min_pnr`. You can adjust the range of values displayed in the two subplots below by choosing the Y-box select tool (third button from the left -- highlighted in yellow in the accompanying image to the right) and selecting the desired region in the histograms on the right hand side of each image. You can also use the pan button (first button on the left) to zoom/adjust the axis limits in the histogram to make it easier to see the limits." ] }, @@ -527,7 +527,7 @@ "source": [ "
\n", "

CNMFE initialization: More on correlation and peak-to-noise-ratio

\n", - " \n", + " \n", "How are correlation and peak-to-noise ratio actually calculated? First Caiman convolves the motion corrected movie with a mean-centered Gaussian (example to the right). The sigma of the Gaussian is gSig, and mean centering is turned on by setting center_psf to True. This mean centering creates a Gaussian with a positive peak in the middle of width approximately gSig/2, surrounded by a negative trench, and a ledge of zeros around the outer edges. This crucial preprocessing filter serves to highlight neuronal peaks and smooth away low-frequency background activity.\n", "\n", "

The function correlation_pnr() applies this mean-centered Gaussian to each frame of the motion corrected movie and returns the correlation image of that movie, as well as the peak-to-noise-ratio (PNR). The correlation image is the correlation of each pixel with its neighbors. The PNR is the ratio of the maximum magnitude at a pixel to the noise value at that pixel (it is a fast and rough measure of signal-to-noise). As mentioned above, both of these values tend to be higher in pixels that contain neurons. The CNMFE initialization procedure is to set a threshold for both quantities, take their product, and use the peaks in this product map to find seed pixels for initialization of the CNMFE source separation algorithm.

\n", diff --git a/docs/img/bokeh_menu.jpg b/demos/notebooks/images/bokeh_menu.jpg similarity index 100% rename from docs/img/bokeh_menu.jpg rename to demos/notebooks/images/bokeh_menu.jpg diff --git a/docs/img/cnmf_patches.jpg b/demos/notebooks/images/cnmf_patches.jpg similarity index 100% rename from docs/img/cnmf_patches.jpg rename to demos/notebooks/images/cnmf_patches.jpg diff --git a/docs/img/mn_centered_gaussian.jpg b/demos/notebooks/images/mn_centered_gaussian.jpg similarity index 100% rename from docs/img/mn_centered_gaussian.jpg rename to demos/notebooks/images/mn_centered_gaussian.jpg diff --git a/docs/img/rigidcorrection.png b/demos/notebooks/images/rigidcorrection.png similarity index 100% rename from docs/img/rigidcorrection.png rename to demos/notebooks/images/rigidcorrection.png