<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://mslice.isis.rl.ac.uk/index.php?action=history&amp;feed=atom&amp;title=Code_to_identify_data_folders</id>
	<title>Code to identify data folders - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://mslice.isis.rl.ac.uk/index.php?action=history&amp;feed=atom&amp;title=Code_to_identify_data_folders"/>
	<link rel="alternate" type="text/html" href="http://mslice.isis.rl.ac.uk/index.php?title=Code_to_identify_data_folders&amp;action=history"/>
	<updated>2026-05-31T12:36:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>http://mslice.isis.rl.ac.uk/index.php?title=Code_to_identify_data_folders&amp;diff=93&amp;oldid=prev</id>
		<title>Alex Buts: Created page with &quot;   &lt;syntaxhighlight lang=&quot;MATLAB M&quot;&gt;         if isfield(msl_conf,field)              % this is a path which may be specified either in the file             % itself, or in config...&quot;</title>
		<link rel="alternate" type="text/html" href="http://mslice.isis.rl.ac.uk/index.php?title=Code_to_identify_data_folders&amp;diff=93&amp;oldid=prev"/>
		<updated>2011-03-31T11:40:23Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;   &amp;lt;syntaxhighlight lang=&amp;quot;MATLAB M&amp;quot;&amp;gt;         if isfield(msl_conf,field)              % this is a path which may be specified either in the file             % itself, or in config...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;MATLAB M&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       if isfield(msl_conf,field) &lt;br /&gt;
            % this is a path which may be specified either in the file&lt;br /&gt;
            % itself, or in configuration; Arbitration would occur. &lt;br /&gt;
&lt;br /&gt;
            if (strcmp(field,&amp;#039;MspDir&amp;#039;)||strcmp(field,&amp;#039;MspFile&amp;#039;)) % if it is MspDir or MspFile, then it has been set already&lt;br /&gt;
                if strcmp(field,&amp;#039;MspFile&amp;#039;) &amp;amp;&amp;amp; ~strcmp(value,file_name) % but the msp file name in defined in the file is different from the filename itself&lt;br /&gt;
                    % need to fix it;&lt;br /&gt;
                      nmodific =nmodific+1;&lt;br /&gt;
                      modificators{nmodific}=&amp;#039;MspFile&amp;#039;;&lt;br /&gt;
                      nmodific =nmodific+1;&lt;br /&gt;
                      modificators{nmodific}=file_name;                    &lt;br /&gt;
                end      &lt;br /&gt;
&lt;br /&gt;
            elseif strncmp(value,&amp;#039;$.&amp;#039;,2) % this is probably relative path to a sample data and the field is read only&lt;br /&gt;
               full_dir=fullfile(get(mslice_config,&amp;#039;MspDir&amp;#039;),value(4:length(value)));&lt;br /&gt;
               set(mslice_config,field,full_dir);               &lt;br /&gt;
               is_read_only=true;&lt;br /&gt;
&lt;br /&gt;
            elseif strncmp(value,&amp;#039;.&amp;#039;,1) % this is probably relative path to a sample data below&lt;br /&gt;
               full_dir=fullfile(get(mslice_config,&amp;#039;MspDir&amp;#039;),value(3:length(value)));&lt;br /&gt;
               if exist(full_dir,&amp;#039;dir&amp;#039;)&lt;br /&gt;
                    set(mslice_config,field,full_dir);&lt;br /&gt;
               else&lt;br /&gt;
                   full_dir=get(mslice_config,field);&lt;br /&gt;
                   msp_dir =get(mslice_config,&amp;#039;MspDir&amp;#039;);&lt;br /&gt;
                   short_dir=strrep(full_dir,msp_dir,&amp;#039;./&amp;#039;);&lt;br /&gt;
                   nmodific =nmodific+1;&lt;br /&gt;
                   modificators{nmodific}=field;&lt;br /&gt;
                   nmodific =nmodific+1;&lt;br /&gt;
                   modificators{nmodific}=short_dir;                &lt;br /&gt;
               end&lt;br /&gt;
&lt;br /&gt;
            else&lt;br /&gt;
                if exist(value,&amp;#039;dir&amp;#039;) % the path is specified by sting in the file;&lt;br /&gt;
                    set(mslice_config,field,value);&lt;br /&gt;
                else % the path should be y specified by config variables&lt;br /&gt;
                   path=get(mslice_config,field);&lt;br /&gt;
                   msp_dir =get(mslice_config,&amp;#039;MspDir&amp;#039;);&lt;br /&gt;
                   path  =strrep(path,msp_dir,&amp;#039;./&amp;#039;);&lt;br /&gt;
                  &lt;br /&gt;
                   nmodific =nmodific+1;&lt;br /&gt;
                   modificators{nmodific}=field;&lt;br /&gt;
                   nmodific =nmodific+1;&lt;br /&gt;
                   modificators{nmodific}=path;&lt;br /&gt;
                end&lt;br /&gt;
                  &lt;br /&gt;
            end         &lt;br /&gt;
&lt;br /&gt;
          % replace sting in old msp file with its new equivalents&lt;br /&gt;
&lt;br /&gt;
          if ~isempty(modificators)&amp;amp;&amp;amp;(~is_read_only)&lt;br /&gt;
          for i=1:floor(nmodific/2)&lt;br /&gt;
             perl(&amp;#039;set_key_value.pl&amp;#039;,fullname,modificators{2*i-1},modificators{2*i});       &lt;br /&gt;
          end&lt;br /&gt;
      end&lt;br /&gt;
             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alex Buts</name></author>
	</entry>
</feed>