Last active
January 5, 2018 16:30
-
-
Save ofgulban/9bb0de5444139191065cab63a3cfc233 to your computer and use it in GitHub Desktop.
Brainvoyager batch .vtc creation example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Batch script for VTC creation. | |
| // From native functional data space to an anatomical data to ACPC and to TAL | |
| // | |
| // For more information, check the scripting guide: | |
| // http://support.brainvoyager.com/automation-aamp-development/46-writing-scripts/133-scripting-reference-guide.html | |
| var bvqx = BrainVoyagerQX; | |
| bvqx.PrintToLog("---"); | |
| //---------------------------------------------------------------- | |
| // Enter the following values: | |
| var OutDataPath = "/path/to/your/subject/"; | |
| var NumberOfRuns = 4; | |
| var AnatomicalData = "/path/to/your/subject/S01_T1_TAL.vmr"; | |
| var IA_TRFList = ["/path/to/your/subject/S01_RUN_01-TO-T1_IA.trf"]; | |
| var FA_TRFList = ["/path/to/your/subject/S01_RUN_01-TO-T1_FA.trf"]; | |
| var ACPC_TRFList = ["/path/to/your/subject/S01_T1_ACPC.trf"]; | |
| var TAL_List = ["/path/to/your/subject/S01_T1_ACPC.tal"]; | |
| // fmr file names usually get quite long after preprocessing | |
| var InFmrList = [ | |
| "/path/to/your/subject/RUN_1/S01_RUN_01_SCSTBL_3DMCTS_LTR_THPGLMF6c_TDTS2.0dp.fmr", | |
| "/path/to/your/subject/RUN_2/S01_RUN_02_SCSTBL_3DMCTS_LTR_THPGLMF6c_TDTS2.0dp.fmr", | |
| "/path/to/your/subject/RUN_3/S01_RUN_03_SCSTBL_3DMCTS_LTR_THPGLMF6c_TDTS2.0dp.fmr", | |
| "/path/to/your/subject/RUN_4/S01_RUN_04_SCSTBL_3DMCTS_LTR_THPGLMF6c_TDTS2.0dp.fmr"]; | |
| // Output Talairach vtc file names | |
| var OutVTCNameList = [ | |
| "S01_run1.vtc", | |
| "S01_run2.vtc", | |
| "S01_run3.vtc", | |
| "S01_run4.vtc"]; | |
| //---------------------------------------------------------------- | |
| // Open an anatomical data | |
| var docVMR = bvqx.OpenDocument(AnatomicalData); | |
| // Specify bounding box for target VTC | |
| docVMR.ExtendedTALSpaceForVTCCreation = true; // optional | |
| docVMR.UseBoundingBoxForVTCCreation = true; // optional | |
| docVMR.TargetVTCBoundingBoxXStart = 120; | |
| docVMR.TargetVTCBoundingBoxXEnd = 390; | |
| docVMR.TargetVTCBoundingBoxYStart = 220; | |
| docVMR.TargetVTCBoundingBoxYEnd = 370; | |
| docVMR.TargetVTCBoundingBoxZStart = 110; | |
| docVMR.TargetVTCBoundingBoxZEnd = 360; | |
| for(count = 1; count <= NumberOfRuns; count++){ | |
| var InFmrPath = InFmrList[count-1]; | |
| var OutVTCName = OutDataPath + OutVTCNameList[count-1]; | |
| var IA_Path = IA_TRFList[0]; | |
| var FA_Path = FA_TRFList[0]; | |
| // Create VTC from FMR in TAL Space | |
| docVMR.CreateVTCInTALSpace(InFmrPath, | |
| IA_Path, // IA.trf | |
| FA_Path, // FA.trf | |
| ACPC_TRFList[0], // *_ACPC.trf | |
| TAL_List[0], // *.tal | |
| OutVTCName, // output name | |
| 2, // datatype integer 2-byte format:1 or float format:2 | |
| 2, // target resolution 1x1x1:1 or 2x2x2:2 or 3x3x3:3 | |
| 2, // nearest neighbour:0 or trilinear:1 or sinc:2 | |
| 100 // threshold(Default value:100) | |
| ); | |
| bvqx.PrintToLog(OutVTCName + " is done."); | |
| }; | |
| bvqx.PrintToLog("Finished."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment