# Output CPU information:
!cat /proc/cpuinfo | grep 'vendor' | uniq
!cat /proc/cpuinfo | grep 'model name' | uniq%%bash
datalad install https://datasets.datalad.org/repronim/heudiconv-reproin-example
cd heudiconv-reproin-example/REPROIN/dicom && datalad get 001import lmod
await lmod.load('dcm2niix/v1.0.20240202')await lmod.load('heudiconv/1.3.1')await lmod.load('bidscoin/4.3.3')%%bash
mkdir bidscoin_bidsmap
bidsmapper ./heudiconv-reproin-example/REPROIN/dicom ./bidscoin_bidsmap --subprefix '00' --sesprefix 'Patterson_Coben'   # Scans your data and creates a study bidsmap
bidscoiner ./heudiconv-reproin-example/REPROIN/dicom ./bidscoin_bids    # Converts your data to BIDS using the study bidsmapawait lmod.load('fsl/6.0.7.4')
await lmod.list()%%bash
mkdir -p segmentation
declare -a niifile=($(find ./heudiconv_bids/Patterson/Coben/sub-001/anat/ -type f -iname "*.nii.gz"));

for filepath in "${niifile[@]}"; do
    # Extract the base filename without the path
    filename=$(basename "$filepath")

    # Extract the name without the extension
    name="${filename%.*}"

    # Output the current file
    echo "Processing file: $filepath"

    # Run BET and save the result
    output="./segmentation/${name%.*}_brain"
    echo "Saving output to: $output"
    bet "$filepath" "$output"
donefrom ipyniivue import AnyNiivue
nv = AnyNiivue()
nv.load_volumes([{"path": "/data/books/workflows/bidscoin_bids/sub-1/ses-1/anat/sub-1_ses-1_acq-anatT1wacqMPRAGE_T1w.nii.gz"}])
nv