- Author:
- WeiweiAi <wai484@aucklanduni.ac.nz>
- Date:
- 2022-07-13 14:51:02+12:00
- Desc:
- Add stimulation protocol
- Permanent Source URI:
- https://staging.physiomeproject.org/workspace/8af/rawfile/e27c5fa70019b9fa1373d903d28dd3f504d8b182/Components/buildsrc/txt2cellml.ps1
## Convert .txt to .cellml
# If this script cannot be loaded, type "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process" in the PowerShell terminal
# The OpenCOR installation folder path
$dpath= 'C:/Users/wai484/Documents/OpenCOR'
# The text file name
$txtfiles="Para","C0_S2","CN_S2","C_S3","O0_S2","ON_S2","O_S3","MWC_10","MWC_18"
# The model directory where .txt files are saved
$tpath='C:/Users/wai484/Documents/ECC_MSK_Rios_1993/Components/buildsrc'
# The model directory where .cellml files are saved
$cpath='C:/Users/wai484/Documents/ECC_MSK_Rios_1993/Components'
# Execute the command to do the conversion
foreach ($txtfile in $txtfiles)
{
.$dpath/OpenCOR -c CellMLTextView::export $tpath/$txtfile.txt | out-file $cpath/$txtfile.cellml -encoding utf8
}
$txtfile="MWC_10_test"
$cpath='C:/Users/wai484/Documents/ECC_MSK_Rios_1993/Experiments'
.$dpath/OpenCOR -c CellMLTextView::export $tpath/$txtfile.txt | out-file $cpath/$txtfile.cellml -encoding utf8
$txtfile="MWC_18_test"
$cpath='C:/Users/wai484/Documents/ECC_MSK_Rios_1993/Experiments'
.$dpath/OpenCOR -c CellMLTextView::export $tpath/$txtfile.txt | out-file $cpath/$txtfile.cellml -encoding utf8