Skip to content

Commit

Permalink
deploy: 3229797
Browse files Browse the repository at this point in the history
  • Loading branch information
b-heifets committed Sep 14, 2024
1 parent 29d511d commit 22e44ca
Show file tree
Hide file tree
Showing 87 changed files with 2,453 additions and 1,331 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/FSLeyes_autofl_image_from_reg.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/Ilastik_brain_mask_example.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/Ilastik_c-Fos_example.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/brain_model_layout.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/brain_model_settings_1.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/brain_model_settings_2.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/sunburst_1_flourish.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/sunburst_2_plot_types.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/sunburst_3_adding_data.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/sunburst_4_RGB_values.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 1 addition & 10 deletions _modules/unravel/cluster_stats/brain_model.html
Original file line number Diff line number Diff line change
Expand Up @@ -461,18 +461,8 @@ <h1>Source code for unravel.cluster_stats.brain_model</h1><div class="highlight"
<span class="n">final_data</span> <span class="o">=</span> <span class="n">img</span> <span class="o">*</span> <span class="n">atlas_img</span>

<span class="c1"># Save the bilateral version of the cluster index with ABA colors</span>

<span class="n">nib</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">nib</span><span class="o">.</span><span class="n">Nifti1Image</span><span class="p">(</span><span class="n">final_data</span><span class="p">,</span> <span class="n">atlas_nii</span><span class="o">.</span><span class="n">affine</span><span class="p">,</span> <span class="n">atlas_nii</span><span class="o">.</span><span class="n">header</span><span class="p">),</span> <span class="n">output</span><span class="p">)</span>

<span class="c1"># Calculate and save histogram</span>
<span class="n">histogram</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">histogram</span><span class="p">(</span><span class="n">final_data</span><span class="p">,</span> <span class="n">bins</span><span class="o">=</span><span class="mi">21144</span><span class="p">,</span> <span class="nb">range</span><span class="o">=</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">21144</span><span class="p">))</span>

<span class="c1"># Exclude the background (region 0) from the histogram</span>
<span class="n">histogram</span> <span class="o">=</span> <span class="n">histogram</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>

<span class="c1"># Determine what regions are present based on the histogram</span>
<span class="n">present_regions</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">histogram</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="mi">1</span> <span class="c1"># Add 1 to account for the background</span>

<span class="c1"># Get R, G, B values for each region</span>
<span class="k">if</span> <span class="n">args</span><span class="o">.</span><span class="n">csv_path</span> <span class="o">==</span> <span class="s1">&#39;CCFv3-2017_regional_summary.csv&#39;</span> <span class="ow">or</span> <span class="n">args</span><span class="o">.</span><span class="n">csv_path</span> <span class="o">==</span> <span class="s1">&#39;CCFv3-2020_regional_summary.csv&#39;</span><span class="p">:</span>
<span class="n">color_map</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">Path</span><span class="p">(</span><span class="vm">__file__</span><span class="p">)</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">parent</span> <span class="o">/</span> <span class="s1">&#39;core&#39;</span> <span class="o">/</span> <span class="s1">&#39;csvs&#39;</span> <span class="o">/</span> <span class="n">args</span><span class="o">.</span><span class="n">csv_path</span><span class="p">)</span> <span class="c1">#(Region_ID,ID_Path,Region,Abbr,General_Region,R,G,B)</span>
Expand All @@ -484,6 +474,7 @@ <h1>Source code for unravel.cluster_stats.brain_model</h1><div class="highlight"
<span class="n">Path</span><span class="p">(</span><span class="n">txt_output</span><span class="p">)</span><span class="o">.</span><span class="n">unlink</span><span class="p">()</span>

<span class="c1"># Determine the RGB color for bars based on the region_id</span>
<span class="n">present_regions</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">unique</span><span class="p">(</span><span class="n">final_data</span><span class="p">[</span><span class="n">final_data</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">])</span>
<span class="k">for</span> <span class="n">region_id</span> <span class="ow">in</span> <span class="n">present_regions</span><span class="p">:</span>
<span class="n">combined_region_id</span> <span class="o">=</span> <span class="n">region_id</span> <span class="k">if</span> <span class="n">region_id</span> <span class="o">&lt;</span> <span class="mi">20000</span> <span class="k">else</span> <span class="n">region_id</span> <span class="o">-</span> <span class="mi">20000</span>
<span class="n">region_rgb</span> <span class="o">=</span> <span class="n">color_map</span><span class="p">[</span><span class="n">color_map</span><span class="p">[</span><span class="s1">&#39;Region_ID&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="n">combined_region_id</span><span class="p">][[</span><span class="s1">&#39;R&#39;</span><span class="p">,</span> <span class="s1">&#39;G&#39;</span><span class="p">,</span> <span class="s1">&#39;B&#39;</span><span class="p">]]</span>
Expand Down
4 changes: 4 additions & 0 deletions _modules/unravel/cluster_stats/fdr.html
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ <h1>Source code for unravel.cluster_stats.fdr</h1><div class="highlight"><pre>
<span class="sd"> - The cluster index will be split accoding to the effect directions</span>
<span class="sd"> - ``cstats_fdr`` -i vox_p_fstat1.nii.gz -mas mask.nii.gz -q 0.05 -a1 group1_avg.nii.gz -a2 group2_avg.nii.gz -o stats_info_g1_v_g2 -v</span>

<span class="sd">Next commands:</span>
<span class="sd"> - ``cstats_mirror_indices`` to mirror the cluster indices to the other hemisphere (if bilateral data processed with a hemispheric mask).</span>
<span class="sd"> - ``cstats_validation`` to validate the cluster indices (if unilateral data or bilateral data processed with a whole brain mask).</span>

<span class="sd">Usage</span>
<span class="sd">-----</span>
<span class="sd"> cstats_fdr -i path/vox_p_tstat1.nii.gz -mas path/mask.nii.gz -q 0.05 0.01 0.001 [-ms 100] [-o output_dir] [-a1 path/avg_img1.nii.gz] [-a2 path/avg_img2.nii.gz] [-th 10] [-v]</span>
Expand Down
3 changes: 3 additions & 0 deletions _modules/unravel/cluster_stats/fdr_range.html
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ <h1>Source code for unravel.cluster_stats.fdr_range</h1><div class="highlight"><
<span class="sd">Inputs: </span>
<span class="sd"> - p value map (e.g., *vox_p_*stat*.nii.gz from vstats)</span>

<span class="sd">Next command:</span>
<span class="sd"> - ``cstats_fdr`` to correct for multiple comparisons (use the q values from ``cstats_fdr_range``).</span>

<span class="sd">Usage:</span>
<span class="sd">------</span>
<span class="sd"> cstats_fdr_range -i path/vox_p_tstat1.nii.gz -mas path/mask.nii.gz [-q 0.00001 0.00005 0.0001 0.0005 0.001 0.005 0.01 0.05 0.1 0.15 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.95 0.99 0.999 0.9999] [-th 22] [-v]</span>
Expand Down
10 changes: 5 additions & 5 deletions _modules/unravel/cluster_stats/mean_IF.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ <h1>Source code for unravel.cluster_stats.mean_IF</h1><div class="highlight"><pr
<span class="sd">Use ``cstats_mean_IF`` from UNRAVEL to measure mean intensity of immunofluorescence staining in clusters.</span>

<span class="sd">Prereqs: </span>
<span class="sd"> - vstats</span>
<span class="sd"> - cstats_fdr</span>
<span class="sd"> - ``vstats``</span>
<span class="sd"> - ``cstats_fdr``</span>

<span class="sd">Inputs:</span>
<span class="sd"> - This can be run from the vstats directory (will process .nii.gz images in the current directory)</span>
Expand All @@ -367,10 +367,10 @@ <h1>Source code for unravel.cluster_stats.mean_IF</h1><div class="highlight"><pr

<span class="sd">Next steps:</span>
<span class="sd"> - cd cluster_mean_IF...</span>
<span class="sd"> - utils_prepend -sk &lt;path/sample_key.csv&gt; -f # If needed</span>
<span class="sd"> - ``utils_prepend`` -sk &lt;path/sample_key.csv&gt; -f # If needed</span>
<span class="sd"> - [``cstats_index`` and ``cstats_table``] # for an xlsx table and anatomically ordered clusters that can be used with ``cstats_prism``</span>
<span class="sd"> - cstats_mean_IF_summary --order Control Treatment --labels Control Treatment -t ttest # Plots each cluster and outputs a summary table w/ stats</span>
<span class="sd"> - cstats_mean_IF_summary --order group3 group2 group1 --labels Group_3 Group_2 Group_1 # Tukey tests</span>
<span class="sd"> - ``cstats_mean_IF_summary`` --order Control Treatment --labels Control Treatment -t ttest # Plots each cluster and outputs a summary table w/ stats</span>
<span class="sd"> - ``cstats_mean_IF_summary`` --order group3 group2 group1 --labels Group_3 Group_2 Group_1 # Tukey tests</span>

<span class="sd">Usage:</span>
<span class="sd">------</span>
Expand Down
Loading

0 comments on commit 22e44ca

Please sign in to comment.