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:
	look for immediate subdirectories that start with "CONV"
		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.

Tagging and uploading the data

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.

Additional information

To upload additional metadata to the newly created session, the recommended method is to prepare spreadsheets that list information at each level for each experiment, and use the Spreadsheet Uploader.
For detailed tutorial for creating naming rule for OIS data, refer to this wiki page: Upload of non-DICOM data to XNAT with XNAT Desktop
For an exhaustive manual on XNAT Destkop, refer to this page: full XND manual


$label.name