# Page History

## Key

• This line was removed.
• Formatting was changed.

...

Code Block
```% -------------------------------
%
% For example:
%
% Requires: MATLAB 7.13 (R2011b)
%
%          ara_nissl_25.nrrd,
%          ccf_2015/annotation_25.nrrd
%
% ---------------------------------

%
% Note that reader swaps the order of the first two axes
%
% AVGT = 3-D matrix of average_template
% NISSL = 3-D matrix of ara_nissl
% ANO = 3-D matrix of ccf_2015/anntotationannotation
%

% Display one coronal section
figure;imagesc(squeeze(AVGT(:,264,:)));colormap(gray(256)); axis equal;
figure;imagesc(squeeze(NISSL(:,264,:)));colormap(gray(256)); axis equal;
figure;imagesc(squeeze(ANO(:,264,:)));
caxis([1,2000]); colormap(lines(256)); axis equal;

% Display one sagittal section
figure;imagesc(squeeze(AVGT(:,:,220)));colormap(gray(256)); axis equal;
figure;imagesc(squeeze(NISSL(:,:,220)));colormap(gray(256)); axis equal;
figure;imagesc(squeeze(ANO(:,:,220)));
caxis([1,2000]); colormap(lines(256)); axis equal;

```

...

Code Block
```# -------------------------------
#
# Install pynrrd: https://github.com/mhe/pynrrd
#
#          ara_nissl_25.nrrd,
#          ccf_2015/annotation_25.nrrd
#
# ---------------------------------
import nrrd
import numpy as np
import matplotlib.pyplot as plt
import Image

#
# Note that reader swaps the order of the first two axes
#
# AVGT = 3-D matrix of average_template
# NISSL = 3-D matrix of ara_nissl
# ANO = 3-D matrix of ccf_2015/anntotationannotation
#

# Save one coronal section as PNG
slice = AVGT[264,:,:].astype(float)
slice /= np.max(slice)
im = Image.fromarray(np.uint8(plt.cm.gray(slice)*255))
im.save('output/avgt_coronal.png')

slice = NISSL[264,:,:].astype(float)
slice /= np.max(slice)
im = Image.fromarray(np.uint8(plt.cm.gray(slice)*255))
im.save('output/nissl_coronal.png')

slice = ANO[264,:,:].astype(float)
slice /= 2000
im = Image.fromarray(np.uint8(plt.cm.jet(slice)*255))
im.save('output/ano_coronal.png')

# Save one sagittal section as PNG
slice = AVGT[:,:,220].astype(float)
slice /= np.max(slice)
im = Image.fromarray(np.uint8(plt.cm.gray(slice)*255))
im.save('output/avgt_sagittal.png')

slice = NISSL[:,:,220].astype(float)
slice /= np.max(slice)
im = Image.fromarray(np.uint8(plt.cm.gray(slice)*255))
im.save('output/nissl_sagittal.png')

slice = ANO[:,:,220].astype(float)
slice /= 2000
im = Image.fromarray(np.uint8(plt.cm.jet(slice)*255))
im.save('output/ano_sagittal.png')
```

...