# Output CPU information:
!cat /proc/cpuinfo | grep 'vendor' | uniq
!cat /proc/cpuinfo | grep 'model name' | uniqimport lmod
await lmod.load('ants/2.3.1')
await lmod.list()await lmod.load('afni/24.1.02')
await lmod.list()await lmod.load('freesurfer/7.3.2')
await lmod.list()await lmod.load('fsl/6.0.7.4')
await lmod.list()PATTERN = "sub-08/anat"
! datalad install https://github.com/OpenNeuroDatasets/ds000102.git
! cd ds000102 && datalad get $PATTERNinput_image = 'ds000102/sub-08/anat/sub-08_T1w.nii.gz'# Download the OASIS templates using wget
! wget https://ndownloader.figshare.com/files/3133832 -O OASIS.zip

# Unzip the downloaded file
! unzip OASIS.zip -d OASIS

# Remove zip file
! rm OASIS.zip

# Delete templates that are not needed
! find OASIS/MICCAI2012-Multi-Atlas-Challenge-Data -type f ! -name 'T_template0.nii.gz' ! -name 'T_template0_BrainCerebellumProbabilityMask.nii.gz' -exec rm {} +

# Delete Priors2 subfolder
! rm -r OASIS/MICCAI2012-Multi-Atlas-Challenge-Data/Priors2brain_template = 'OASIS/MICCAI2012-Multi-Atlas-Challenge-Data/T_template0.nii.gz'
brain_prior = 'OASIS/MICCAI2012-Multi-Atlas-Challenge-Data/T_template0_BrainCerebellumProbabilityMask.nii.gz'from ipyniivue import AnyNiivue
from IPython.display import display, Markdown

display(Markdown("### T1 image"))

nv_T1 = AnyNiivue()
nv_T1.load_volumes([{"path": f"{input_image}"}])
nv_T1display(Markdown("### ANTs BrainExtraction"))

nv_ANTS = AnyNiivue()
nv_ANTS.load_volumes([{"path": "ANTS_Stripped_BrainExtractionBrain.nii.gz"}])
nv_ANTS display(Markdown("### AFNI 3dSkullStrip"))

nv_AFNI = AnyNiivue()
nv_AFNI.load_volumes([{"path": "AFNI_ss.nii.gz"}])
nv_AFNIdisplay(Markdown("### FreeSurfer SynthStrip"))

nv_FreeSurfer = AnyNiivue()
nv_FreeSurfer.load_volumes([{"path": "synth_stripped.nii.gz"}])
nv_FreeSurferdisplay(Markdown("### FSL BET"))

nv_FSL = AnyNiivue()
nv_FSL.load_volumes([{"path": "anat_bet.nii.gz"}])
nv_FSL