Renaming DICOM files

Preparation for the creation of BrainVoyager projects

 

To prepare for the creation of projects, it might be necessary to rename the files (in case the files are DICOM format).

The renaming can be performed via the function RenameDicomFilesInDirectory( <directory name> );

 

Example function

The function below shows a file dialog to select a directory, renames files in that directory and prints information to the BrainVoyager QX Log tab.

 

function Rename_DICOM_files() {

    

     BrainVoyagerQX.ShowLogTab();

     BrainVoyagerQX.PrintToLog("Start function to rename DICOM files...");

var dirname = BrainVoyagerQX.BrowseDirectory("Please select a directory with DICOM files");

BrainVoyagerQX.PrintToLog("Renaming '" + dirname + "'...");

BrainVoyagerQX.RenameDicomFilesInDirectory(dirname);

     BrainVoyagerQX.PrintToLog("Finished.");

}

 

 

The BrowseDirectory( "Please select a directory with DICOM files" ) function results in the following dialog:

 

 

It will return a directory name with forward slashes and without an end slash, for example:

 

C:/Experiment/Data