# XNAT Desktop: tagged upload of non-DICOM data to XNAT

In this project, directories for each mouse experiment are called CONV1, CONV2, ... . The directory has raw images from the optical imager saved in TIFF files, and analysis results in  .mat files:

 <folder ID="root_fold" pattern=".*" treeRoot="1">
<child>subj_dir</child>
</folder>

Here, we describe the root folder where the rule should be applied.

 <folder ID="subj_dir" pattern="CONV.*" treeRoot="1">
<tag name="Subject" pattern=".*" recursive="fixed"/>
<tag name="Project" value="default" recursive="fixed"/>
<tag name="Modality" value="CT" recursive="fixed"/>
<child>auxiliary_file</child>
<child>tiff_file</child>
</folder>

The search algorithm will:

For each directory at root level with arbitrary name:
for each file in each such subdirectory:
assign the tag "Subject" with value equal to the name of that directory
assign the tag "Project" with value "default"
assing the tag "Modality" with value "CT"

The rest of the  XNAT tags (also called XNAT ontology tags) required for each file to be uploaded to XNAT, are assigned by the rest of the rule in the similar way, going down the directory tree and looking for directory and file name patterns.

Now, we add naming_rule.xml document to XND's rule collection via View->Preferences->Ontology and rules->Add rule from file. We run the "apply custom rule"->"naming_ois" context menu command on the OIS directory, and switch to Tag View tab:

Then, we run the "upload" context menu command on the "Subject:CONV1" level. The REST calls are tracked in the XND Console:

Then, we check the XNAT experiment online:

It might take several iterations in modifying the rule to achieve desirable results, but then the upload will be automatic for the rest of your project.