%matplotlib inline

"""
Explanation: Visualize Clusters on Volume
End of explanation
"""


# Voxel cluster extend
cluster_extend = 20

# Threshold for statistical map
threshold = 2.3

# Template to use for background
template = '../scripts/templates/MNI152_T1_1mm_brain.nii.gz'

# Creat CSV file with cluster information
create_CSV = True

# Show cross on cut position
show_cross = True

# Show image annotation (hemisphere laterality and coordination)
annotate_figure = True

# Show colorbar
show_colorbar = True

# Colorbar orientation
colorbar_orientation = 'horizontal'

# Show cluster information in title
show_title = False

# Image resolution
dpi = 300

# Image type
imageType = 'png'

# Add prefix to image name
prefix = 'cluster'

"""
Explanation: 1. Upload all statistical maps into the data folder
The data folder can be found in the same folder as this notebook. Just drag and drop your NIfTI file into the data folder and press the upload button.
2. Specify relevant visualization parameters
End of explanation
"""


%run ../scripts/show_cluster_in_volume.py --help

%run ../scripts/show_volume.py \
    $cluster_extend \
    $threshold \
    $template \
    $create_CSV \
    $show_cross \
    $annotate_figure \
    $show_colorbar \
    $colorbar_orientation \
    $show_title \
    $dpi \
    $imageType \
    $prefix 

"""
Explanation: 3. Run the visualization script
End of explanation
"""


from IPython.display import Image, display
outputs = sorted(gg('figures/*/*.%s' % imageType))
for o in outputs:
    a = Image(filename=o)
    display(a)

"""
Explanation: 4. Look at your data
End of explanation
"""


