In a folder, I have both my .m file that contains the script and one imaging .dcm file that is the target of my analysis.
Folder structure:
Folder1/analysis.m
Folder1/meas_dynamic_123.dcm
Folder1/meas_123.dcm
Folder1/meas_345.dcm
My script (analysis.m) begins as follows:
target =''; <== here should go only the filename that contains 'dynamic'
example: meas_dynamic_123.dcm
txt = dir(target);
// etc
So I’m wondering if there is a way of when running analysis.m it will:
-
automatically search the folder it’s in,
-
grab the filename of file containing string
dynamicin the name, -
insert its name into
targetvariable -
continue running the script
Does anyone have any pointers on how to achieve this? Using ffpath?
you should do: