scieee Science in your language
[en] (orig)

Building an imaging-based research platform for experiments with brain connectivity data

Abstract

Within the past decade, not only societies in general but also medicine and healthcare, in particular, have changed tremendously. In large part because of the rapid dissemination of computers and digital communications which lead to the appearance of new medical disciplines, such as Medical Informatics. Nowadays, one of the most prominent field in Medical Informatics is Medical Imaging, as it is implied, it is a collection of methodologies and techniques used in order to visually and spatially represent parts of the brain for diagnostic and research purposes. In the research ecosystem, Neuroimaging is an increasing popular field, with applications in neurology and psychiatry. However, due to the difficulties to handle Neuroimaging data, since data has its own specificities, researchers have encountered problems to correctly handling this data. This can be a crucial issue specially with large volumes of Neuroimaging data and all the research materials associated. This work aims to architect and build a research platform to correctly archive Medical Imaging data and all the associated research materials, where researchers can exchange imaging data and collaborate in Neuroimaging research projects. The platform offers a correct way to collect and store all imaging data, archiving all of patient exams with the correspondent information, making available the correspondent information to researchers in a confidential, secure and efficient way. The two main outcomes of this work are an architecture of a platform that manages all imaging data and associated research materials, plus an open-source Python package to easily interact with that platform.

Read accessible full text

Building an imaging-based research platform for experiments with brain connectivity data

Author: Moreira, Rogério Gomes Lopes
Year: 2019
Source: https://repositorium.uminho.pt/bitstreams/c8886c15-5b3d-4457-bb05-072381f009c7/download
UMinho 2019
Rogé io Gomes Lopes Mo ei a
Building an imaging-based esea ch pla o m o expe imen s wi h b ain connec i i y da a
No embe 2019
Rogé io Gomes Lopes Mo ei a
Building an imaging-based esea ch
pla o m o expe imen s wi h
B ain connec i i y da a
Ana Filipa de Oli e ia Ramos Deep Lea ning Applied o Medical Imaging
i
Rogé io Gomes Lopes Mo ei a
Building an imaging-based esea ch
pla o m o expe imen s wi h b ain
connec i i y da a
Mas e ’s Disse a ion
In eg a ed Mas e ’s in In o ma ics Enginee ing
Disse a ion o ien ed by
Vic o Manuel Rod igues Al es
Nicolás F ancisco Lo i
No embe 2019

i
Acknowledgemen s
I would like o hank my supe iso , Vic o Al es o his guidance, a ailabili y, sha ing and encou agemen .
His ad ices and assis an we e uly impo an o me. I would also like o hank Nicolás Lo i, my co-
supe iso , who augh me so much abou neu oimaging.
Finally, o my pa en s, my b o he and Jo ge o all he suppo and ad ice in my decisions. To my cou se
colleagues, Samuel, Gus a o and Diogo who suppo ed me g ea ly and we e always willing o help me.
To Luis, my eache who uly changed he way I saw he wo ld. I’m o e e hank ul o his insigh s and
mind opening. And inally, o Madalena, o being wi h me all he ime in good and bad and suppo ing
me h ough my academic jou ney. Thank you o all you lo e.
ii
DECLARATION
Name: Rogé io Gomes Lopes Mo ei a
Disse a ion Ti le: Building an imaging-based esea ch pla o m o expe imen s wi h b ain connec i i y
da a
Men o s: Vic o Manuel Rod igues Al es, Nicolás F ancisco Lo i
Conclusion Yea : 2019
Mas e Designa ion: Mes ado In eg ado em Engenha ia In o má ica
Mas e B anch: In o má ica Médica
I decla e ha I g an o he Uni e si y o Minho and i s agen s a non-exclusi e license o ile and make
a ailable h ough i s eposi o y, in he condi ions indica ed below, my disse a ion, as a whole o pa ially,
in digi al suppo .
I decla e ha I au ho ize he Uni e si y o Minho o ile mo e han one copy o he disse a ion and, wi hou
al e ing i s con en s, o con e he disse a ion o any o ma o suppo , o he pu pose o p ese a ion
and access.
Fu he mo e, I e ain all copy igh s ela ed o he disse a ion and he igh o use i in u u e wo ks.
I au ho ize he pa ial ep oduc ion o his disse a ion o he pu pose o in es iga ion by means o a
w i en decla a ion o he in e es ed pe son o en i y.
This is an academic wo k ha can be used by hi d pa ies i in e na ionally accep ed ules and good
p ac ice wi h ega d o copy igh and ela ed igh s a e espec ed.
Thus, he p esen wo k can be used unde he e ms o he license indica ed below.
In case he use needs pe mission o be able o make use o he wo k in condi ions no o eseen in he
indica ed licensing, he should con ac he au ho h ough he Reposi o iUM o he Uni e si y o Minho.
A ibuição-NãoCome cial-SemDe i ações
CC BY-NC-ND
h ps://c ea i ecommons.o g/licenses/by-nc-nd/4.0/
Uni e sidade do Minho, ____/____/______
Signa u e: ___________________________________
iii
STATEMENT OF INTEGRITY
I he eby decla e ha ing conduc ed his academic wo k wi h in eg i y. I con i m ha I ha e no used
plagia ism o any o m o undue use o in o ma ion o alsi ica ion o esul s along he p ocess leading o
i s elabo a ion.
I u he decla e ha I ha e ully acknowledged he Code o E hical Conduc o he Uni e si y o Minho.
Uni e sidade do Minho, ____/____/______
Signa u e: ________________________________________
i
ABSTRACT
Wi hin he pas decade, no only socie ies in gene al bu also medicine and heal hca e, in pa icula , ha e
changed emendously. In la ge pa because o he apid dissemina ion o compu e s and digi al
communica ions which lead o he appea ance o new medical disciplines, such as Medical In o ma ics.
Nowadays, one o he mos p ominen ield in Medical In o ma ics is Medical Imaging, as i is implied, i
is a collec ion o me hodologies and echniques used in o de o isually and spa ially ep esen pa s o
he b ain o diagnos ic and esea ch pu poses.
In he esea ch ecosys em, Neu oimaging is an inc easing popula ield, wi h applica ions in neu ology
and psychia y. Howe e , due o he di icul ies o handle Neu oimaging da a, since da a has i s own
speci ici ies, esea che s ha e encoun e ed p oblems o co ec ly handling his da a. This can be a c ucial
issue specially wi h la ge olumes o Neu oimaging da a and all he esea ch ma e ials associa ed.
This wo k aims o a chi ec and build a esea ch pla o m o co ec ly a chi e Medical Imaging da a and
all he associa ed esea ch ma e ials, whe e esea che s can exchange imaging da a and collabo a e in
Neu oimaging esea ch p ojec s. The pla o m o e s a co ec way o collec and s o e all imaging da a,
a chi ing all o pa ien exams wi h he co esponden in o ma ion, making a ailable he co esponden
in o ma ion o esea che s in a con iden ial, secu e and e icien way.
The wo main ou comes o his wo k a e an a chi ec u e o a pla o m ha manages all imaging da a and
associa ed esea ch ma e ials, plus an open-sou ce Py hon package o easily in e ac wi h ha pla o m.
• Keywo ds: Da a Sha ing, Medical Imaging, Neu oin o ma ics, Neu oimaging, XNAT.
xi
ABBREVIATIONS AND ACRONYMS
A
AI
A i icial In elligence
API
Applica ion P og amming In e ace
B
BIRN
Biomedical In o ma ics Resea ch Ne wo k
C
CNDA
Cen al Neu oimaging Da a A chi e
CSV
Comma-sepa a ed alues
CT
Compu ed Tomog aphy
D
DICOM
Digi al Imaging and Communica ions in Medicine
DBMS
Da abase Managemen Sys em
DL
Deep Lea ning
F
MRI
Func ional magne ic esonance imaging
G
GUI
G aphical Use In e ace
H
HDD
Ha d Disk D i e
HTTP
Hype ex T ans e P o ocol
HCP
Human Connec ome P ojec
J
JAAT
Join Anonymiza ion and A chi e T ansmission
L
Loni IDA
Loni Image Da a A chi e

xii
LXC
Linux Con aine s
M
ML
Machine Lea ning
MRI
Magne ic Resonance Imaging
MR
Magne ic Resonance
MVCC
Mul i e sion concu ency con ol
N
NI TI
Neu oimaging In o ma ics Technology Ini ia i e
NM
Nuclea Medicine
NIAC
Neu oimaging In o ma ics and Analysis Cen e
NGINX
Engine-X
NA-MIC
Na ional Alliance o Medical Image Compu ing
O
OS
Ope a ing Sys em
P
PET
Posi on-Emission Tomog aphy
PITR
Poin -in-Time-Reco e y
R
REST
Rep esen a ional S a e T ans e
S
SFTP
Secu e File T ans e P o ocol
SCP
Se ice Class P o ide
SPECT
Single-pho on emission compu ed omog aphy
SQL
S uc u ed Que y Language
SSD
Solid-S a e D i e
U
UI
Use In e ace
UMINHO
Uni e si y o Minho
xiii
US
Uni ed S a ed
V
VM
Vi ual Machine
X
XDAT
eX ensible Da a A chi e Toolki
XML
eX ensible Ma kup Language
XNAT
eX ensible Neu oimaging A chi e Toolki
XSD
XML Schema De ini ion
XTK
X-Ray Toolki
Y
YAML
YAML Ain' Ma kup Language
xi
GLOSSARY
Da ase
A collec ion o examples. Each example con ains one o mo e ea u es
and a label (i using supe ised aining).
DICOM
DICOM (Digi al Imaging and Communica ions in Medicine) is a s anda d
o handling, s o ing, p in ing, and ansmi ing in o ma ion in Medical
Imaging. I includes a ile o ma de ini ion and a ne wo k
communica ions p o ocol.
Magne ic Resonance
Imaging (MRI)
Non-in asi e echnique used disease de ec ion and ea men
moni o ing. MRI scanne s a e pa icula ly well sui ed o image he so
issues o he body e.g., b ain, spinal co d and ne es, muscles and
ligamen s.
Medical Imaging
In o ma ics
A discipline ha esul s om he combina ion o medical images and
biomedical in o ma ics. Se es o enhance he imp o emen and
knowledge o clinical ca e. On he one hand, Medical Imaging allows he
s udy o a disease s a e
in i o
. On he o he hand, biomedical
in o ma ics is in ol ed in he de elopmen o compu e science
echniques o c ea ing and managing medical da a.
Ni y
A simple, minimalis ic o ma which has been widely adop ed in
Neu oimaging esea ch, allowing scien is s o mix and ma ch image
p ocessing and analysis ools de eloped by di e en eams.
XNAT
An open sou ce imaging in o ma ics so wa e pla o m designed o
acili a e common managemen and handling o Neu oimaging and
associa ed da a.
INTRODUCTION
1
INTRODUCTION
INTRODUCTION
16
1.1
CONTEXT AND MOTIVATION
Medical in o ma ics is a ecen medical discipline when compa ing wi h o he medical disciplines ha
ha e been a ound o cen u ies [1]. Wi hin he pas decade socie ies in gene al, and medicine and
heal hca e in pa icula , ha e emendously changed, in la ge because o he apid dissemina ion o
compu e s and digi al communica ions [2]. This allowed new medical disciplines o appea , such as
Medical In o ma ics, which is he in e sec ion o compu e in o ma ics and heal hca e [3]. This new
discipline deals wi h he esou ces, de ices, and me hods equi ed o op imize he acquisi ion, s o age,
e ie al, and use o in o ma ion in heal hca e sys ems.
One o he mos p ominen ield in Medical In o ma ics is Medical Imaging, as i is implied, i is a collec ion
o me hodologies and echniques used in o de o isually and spa ially ep esen pa s o he human
body o diagnos ic and esea ch pu poses. This ield is so impo an nowadays ha i is ha d o imagine
a medical diagnos ic wi hou he use o imaging ools since hey allow doc o s o ha e a clea pic u e o
he p oblem. In esea ch, Medical Imaging has gained conside able a en ion due o i s widesp ead u ili y
in a mul i ude o clinical applica ions and he conside able imp o emen s in he echniques [4].
One o he mos p ominen ields in Medical Imaging is he ep esen a ion/s udy o he b ain, known as
Neu oimaging. This ield is a se o imaging echniques ha ei he di ec ly o indi ec ly image he s uc u e
o unc ion o he ne ous sys em, which includes he b ain [5]. Neu oimaging comp ises se e al di e en
modali ies such as Magne ic Resonance Imaging (MRI), Posi on Emission Tomog aphy (PET), Compu ed
Tomog aphy (CT) and unc ional MRI ( MRI) [6]. These echniques ha e majo clinical applica ions in
neu ology, se ing as a c ucial pa in diagnosis and, mo e ecen ly, in psychia y, wi h special ocus on
psychia ic diso de s by helping o unde s and he in e ac ions be ween he b ain and he body. All o
hese make Neu oimaging an inc easing popula ield o esea ch, especially in he las 20 yea s [7].
In conjunc ion wi h his, in he las ew yea s has been a g owing in e es in including Machine Lea ning
(ML) [8] and Deep Lea ning (DL) [9] in he analysis o Neu oimaging da a.
Machine Lea ning add esses he ques ion o how o make compu e s imp o e au oma ically hough
expe ience. I is one o mos apidly g owing echnical ields, joining a eas like compu e science, s a is ics
and da a science [10].
Deep Lea ning is one o he mos ecognized ML echniques, which allows compu a ional models
composed o mul iple laye s o lea n ep esen a ions o da a wi h mul iple le els o abs ac ion. These
me hods ha e d ama ically imp o ed ha d compu e p oblems like speech ecogni ion, isual objec

INTRODUCTION
17
ecogni ion and objec de ec ion. Deep Lea ning disco e s a s uc u e in la ge da a se s by using an
algo i hm o indica e how a machine should change i s in e nal pa ame e s, used o compu e he
ep esen a ion in each laye om he ep esen a ion in he p e ious laye [11].
A la ge numbe o s udies show ha ML and DL can be used o ex ac new exci ing in o ma ion om
Neu oimaging da a [12]. This ield o esea ch has e ealed i sel o be e y complex om he beginning
as i equi es analysis o complex and mul i a ia e da a [13]. Da a wi h bo h hese cha ac e is ics is
p ecisely wha leads o he de elopmen o compu e echniques such as ML and DL which allow o ain
classi ie s ha decode da a and ex ac he ele an in o ma ion. This would no be possible wi h he so-
called “ adi ional compu ing”, since he olumes o in o ma ion o decode a e ex emely la ge [13].
The ecen p og ess in ML has been d i en bo h by he de elopmen o new algo i hms and by he
a ailabili y o da a. Wi h his, esea che s ely mo e and mo e upon la ge da ase s ha some imes a e
no co ec ly labeled and a chi ed, which can esul in un eliable esul s. This is especially ue in
Neu oimaging since he da a is di icul o handle and is mos o he ime sliced in mul iple iles.
Fo all o hese easons, a esea ch pla o m o co ec ly s o e Medical Imaging da a plus all he associa ed
esea ch ma e ials is a c ucial pa o a la ge sough ecosys em whe e esea che s can exchange da a
and collabo a e in Neu oimaging esea ch p ojec s.
One o hese ecosys ems was de eloped h ough he collabo a ion be ween he Algo i mi Resea ch Cen e
and he Li e and Heal h Sciences Resea ch Ins i u e (ICVS), bo h a Uni e si y o Minho (UMinho) [14],
wi h he objec i e o map and sea ch o pa e ns on he human b ain (Fig 1.1).
Figu e 1.1 – UMinho Neu oimaging p ojec
This wo k has he pu pose o a chi ec a pla o m o a chi e Neu oimaging da a and build a p o o ype
wi h he planned a chi ec u e o be in eg a ed in he cu en sys em wo k low o he UMinho Neu oimaging
p ojec bu implemen ed in such a way ha i can easily be ans e ed o o he wo k low sys ems. The
de eloped pla o m has he objec i e o acili a e he dis ibu ion o Neu oimaging da a a ailable in bo h
INTRODUCTION
18
public da ase s and acqui ed locally a he ICVS MRI scanne . Wi h he wo k low used be o e, esea che s
mo ed Neu oimaging da a and he associa ed esea ch ma e ials ia ha d-d i es o pla o ms like
Redmine [15], which is no scalable as he da ase sizes inc ease.
The pla o ms ha handle Medical Imaging da a and in pa icula neu oimages ha e unique
cha ac e is ics, ha make i di e en om adi ional sha ing sys ems. Also, medical esea ch has igid
wo k lows ha can’ be changed easily. Commonly, pla o ms ha y o change hese wo k lows don’
succeed. The sys em o be buil mus seamlessly in eg a e in he ac ual wo k low, wi h only mino
adap a ions, bu also be in eg able in a global Neu oimaging da a sha ing ne wo k (Fig. 1.2).
Figu e 1.2 – Example o mul iple Medical Imaging pla o ms connec ed o sha e esea ch da a
O e he las yea s, ICVS and Algo i mi ha e been collabo a ing in s udies abou Neu oimaging and
nowadays all he ongoing esea ch in ol es a la ge numbe o dispe se esea che s, la ge da ase s and
di e en da a sou ces. Wi h his inc ease in popula i y, a new p oblem was encoun e ed. How o p ope ly
s o e, manage and make a ailable his da a and he esea ch ma e ials associa ed?
The me hods used un il now duplica e he space used and don’ ensu e p ope ly da a a chi ing, plus, as
esea ch inc easingly specializes in a na owe ange (Fig. 1.2) o applica ions i becomes ha de and
ha de o ob ain su icien da a i i is dispe sed ac oss esea che s and p ojec s.
INTRODUCTION
19
Figu e 1.3 - Compa ing scien i ic quali y e sus amoun o sha ed da a (image om [16])
Taking o example ano he esea ch ecosys em like he one a UMinho, he Cance Imaging A chi e [17]
has mo e han 25.000 pa ien s/subjec s, 73.000 s udies and 21 million images which ep esen s mo e
han 11 e aby es o da a, all a ailable o esea che s. Any esea che can easily selec da a om he
global da ase wi h he equi ed cha ac e is ics and use he da a wi hou he need o make a new
acquisi ion.
1.2
OBJECTIVES
The main objec i e o his wo k is o a chi ec u e an imaging-based esea ch pla o m o he
implemen a ion o expe imen s wi h Medical Imaging da a and associa ed esea ch ma e ials, wi h a
pa icula ocus on Neu oimaging. Also, as his ype o pla o m in ol es mul iple i e a ions, a p o o ype
o he wo k will be a ailable in ICVS and Algo i mi o manage all he Neu oimaging da a used he e.
Fu he mo e, as esea che s need a simple way o p og amma ically in e ac wi h he pla o m, he e is
also he de elopmen o bo h APIs and lib a ies o he in e ac ion wi h he de eloped pla o m.
1.3
DISSERTATION STRUCTURE
The wo ocuses o his wo k a e he XNAT@DI pla o m and he XNATUM package. The disse a ion is
s uc u ed as ollows. Sec ion 2 e iews published sys ems in he ield and discusses he addi ional
INTRODUCTION
20
equi emen s ha ha e mo i a ed he de elopmen o he XNAT@DI p ojec . Sec ion 3 is an o e iew o
he sys em’s ea u es, echnologies and he o e all a chi ec u e o he pla o m. Sec ion 4 p esen s
implemen a ion de ails o he pla o m. Sec ion 5 p esen s an o e iew and he implemen a ion o he
XNATUM package, including desc ip ions o ea u es, pe o mance and es ing. Finally, Sec ion 6 p esen s
conclusions and u u e wo k.
STATE OF THE ART
27
• Wo k as a ede a ed pla o m whe e p ojec owne s e ain au onomous con ol o e hei da a
and de ine p ojec -speci ic p ocedu es, bu also allow o ha e global p ojec s, which can be used
by any esea che ;
• Ha e he possibili y o connec op ional ga eways se e s wi hin each clinical ins i u ion;
• Includes ea u es like DICOM di ec upload, REST API o upload and download da a, quali y
con ol modules, web-based in e ace, powe ul and sophis ica ed sea ch, online image iewe
and a pipeline engine o au oma ing image p ocessing asks.

PLATFORM DESIGN AND ARCHITECTURE
3
PLATFORM DESIGN AND
ARCHITECTURE
29
The sys em o be concei ed, mus be a secu e da a pla o m ha simpli ies and au oma es he p ocess
o accessing and sha ing esea ch ma e ials o Medical Imaging wi h gene al applicabili y which can be
adap ed o bene i esea ch p ojec s ac oss a a ie y o ields a any esea ch acili y.
The main goal o he esea ch pla o m is o p o ide a lexible, clinical and esea che - iendly sys em o
sha ing Medical Imaging da a and esea ch ma e ials ac oss mul iple depa men s and esea ch cen e s.
The sys em aims o sa is y he demands o pa ien con iden iali y, da a secu i y and o b ing he bene i s
om a web pla o m o imaging esea ch; wi h he goal o encou aging mo e da a sha ing, bo h
s anda dizing and simpli ying he da a ans e and anonymiza ion p ocesses, and he p o iding o
cen alized s o age and backups which simpli y he sha ing o esea che -de i ed esul s. The pla o m
will achie e all o hese aims by building upon exis ing and well-es ablished echnologies, accessible and
usable o di e en ypes o use s, and wi h an ease-o -use app op ia e o hose ha a e mo e o less
amilia ized wi h his kind o da a and echnology.
3.1
PURPOSED SOLUTION
A gene al sys em diag am o he pla o m is shown in Fig.3.1. The pla o m consis s o a cen al se e
and op ional ga eway se e s o clinical ins i u ions and esea ch depa men s. The e o e, he al eady
exis ing echnologies used mus be c oss-pla o m compa ible, o e ing complexi y wi h ega d o he
equi ed ha dwa e and ope a ing sys em. The se ice mus p o ide a da a upload ea u e wi h au oma ed
anonymiza ion o pa ien in o ma ion and which in eg a es wi h so wa e al eady in use a he esea ch
labs like Ho os [40] o Osi iX [41].
30
Figu e 3.1 - Pla o m concep ual a chi ec u e
31
3.2
PLATFORM ARCHITECTURE
3.2.1
OVERVIEW
In consequence o he necessi y o esea ch cen e s o manage da a he e a e a lo o di e en da a
managemen sys ems o acili a e collabo a i e esea ch and da a sha ing in Neu oimaging such as Li y
[42], Cap e a [43], No a [44] and XNAT [45].
The anonymized esea ch and associa ed esea ch ma e ials will be hos ed on a dedica ed ins ance, wi h
his, use s can access and download da a wi hin he secu e websi e om a web in e ace access o any
b owse . The pla o m (Fig. 3.2) may also p o ide a se o p o ocols and se ices o be accessed
p og amma ically, o allow in eg a ion wi h hi d-pa y so wa e and ools, in a o m o a Rep esen a ional
S a e T ans e Applica ion P og amming In e ace (REST API).
Figu e 3.2 – Pla o m concep ual a chi ec u e ne wo k.
3.2.2
INTEGRATION WITH OTHER INSTANCES AND HOSPITAL SYSTEMS
The pla o m mus allow he connec ion o op ional ga eways o enable each ins i u ion and esea ch
depa men o p o ide image uploading mechanisms sui ed o hei needs. Each in e es ed ins i u ion can
p o ide a ga eway om hei in as uc u e o o he s. The e a e wo main ways his is done wi h he
32
cu en s anda ds: syncing p ojec s be ween ins ances, o sha ing aw imaging da a. The i s me hod
es ablishes a pe sis en da a sync o all o selec ed da a be ween ins ances, which allows he esea che
o upload he da a jus once and gua an ee ha he da a is au oma ically uploaded o he o he ins ances.
The second me hod allows, o example, o mo e la ge amoun s o DICOM da a om hospi al acili ies
and esea ch cen e s.
3.2.3
DATA SECURITY AND ACCESS CONTROL
All he da a s o ed on he pla o m o be buil is anonymized and no iden i iable. All da a exchange will
happen o e he In e ne in an enc yp ed connec ion wi h he se e ce i ica e ensu ing clien s can only
connec o he genuine se e . The se e i ewalls es ic access only o us ed clien s and limi he
maximum a emp s o ailed connec ions, blocking consecu i e ailed connec ions.
All da a access equi es a pe sonal accoun . A use can eques a use accoun o he p ima y In es iga o
o o a pla o m adminis a o .
3.2.4
WORKFLOW
The da ase s a e ei he coming om a esea che o di ec ly om a hospi al wi h an MRI machine. The e
a e wo main ways da a can be uploaded o he pla o m, ia REST API o ia he web in e ace. When
uploading da a, he mos s aigh o wa d p ocess is i s o upload all p ojec me ada a and hen he
associa ed subjec s and complemen a y in o ma ion which can be bo h made ia REST API o ia CSV
upload on he web in e ace. Then he anonymized sessions can be uploaded o hei co esponden
p ojec and subjec o o he p e-a chi e o be analyzed by a p ojec esea che be o e inclusion in he
co esponding p ojec .
Resea che s e ie e he anonymized da a using in eg a ed so wa e o simply by downloading needed
da a ia he web in e ace.

33
3.3
TECHNOLOGIES AND CONCEPTS
In his chap e a e desc ibed some o he echnologies ha will be used o build he pla o m as well as
well as a jus i ica ion in why a pa icula echnology was chosen in a o o o he s. The gene al p e e ence
was o use al eady well es ablished open-sou ce echnologies exis en in he ma ke o many yea s and
which ha e p o en hei wo h in he esea ch a ea.
3.3.1
VIRTUALIZATION SOFTWARE
The chosen i ualiza ion so wa e was Docke , a p og am c ea ed o isola e p ocesses om he sys em
on which i is unning. I was c ea ed o isola e an applica ion and he esou ces equi ed o un ha
applica ion om he ha dwa e on which i uns. Docke uses p e-buil Linux Con aine s (LXC) which a e
an ope a ing sys em le el i ualiza ion buil -in di ec ly on he Linux ke nel, wi hou he o e head o a ull-
ledged VM. XNAT applica ion depends in a ew di e en and dis inc applica ions which can cause
di e en ypes o e o s. Docke sol es his p oblem ia con aine iza ion, ensu ing compa ibili y ac oss
pla o ms and, he e o e, elimina ing "wo ks on my machine" issues in esea ch and so wa e de eloping.
Despi e appea ances, he mos common Docke con aine s a e no VMs. They ha e a key di e ence,
while VMs don' sha e he same Linux ke nel, in he Docke con aine s he con a y happens. Docke
con aine s sha e he same Linux ke nel wi h he ha dwa e hey a e unning, esul ing on much less boo
ime and esou ce usage han VM’s. This has made Docke pa icula ly a ac i e o indus y and has hus
seen a s eep ise in adop ion o he echnology. Docke will be used o con aine ize he pla o m on he
se e as well as simpli y and gua an ee he consis ency o he ins alla ion and se up o he sys em, since
some o he used hi d-pa y so wa e used is only a ailable o Linux-based sys ems.
Docke was chosen because i sa is ies he p ac ical equi emen s, and he accessibili y o Docke Hub
enables images o be quickly ound and deployed. “Vi ual machines like hose c ea ed in Vi ual Box [46]
o VMwa e [47] p o ide lo s o ange in e ms o ope a ing sys ems ha can be launched and allow na i e
access o he machine h ough a GUI. Howe e , hough hese a e g ea ea u es, hey a e no necessa y
o he pla o m.” [48]
34
Figu e 3.3 - Docke engine laye s (image om [49])
3.3.1.1
DOCKER MANAGING ENVIRONMENTS
The Docke API allows a lack o op ions o in e acing wi h Docke , he con aine s, and images om CLIs
o desk op applica ions and web-based managemen ools. These ools go om Ki ema ic [50], he de aul
GUI p og am ha ships wi h Docke o Shipya d [51], a web-based app ha p o ides an in e ace o
con aine s. Al hough, he chosen ool was Po aine [52] a UI managemen so wa e which allows o
manage Docke en i onmen s and simply deploy any docke con aine o un on he Docke engine. All
Docke esou ces, including con aine s, images, olumes and ne wo ks can be managed ia Po aine
[52]. This solu ion was chosen since i is web-based, which means ha can be accessible in any b owse
wi hou he need o ins all o he hi d-pa y so wa e, is ee and open-sou ce.
35
Figu e 3.4 - The in e ace o Po aine , he Docke managemen ool
3.3.2
DATA REPOSITORY MANAGEMENT SYSTEM
The chosen Da a Reposi o y Managemen Sys em was he eX ensible Neu oimaging A chi e Toolki
(XNAT) [45], one o he oldes and mo e s able open-sou ce da a eposi o ies a ailable. I is de eloped by
he Neu oin o ma ics Resea ch G oup wi h he pu pose o add essing and acili a ing da a managemen
challenges in Neu oimaging s udies. I consis s o an image eposi o y o s o e aw and pos -p ocessed
images, a da abase o s o e me ada a and non-imaging measu es and use in e ace ools o accessing,
sea ching and explo ing he da a. Use in e ace ools include a secu e web applica ion, command line
ools and desk op applica ions o o ganizing and uploading local da a. I suppo s ull DICOM wo k low
o all common imaging modali ies and an ex ensible sys em o modeling and s o ing clinical, beha io al,
and o he non-imaging da a. XNAT has au oma ed ools o cap u e da a om mul iple sou ces and keeps
hem in a secu e eposi o y and dis ibu es he da a o au ho ized use s. XNAT elies hea ily on XML and
XML Schema [53]. XNAT uses XML Schema De ini ion (XSD) o de ine da a ypes and o gene a e cus om
componen s, g aphical and local con en o i s P esen a ion, Applica ion and Da a ie s. Also, XML is
used o secu i y, inpu alida ion and que ies. The e o e, XNAT p o ides an ad hoc wo k low o
36
Neu oimaging da a acquisi ion and sani izing, ha consis s o au oma ed da a acquisi ion di ec ly in he
scanne and/o ia upload ollowed by a s ic quali y con ol p ocedu e, whe e we can include da a
anonymiza ion. Howe e , XNAT also has some p oblems like ine icien me ada a s o age. The XNAT da a-
model can be esumed in h ee main da a ypes: Expe imen s, Subjec s and P ojec s. Imaging da a om
he scanne s en e he wo k low using mechanisms like he Digi al Imaging and Communica ions in
Medicine (DICOM), Secu e File T ans e P o ocol (SFTP), o po able ha d media. Non-imaging da a such
as clinical assessmen s, subjec demog aphics and gene ic measu es a e passed ia web-based o ms,
cs uploads o XML (eX ensible Ma kup Language) [54]. XNAT is used by ins i u ions and da a sha ing
p ojec s a ound he wo ld including he Biomedical In o ma ics Resea ch Ne wo k (BIRN), he Na ional
Alliance o Medical Imaging Compu ing (NA-MIC) and he In o ma ics o In eg a ing Biology & he
Bedside (I2B2) [55].
Figu e 3.5 - XNAT a chi ec u e [56]
A da a model is an abs ac model ha o ganizes ce ain elemen s and s anda dizes how hey can ela e
o each o he . I explici ly de e mines he s uc u e o da a and o ha eason i is some imes e e ed o
as a da a s uc u e. XNAT se e is a pla o m buil o imaging esea ch pu poses, his unc ions can
BUILDING THE RESEARCH PLATFORM – XNAT@DI
43
Pe o mance
The main poin s ela ed wi h pe o mance ake in o accoun ha he wo mos common ac ions a e da a
upload and da a download. These wo ac ions can ha e a huge impac on he se e since i is necessa y
a pe sis en connec ion. XNAT@DI p io i izes low impac on ne wo k o e speed and la ency. As he se e
is on
edu oam
(Educa ion Roaming) ne wo k da a upload is bandwid h limi ed.
Faul Tole ance
To p e en da a loss, iles physically s o ed on he se e a e egula ly backed up o seconda y disks. I
he se e connec ion is no a ailable o da a upload ails, uploading is e-a emp ed mul iple imes wi h
an exponen ially inc easing delay [59].
Taking in o accoun all o hese discussed opics and wha was discussed p e iously, he se e
con igu a ion whe e he pla o m is hos ed has:
• OS: Ubun u 14.04 LTS (64 bi ) as he ope a i e sys em
• CPU: In el Xeon E5-1650
• RAM: 64Gb
• Seconda y Memo y: 2 Disks o 2TB and 1 disk o 512Gb
• GPU: NVIDIA P6000
o Cuda Pa allel-P ocessing Colo s 3840
o GPU 24 GB GDDR5X
o FP32 Pe o mance 12 TFLOPS
4.2
SHARING DATA BETWEEN INSTANCES
Sha ing da a be ween ins ances is c i ical in his kind o pla o m. I ’s e y common o ha e mul iple
depa men s o wo k on mul iple p ojec s ha can some imes sha e da a be ween hem. In XNAT he e
a e wo main ways o connec wo ins ances: using he XNAT P ojec Sync plugin o he Join
Anonymiza ion and A chi e T ansmission (JAAT).
The XNAT P ojec Sync plugin is mo e sui able o sha e da a be ween esea ch ins i u ions. This me hod
es ablishes a pe sis en da a sync o all o selec ed da a be ween XNAT ins ances, which allows he da a-

BUILDING THE RESEARCH PLATFORM – XNAT@DI
44
owning esea che o upload he da a jus once and gua an ees ha he da a is au oma ically uploaded
o he o he ins ances.
The JAAT me hod was de eloped o allow he mig a ion o la ge amoun s o DICOM da a. This me hod is
highly sui able o la ge amoun s o da a. Fo example, o ans e sessions be ween he hospi al whe e
he MRI machine is and he XNAT se e .
Figu e 4.2 - XNAT JAAT me hod explained
4.3
CONTAINERIZATION AND PLATFORM DEPLOY
As men ioned on he p e ious chap e s all se ices unning on he se e a e on op o Docke con aine s.
A Docke con aine is a p ocess/se ice ha uns di ec ly on he se e , sligh ly di e en han a egula
p ocess because he Docke daemon along wi h he Linux ke nel ensu es i uns in o al isola ion, which
allows o ha e mul iple se ices unning a he same ime on a single compu e , wi hou in e e ing wi ch
BUILDING THE RESEARCH PLATFORM – XNAT@DI
45
each o he [59]. The e we e al eady mul iple con aine s deployed on he se e , all managed wi h
Po aine [52]. XNAT would be only “one mo e se ice unning”, al hough o un i wi h he needed
ea u es (specially edundancy and scalabili y) some changes had o be made. As discussed on he
p e ious chap e s i is necessa y o un mul iple se ices a he same ime, including Tomca , Pos g es,
NGINX and, obli iously, he main XNAT con aine . To do his, we need a way o manage and deploy a
he same ime all hese con aine s. This can be made wi h Docke Compose [60], which allows o manage
hese ice e sions, he connec ions be ween con aine s, and e en which po s o expose in each
con aine . Compose is a ool buil -in di ec ly on he Docke engine o de ine and un mul iple-con aine
en i onmen s in a single ne wo k. To use he ool, an YAML [61] ile wi h he con aine s and se ices
speci ica ion was c ea ed. The YAML ile below boo s aps he deploymen o h ee con aine s:
BUILDING THE RESEARCH PLATFORM – XNAT@DI
46
1. e sion: '1'
2. se ices:
3. xna -web:
4. build:
5. con ex : ./xna
6. a gs:
7. XNAT_VER: '1.7.4.1'
8. SMTP_ENABLED: ' alse'
9. SMTP_HOSTNAME: ake. ake
10. SMTP_PORT:
11. AMTP_AUTH:
12. SMTP_USERNAME:
13. SMTP_PASSWORD:
14. XNAT_DATASOURCE_DRIVER: 'o g.pos g esql.D i e '
15. XNAT_DATASOURCE_URL: 'jdbc:pos g esql://xna -db/xna '
16. XNAT_DATASOURCE_USERNAME: 'xna '
17. XNAT_DATASOURCE_PASSWORD: 'xna '
18. XNAT_HIBERNATE_DIALECT: 'o g.hibe na e.dialec .Pos g eSQL9Dialec '
19. TOMCAT_XNAT_FOLDER: XNAT@DI
20. XNAT_ROOT: /da a/xna
21. XNAT_HOME: /da a/xna /home
22. po s:
23. - "8081:8080"
24. - "8000:8000"
25. - "8104:8104"
26. expose:
27. - "8080"
28. - "8104"
29. olumes:
30. - ./xna -da a/home/logs:/da a/xna /home/logs
31. - ./xna -da a/home/plugins:/da a/xna /home/plugins
32. - ./xna -da a/a chi e:/da a/xna /a chi e
33. - ./xna -da a/cache:/da a/xna /cache
34. - ./xna -da a/p ea chi e:/da a/xna /p ea chi e
35. - ./xna -da a/ p:/da a/xna / p
36. - ./xna -da a/build:/da a/xna /build
37. - ./xna -da a/pipeline:/da a/xna /pipeline
38. - / a / un/docke .sock:/ a / un/docke .sock
39. depends_on:
40. - xna -db
41. en i onmen :
42. - CATALINA_OPTS=-Xms128m -Xmx1024m -Dxna .home=/da a/xna /home -
agen lib:jdwp= anspo =d _socke ,se e =y,suspend=n,add ess=8000
43. - XNAT_HOME=/da a/xna /home
44.
45. xna -db:
46. build: ./pos g es
47. expose:
48. - "5432"
49. olumes:
50. - ./pos g es-da a:/ a /lib/pos g esql/da a
51.
52. xna -nginx:
53. build: ./nginx
54. po s:
55. - "80:80"
56. expose:
57. - "80"
58. links:
59. - xna -web
P og am 4.1 - Docke Compose con igu a ion ile
BUILDING THE RESEARCH PLATFORM – XNAT@DI
47
Tomca + XNAT
This con aine uses Tomca and XNAT web applica ion. Tomca is an open sou ce implemen a ion o he
Ja a Se le , Ja aSe e Pages, Ja a Exp ession Language and Ja a WebSocke echnologies [62] and is
used as p oxy o he XNAT con aine . The deploymen o hese applica ions also includes se ing sys em
esou ces and se ing he se ice use and pe missions so ha he Tomca p ocess can ead and w i e
om he XNAT a chi e and wo king olde s. As men ioned be o e, he se e has a main disk, which is a
Solid-S a e Disk, and addi ional Ha d Disk D i es (HDD). Taking in conside a ion ha :
1. SSDs a e much as e on ead and w i e ope a ions bu HDDs a e cheape ;
2. The applica ion iles a e accessed much mo e han he Medical Imaging iles.
All he ope a i e sys ems (OS) and Docke con aine s un on op o he SSD, bu iles a e s o ed in he
HDDs disks. This ensu es ha he pla o m is as , and he s o age is cheap o main ain. To do his some
symbolic links om inside he con aine o he HDD we e c ea ed:
This ensu es ha he XNAT con aine w i es all da a on he seconda y disks, bu all he necessa y olde s
emain in he con aine . The HDD disks con aining he olde s a e backed up o o he HDD disks a ached
o he se e . Also, as discussed on he p e ious chap e s, i was necessa y o c ea e a DICOM SCP
1. - ./xna -da a/home/logs:/da a/xna /home/logs
2. - ./xna -da a/home/plugins:/da a/xna /home/plugins
3. - ./xna -da a/a chi e:/da a/xna /a chi e
4. - ./xna -da a/cache:/da a/xna /cache
5. - ./xna -da a/p ea chi e:/da a/xna /p ea chi e
6. - ./xna -da a/ p:/da a/xna / p
7. - ./xna -da a/build:/da a/xna /build
8. - ./xna -da a/pipeline:/da a/xna /pipeline
9. - / a / un/docke .sock:/ a / un/docke .sock
P og am 4.2 - The symbolic links c ea ed
1. po s:
2. - "8081:8080"
3. - "8000:8000"
4. - "8104:8104"
5. expose:
6. - "8080"
7. - "8104"
P og am 4.4 - The exposed po s P og am 4.3 - The exposed po s on he XNAT con aine
BUILDING THE RESEARCH PLATFORM – XNAT@DI
48
ecei e [63]. Fo his, i was necessa y o expose a new po in which he ecei e will ge all he Medical
Imaging da a.
Pos g eSQL
Pos g eSQL [57] is an open-sou ce objec - ela ional da abase sys em ha ex ends he SQL language
combining ea u es o sa ely s o e and scale da a. Pos g eSQL has ea ned a s ong epu a ion o i s
a chi ec u e, eliabili y, da a in eg i y, obus ea u e se , ex ensibili y and he consis en ly inno a i e
solu ions. Some o he highligh s a e cus om da a ypes, da a in eg i y, scalabili y, concu ency,
pe o mance, secu i y and ex ensibili y. XNAT uses he Pos g eSQL da abase o s o e all o i s pe sis en
da a ha 's no s o ed in iles on he local s o age de ice like subjec in o ma ion o use accoun s.
NGINX
NGINX is a web se e ha uses a non- h eaded, e en -d i en a chi ec u e. I also does o he impo an
hings, like load balancing, HTTP caching o e e se p oxying. A NGINX p oxy con igu a ion equi es a
se e block which con igu es connec ions, and a loca ion block, which poin s o he speci ic Tomca
ins ance wan ed o he web o connec o. The ollowing con igu a ion se s up a lis ene on po 80 (h p).
This is hen associa ed wi h he Tomca unning on po 8080.
Finally, when s a ing o un he mul i-con aine en i onmen wi h
docke -compose up
, se e al di ec o ies
a e c ea ed o sa e he pe sis en da a:
• pos g es-da a - con ains he XNAT da abase;
• xna -da a/a chi e - con ains he XNAT a chi e;
• xna -da a/build - con ains he XNAT build space;
• xna -da a/home/logs - con ains he XNAT logs;
• xna -da a/home/plugins - Ini ially con ains no hing. Se es o cus omize XNAT wi h plugins.
1. po s:
2. - "80:80"
3. expose:
4. - "80"
P og am 4.5 - The exposed po s on he Nginx con aine

BUILDING THE RESEARCH PLATFORM – XNAT@DI
49
4.4
XNAT CONFIGURATIONS
A e building and ins alling he XNAT mul i-con aine en i onmen some cus omiza ions had o be made
di ec ly on he adminis a ion XNAT web in e ace. These changes include:
• Add he DICOM S o e Se ice P o ide – Regis e a new DICOM S o e Se ice P o ide o
XNAT con igu a ions on he p e ious exposed po (8104).
• Change he Session Idle Check In e al o check e e y 10 minu es - This con ols how
o en he sys em checks o see i he e a e incoming DICOM sessions in he p e-a chi e. This
alue is speci ied in milliseconds.
• Enable Si e-wide Anonymiza ion sc ip – An au o anonymiza ion sc ip was added based
on wha is in use a Washing on Uni e si y School o Medicine and Howa d Hughes Medical
Ins i u e.
BUILDING THE RESEARCH PLATFORM – XNAT@DI
50
4.5
XNAT PLUGINS AND PIPELINES
XNAT pla o m has he abili y o use hi d-pa ies se ices o add cus om unc ionali ies o modules. This
is done ei he h ough pipelines which can be au oma ically se o un when, o example, new da a is
uploaded o h ough plugins which add ex a unc ionali ies (gene ally use -in oked). Building he plugins
and pipelines equi es unning a
g adlew
[64] sc ip inside he Docke con aine in which all he compiled
classes and s a ic con en is buil in o a single ou pu ile loca ed in he
build/libs
olde .
A e building he plugin o pipeline, deploying i can be done in h ee s eps:
1. S op Tomca con aine ;
2. Copy JAR ile and build o plugins olde in XNAT iles sys em;
3. S a Tomca con aine again.
Some o he ins alled plugins and pipelines a e:
• Clinical Da a Types [65] - A collec ion o addi ional ypical clinical da a ypes;
• IQ Assessmen [66] – A new IQ da a ype;
• Radiological Assessmen [66] – A new Radiological da a ype, which includes edi and epo
pages;
• m ic on [67] - DICOM and PARREC la o ed pipelines o au o imaging da a con e sion o NIFTI
o ma ;
• Quali y Assessmen P o ocol [68] - QA analysis on unc ional/s uc u al MRI da a;
• m ic ogl [69] - New gene a ion o DICOM- o-NIFTI o ma con e sion pipeline (using dcm2niix);
• DTI-p ep ocessing [70] - Compu e p ep ocessing co ec ions on MRI DTI scans;
• MRI bias ield co ec ion [71] - Co ec ing in ensi y non-uni o mi y (i.e. bias ields);
• MRI ana omical de ace [72] - Au oma ed acial ai s emo al (de acing) o ana omical scan
da a;
• Image Viewe [73]– Neu oimage iewing module buil wi h XTK [74] and Google Closu e [75]
(Fig. 4.3).
BUILDING THE RESEARCH PLATFORM – XNAT@DI
51
Figu e 4.3 - Image Viewe buil -in he XNAT@DI pla o m
4.6
ORGANIZING AND UPLOADING EXISTING DATA
One o he p e-de ined equi emen s was ha exis en da a mus be uploaded o he pla o m. As esea ch
and da a collec ing had al eady been occu ing o many yea s a ICVS and Algo i mi, he e was he need
o ind a way o co ec ly make his da a a ailable h ough XNAT@DI.
The way esea che s ypically sha e da a be o e he he e-desc ibed pla o m was a ailable in ol ed ha ing
an CSV ile wi h subjec in o ma ion like age, gende and hen o ganize he scans in olde s wi h he
co esponden subjec ID. Thus, om his we concluded ha o upload his da a o XNAT@DI, he wo k low
would ha e o ha e wo s eps:
1. Upload subjec da a o he pla o m om he CSV ile;
2. Upload and labeling all he sessions scans and images.
Howe e , some o his CSV iles a e cus om o each p ojec since hey ha e cus om a iables o en imes
ela ed wi h he esea ch ield o he p ojec and no included on he XNAT gene ic ypes. Hence, o each
p ojec , a cus om a iable se wi h speci ic da a ypes was c ea ed. To include new a iables, an XML ile
has o be modi ied wi h he speci ic p ojec con igu a ion.
BUILDING THE RESEARCH PLATFORM – XNAT@DI
52
A e his, he CSV could be uploaded hough he pla o m buil -in uploade . A e c ea ing he subjec s,
all he session scans need o be uploaded o he speci ic subjec . This was done h ough a Py hon sc ip
ha maps all he CSV con en and uploads he co esponding images wi h he co ec label ha iden i ies
he scan.
1. <FieldMapping da a- ype="xna :subjec Da a" c ea e-
da e="Tue Jan 05 03:35:32 PDT 2019" i le="B ainConnec " ID="1294343251432">
2. < ield>xna :subjec Da a/ID</ ield>
3. < ield>xna :subjec Da a/ a he Age</ ield>
4. < ield>xna :subjec Da a/mo he Age</ ield>
5. </FieldMapping>
P og am 4.6 - New ields added o he XML p ojec subjec s con igu a ion ile
1. wi h open('da a.cs ', ' ') as _ ilehandle :
2. cs _ ile_ eade = cs .Dic Reade (_ ilehandle )
3. o ow in cs _ ile_ eade :
4. subjec = ow['Codigo_SW']
5. p in subjec
6. expe imen = subjec + "_CORRELATION"
7. scan = "1"
8. ilepa h = "/AllDa a/" +
9. subjec +
10. "_ nc_ ol_s ime_mc _be _mni_co eg_denoised_wSc ubbing.nii.gz"
11. ile = p ojec .subjec (subjec ).expe imen (expe imen ).scan(
12. scan). esou ce("CORRELATION"). ile(os.pa h.basename( ilepa h))
13. p in ile
14. i no ( ile.exis s()) and os.pa h.is ile( ilepa h):
15. ile.pu ( ilepa h, o ma =" ", con en =" ", ags=" ")
16. p ojec .subjec (subjec ).expe imen (
17. expe imen ).scan(scan).a s.se (" ype", "CORRELATION")
P og am 4.7 - Py hon sc ip o upload all sessions o XNAT@DI
XNATUM – A PYTHON API FOR XNAT
59
Figu e 5.5 - XNAT REST model
Fo example, wi h he REST API i is possible o look o all emale subjec s ha a e 23 yea s o age wi hin
a p ojec o ha e a speci ic answe o an assessmen . Using a me ge o he XNATPy package, which
implies a lo o knowledge in Py hon and APIs o use, wi h he Py hon eques module, XNATUM is able
o e ie e all he assessmen s om a subjec in a single s a emen whe eas he REST API om XNAT
would equi e mul iple HTTP calls.
XNATUM uses Py hon classes o c ea e an ini ial se e con igu a ion, which pe sis s o be used in mul iple
se e ope a ions. The connec ion holds he login in o ma ion, he se e in o ma ion and a session. I
will also send a ping e e y 14 minu es o keep he connec ion ali e, e en i no ope a ion is being execu ed.
XNATUM also allows sel -closing sessions ha can also be used using he Py hon con ex ope a o , o
emo e he possibili y o un o eseen e o s. As soon as he session doesn’ exis anymo e, o example
because an e o /excep ion was h own away, he session is au oma ically disconnec ed.
1. impo xna um
2.
3. session = xna .connec ('h p://mi box.di.uminho.p /XNAT@DI/', use ='xna um', pass
wo d='sec e ')
P og am 5.1 - Example o c ea ing a connec ion o a XNAT ins ance

XNATUM – A PYTHON API FOR XNAT
60
When a session is es ablished and main ained wi hin he scope, i is ai ly easy o explo e he da a on he
XNAT se e . The da a s uc u e o XNAT is mimicked as Py hon objec s. The connec ion gi es access o
a lis ing o all p ojec s, subjec s, and expe imen s on he se e . All le els on he XNAT se e : p ojec s,
subjec s, expe imen s, scans, esou ces, iles can be b owsed.
Al hough, he e a e si ua ions on which he e is he need o looping o e da a. To do his, XNATLis ing
objec s can be used as Py hon dic iona ies.
I he e is he need o download da a, his can be done using a helpe unc ion o ei he download i o a
a ge di ec o y o o he cu en di ec o y. This will c ea e a da a s uc u e simila o ha o XNAT on he
local disk.
To add new da a in o he XNAT se e , i is possible using he XNAT REST impo se ice wi h an HTTP
POST eques . I allows he upload o a zip ile con aining new expe imen s and XNAT will au oma ically
s o e i in he co ec place. Al hough, i is dange ous o add da a s aigh in o he a chi e due o he lack
1. impo xna um
2.
3. wi h xna .connec ('h p://my.xna .se e ') as session:
4. p in (session.p ojec s)
P og am 5.2 - C ea ing a connec ion o a XNAT ins ance using he Py hon con ex ope a o
1. p ojec = sel .session.p ojec s[lp ojec ]
2.
3. o subjec in p ojec .subjec s. alues():
4. o expe imen in subjec .expe imen s. alues():
5. allexpe imen s.append(expe imen )
6. e u n allexpe imen s
1. y:
2. sel .__p ea c_session = sel .session.se ices.impo _(
3. zip name,
4. o e w i e="append",
5. p ojec =p ojec ,
6. subjec =subjec ,
7. expe imen =subjec + "_" + session,
8. des ina ion=des ina ion,
9. igge _pipelines=False,
10. )
11. excep :
12. p in ("Unexpec ed e o du ing XNAT impo :")
13. p in (sys.exc_in o())
P og am 5.4 - XNATUM session upload unc ion
P og am 5.3 - Ge ing all expe imen s o a XNAT p ojec
XNATUM – A PYTHON API FOR XNAT
61
o e iewing. So, he sugges ed wo k low o he XNAT@DI pla o m is o use he des ina ion a gumen as
‘p ea chi e’ in he unc ion o send sessions o he se e . This will make he sessions being uploaded o
he p ojec , bu also makes he p e-a chi e be e iewed by he p ima y esea che be o e being a ailable
o esea ch pu poses.
5.3
USE-CASE EXAMPLES
XNATUM is a powe ul ye easy o use Py hon package. As he ini ial goal was o c ea e a new package
in which esea che s could ely one, e en hose no amilia wi h Py hon p og amming. Fo his eason,
some wo king examples we e c ea ed o se e as he en y poin o use he package.
Download p ojec sessions
This example uses he
download_p ojec _sessions
unc ion o download all images wi hin a p ojec o he
di ec o y whe e he Py hon sc ip is being execu ed.
Download p ojec sessions o di ec o y
This example uses he
download_p ojec _sessions_ o_di ec o y
unc ion o download all images wi hin
a p ojec o he di pa h a gumen olde . I he olde does no exis XNATUM c ea es he olde .
Download subjec sessions
This example uses he
download_subjec _sessions
unc ion o download all images wi hin a p ojec om
a speci ic subjec o he di ec o y whe e he Py hon sc ip is being execu ed.
1. xna = Xna (a gs.se e , a gs.use name, a gs.passwo d)
2. xna _sessions = xna .download_p ojec _sessions(a gs.p ojec )
P og am 5.5 - Download p ojec sessions h ough XNATUM
1. xna = Xna (a gs.se e , a gs.use name, a gs.passwo d)
2. xna _sessions = xna .download_p ojec _sessions_ o_di ec o y(a gs.p ojec , di pa h
)
P og am 5.6 - Download p ojec sessions o di ec o y h ough XNATUM
XNATUM – A PYTHON API FOR XNAT
62
Download subjec sessions o di ec o y
This example uses he
download_subjec _sessions_ o_di ec o y
unc ion o download all images wi hin
a p ojec om a speci ic subjec o he di pa h a gumen olde . I he olde does no exis XNATUM
c ea es he olde .
Download speci ic subjec session o di ec o y
This example uses he
download_single_subjec _session_ o_di ec o y
unc ion o download all images
wi hin a p ojec o he di pa h a gumen olde . I he olde does no exis XNATUM c ea es he olde .
Ge lis o subjec s
This example uses he
ge _lis _subjec s
unc ion o lis o subjec ha exis on a p ojec .
Ge p ojec sessions
1. xna = Xna (a gs.se e , a gs.use name, a gs.passwo d)
2. xna _sessions = xna .download_subjec _sessions(a gs.p ojec , a gs.subjec )
P og am 5.7 - Download subjec sessions h ough XNATUM
1. xna = Xna (a gs.se e , a gs.use name, a gs.passwo d)
2. xna _sessions = xna .download_subjec _sessions_ o_di ec o y(a gs.p ojec , a gs.su
bjec , di pa h)
P og am 5.8 - Download subjec sessions o di ec o y h ough XNATUM
1. xna = Xna (a gs.se e , a gs.use name, a gs.passwo d)
2. xna _sessions = xna .download_single_subjec _session_ o_di ec o y(a gs.p ojec , a
gs.subjec , a gs.session', di pa h)
P og am 5.9 - Download speci ic subjec session o di ec o y h ough XNATUM
1. xna = Xna (a gs.se e , a gs.use name, a gs.passwo d)
2. p in (xna .ge _lis _subjec s(a gs.p ojec ))
P og am 5.10 - Lis all p ojec subjec s h ough XNATUM
XNATUM – A PYTHON API FOR XNAT
63
This example uses he
ge _p ojec _sessions
unc ion o lis all sessions labels wi hin a p ojec , iden i ying
he co esponden subjec .
Ge subjec in o
This example uses he
ge _subjec _in o
unc ion o ge all subjec me ada a wi hin a p ojec .
All he examples desc ibed he e, and mo e a e a ailable in he XNATUM Gi Hub eposi o y
3
.
Upload session
This example uses he
impo _ esou ce
unc ion o upload a session o a p ojec om a subjec . I s a s
o c ea e he session i em s uc u e, so s i by he o ma and hen upload de esou ces iles o he XNAT
se e .
3
XNATUM examples olde on he Gi Hub eposi o y - h ps://gi hub.com/ gllm/xna um/ ee/mas e /examples
1. xna = Xna (a gs.se e , a gs.use name, a gs.passwo d)
2. xna _sessions = xna .ge _p ojec _sessions(a gs.p ojec )
P og am 5.11 - Ge p ojec sessions labels h ough XNATUM
1. xna = Xna (a gs.se e , a gs.use name, a gs.passwo d)
2. p in (xna .ge _subjec _in o(a gs.p ojec , a gs.subjec ))
P og am 5.12 - Ge all in o ma ion om a subjec wi hin a p ojec h ough XNATUM
1. # C ea ing connec ion and load expe imen objec
2. xna = Xna (a gs.se e , a gs.use name, a gs.passwo d)
3. i em = xna .session.p ojec s[a gs.p ojec ].subjec s[a gs.subjec ].expe imen s[0]
4.
5. # Sending ile
6. iles = so ed( glob.glob( '{}/sessions/{}_*.*'. o ma ( a gs.inpu , a gs.subjec
) ) )
7. xna .impo _ esou ce(i em, 'FILE', iles)
8. p in ('File impo ed.')
P og am 5.13 - Upload a session a subjec h ough XNATUM
XNATUM – A PYTHON API FOR XNAT
64
5.4
USING A VIRTUAL RAM DRIVE
Talking speci ically abou he wo k low a Algo i mi and ICVS, XNAT@DI pla o m has a unique wo k low
and se up. Resea che s wo k and de elop sc ip s in Jupy e no ebooks hos ed on he same se e in
which XNAT is unning, he only di e ence is ha hey a e unning on di e en con aine s.
This allows ue collabo a ion be ween all esea che s and he XNAT@DI. The goal he e is o allow o no
eplica e Medical Imaging da a ac oss di e en Jupy e no ebooks and con aine s bu o hos medical
images in XNAT and use hose images di ec ly in all Jupy e no ebooks.
The i s a emp o do his elied on he ac ha XNAT REST API exposes an API which includes he
en i e DICOM ile, he Medical Imaging aw o ma , wi h a ious DICOM da a elemen s.
A DICOM da a elemen , o a ibu e, is composed o he ollowing pa s [63] :
• a ag ha iden i ies he a ibu e, usually in he o ma (XXXX, XXXX) wi h hexadecimal numbe s,
and may be di ided u he in o DICOM G oup Numbe and DICOM Elemen Numbe ;
• a DICOM Value Rep esen a ion (VR) ha desc ibes he da a ype and o ma o he a ibu e alue.
Fo example, he ag (0018,8151) co esponds o he X-Ray Tube Cu en in µA and he ag (0010,0010)
co esponds o he Pa ien ’s Name. The e is also a ag o he speci ic scan image. The Ni y ile o ma ,
a ile o ma used a e he medical image is p ocessed (can be compa ed o JPEG) and wo ks in he
same way as DICOM; wi h di e en ags and a ibu es as all images a e anonymized and combined by
de aul . Taking his in o accoun , he plan was o ead and use all he images om he DICOM and Ni y
iles by selec ing he co esponden ag ield om he XNAT REST API. As explained be o e, he API c ea es
a JSON endpoin o each session inside a "p ojec and subjec " ile and hese endpoin s con ain all
DICOM ags and a ibu es. Howe e , XNAT unca es he a ibu es om he DICOM dump a ailable on
he API o unde 64 cha ac e s. So, i ’s only possible o ead he i s 64 cha ac e s o he “Pixel Da a”
a ibu e and no he comple e images.
Thus, he nex app oach was o use RAM D i e which is a block o andom-access memo y ha so wa e
can use as i he memo y we e a disk d i e. Py hon has an API o gene a e empo a y iles and di ec o ies
ha uses his OS buil -in unc ionali y. The module c ea es empo a y iles and di ec o ies and p o ides
au oma ic cleanup which can be used as con ex manage s. Howe e , as his is a speci ic app oach o
ou pla o m and XNATUM is a global package ha can be used in any XNAT ins alla ion, his is no

XNATUM – A PYTHON API FOR XNAT
65
included in he co e unc ionali y. The e o e, his is added as a wo king example on he XNATUM
eposi o y making use o he unc ionali y p e iously desc ibed o download images by indica ing he
des ina ion olde . The example uses he “ emp ile.mkd emp” [85] Py hon unc ionali y ha c ea es
empo a y di ec o y in he mos secu e manne possible wi h no ace condi ions in he di ec o y c ea ion.
The di ec o y is eadable, w i able, sea chable only by he c ea ing use ID and is a ailable as long as he
use wan s i o be du ing he p og am execu ion. This Py hon unc ionali y, when execu ed, e u ns he
empo a y di ec o y pa h and he e o e he unique hing o do on XNATUM is o indica e his pa h o he
co esponden unc ion so as o download he sessions by p ojec , subjec o session label. When he
p og am is execu ed, all he sessions a e downloaded di ec ly om XNATUM o he empo a y di ec o y
and can be used a e ha in he esea ch sc ip .
5.5
DISCUSSION
His o ically, Neu oimaging esea che s ha e used
ad hoc
p ocedu es o main aining hei analysis and
da a. O e he las ew yea s, he e ha e been se e al a emp s o build sys ems ha manage
Neu oimaging da a. Mo eo e , he abili y o p og amma ically access Neu oimaging da a is becoming
inc easingly impo an o pe o m ba ch analysis and adminis a ion asks, as hese da abases inc ease
in size.
Apa om his, one o he mos widely used Neu oimaging managemen sys ems is XNAT, which includes
many use ul and powe ul ea u es including, as discussed be o e, a REST API. XNATUM p o ides a b idge
be ween he XNAT ins ance used by he esea che o a chi e hei da a and he analysis ool. Combined
wi h Py hon, i can be used as an al e na i e bo h o he XNAT web on end and o a as se o Py hon
ools a ailable in he neu oscience domain. The package ocuses on ease o use, combining REST ul
se ices and XNATPy wi h clea seman ics and helpe ea u es.
Since one o he main ocus o he neu oscience esea ch a UMinho is using Machine Lea ning (ML) and
Deep Lea ning (DL) in he neu oscience/medicine imaging esea ch ield, XNATUM combines a se ies o
ea u es o help esea che s ocuses in he esea ch, abs ac ing om he da a o use. Fo example, he e
is a ea u e on XNATUM o simply ob ain and download all sessions wi hin a XNAT p ojec and
au oma ically label each session as ain da a o es da a.
The e sion 1.0 o XNATUM o Py hon is a ailable publicly since Ma ch 28 o 2019 and i is cu en ly
mainly used by esea che s ha use he XNAT@DI pla o m. As any so wa e in hei ea ly s eps, he e
a e a couple o hings ha can be imp o ed and added o he package. These imp o emen s and new
XNATUM – A PYTHON API FOR XNAT
66
ea u es a e discussed in he nex chap e . The p ima y goal in c ea ing his package was o esea che s
o ha e a simple way o manage da a in he XNAT@DI pla o m, and ha was accomplished since he e
a e al eady esea che s es ing i and/o using i in hei expe imen s. The images bellow lis some o he
s a s om he Pypi eposi o y.
XNATUM – A PYTHON API FOR XNAT
67
Figu e 5.6 - Daily downloads since he package is a ailable a Pypi
Figu e 5.7 - Daily downloads p opo ion be ween di e en e sions o Py hon
Figu e 5.8 - Daily downloads be ween di e en e sions o Py hon
XNATUM – A PYTHON API FOR XNAT
68
Figu e 5.9 - Daily downloads p opo ion be ween di e en e sions o Py hon
Figu e 5.10 - Daily downloads be ween di e en sys em
Figu e 5.11 - Daily downloads p opo ion be ween di e en sys em
REFERENCES
lxx
[26] W. J. Bug, G. A. Ascoli, J. S. G e he, A. Gup a, C. Fennema-No es ine, A. R. Lai d, S. D. La son,
D. Rubin, G. M. Shephe d, J. A. Tu ne , and M. E. Ma one, “The NIFSTD and BIRNLex
ocabula ies: Building comp ehensi e on ologies o neu oscience,”
Neu oin o ma ics
, ol. 6, no.
3, pp. 175–194, Sep. 2008.
[27] W. Raghupa hi Viju Raghupa hi,
An O e iew o Heal h Analy ics
, ol. 04. 2013.
[28] W. Raghupa hi and V. Raghupa hi, “Big da a analy ics in heal hca e: p omise and po en ial,”
Heal.
In . Sci. Sys .
, ol. 2, no. 1, pp. 1–10, 2014.
[29] S. T. C. Wong, D. Tjand a, H. Wang, and W. Shen, “Wo k low-enabled dis ibu ed componen -
based in o ma ion a chi ec u e o digi al medical imaging en e p ises,”
IEEE T ans. In . Technol.
Biomed.
, ol. 7, no. 3, pp. 171–183, 2003.
[30] E. Socie y, “The new EU Gene al Da a P o ec ion Regula ion: wha he adiologis should know,”
Insigh s Imaging
, ol. 8, no. 3, pp. 295–299, 2017.
[31] R. A. Pold ack, “NIH Public Access The u u e o MRI in Cogni i e Neu oscience,” ol. 62, no. 2,
pp. 1216–1220, 2014.
[32] A. Mose , K. Range, and D. M. Yo k, “NIH Public Access,”
Bone
, ol. 23, no. 1, pp. 1–7, 2008.
[33] Na ional Ins i u es o Heal h (NIH), “NIH Launches he Human Connec ome P ojec o Un a el
he B ain’s Connec ions,” 2009. [Online]. A ailable: h ps://www.nih.go /news-e en s/news-
eleases/nih-launches-human-connec ome-p ojec -un a el-b ains-connec ions. [Accessed: 01-
Jan-2019].
[34] L. Geddes, “Human b ain mapped in unp eceden ed de ail,”
Na u e
, Jul. 2016.
[35] D. S. Ma cus, K. A. A chie, T. R. Olsen, and M. Rama a nam, “The open-sou ce neu oimaging
esea ch en e p ise,”
J. Digi . Imaging
, ol. 20, no. SUPPL. 1, pp. 130–138, 2007.
[36] J. Gu neya, T. Olsenb, J. Fla ina, M. Rama a namc, K. A chied, J. Rans o de, R. He icka, L.
Wallacea, J. Clinea, W. Ho ona, and D. S. Ma cusa, “The Washing on Uni e si y Cen al
Neu oimaging Da a A chi e,”
HHS Public Access
, ol. 91, no. 2, pp. 165–171, 2015.
[37] K. Alpe , A. Kogan, T. Pa ish, D. Ma cus, and L. Wang, “The No hwes e n Uni e si y
Neu oimaging Da a A chi e (NUNDA),”
Neu oimage
, ol. 124, pp. 1131–1136, 2016.
[38] T. Doel, D. I. Shaki , R. P a , M. Ae sen, J. Mogg idge, E. Bellon, A. L. Da id, J. Dep es , T.
Ve cau e en, and S. Ou selin, “GIFT-Cloud: A da a sha ing and collabo a ion pla o m o medical
imaging esea ch.,”
Compu . Me hods P og ams Biomed.
, ol. 139, pp. 181–190, Feb. 2017.
[39] D. T. Fe ze and O. C. Wes , “The HIPAA P i acy Rule and P o ec ed Heal h In o ma ion.
Implica ions in Resea ch In ol ing DICOM Image Da abases,”
Acad. Radiol.
, ol. 15, no. 3, pp.

REFERENCES
lxx i
390–395, Ma . 2008.
[40] Ho os, “Ho os P ojec 2015,” 2015. [Online]. A ailable: h ps://ho osp ojec .o g/. [Accessed:
29-May-2019].
[41] “Osi iX DICOM Viewe | The wo ld amous medical imaging iewe ,”
Osi iX
, 2019. [Online].
A ailable: h ps://www.osi ix- iewe .com/. [Accessed: 31-May-2019].
[42] “Medical imaging so wa e: Pla o m o mode n adiology.”
[43] “Bes Medical Imaging So wa e | 2019 Re iews o he Mos Popula Tools & Sys ems.”
[Online]. A ailable: h ps://www.cap e a.com/medical-imaging-so wa e/. [Accessed: 13-Jul-
2019].
[44] “No a Medical Imaging Pla o m.” 2017.
[45] “XNAT.” [Online]. A ailable: h ps://www.xna .o g/. [Accessed: 24-May-2019].
[46] O acle, “O acle VM Vi ualBox,” pp. 1–362, 2012.
[47] VMwa e, “VMwa e,” 2019. [Online]. A ailable: h ps://www. mwa e.com/. [Accessed: 27-Jul-
2019].
[48] G. Kia , K. J. Go golewski, D. Kleissas, W. G. Roncal, B. Li , B. Wandell, R. A. Pold ack, M. Wiene ,
R. J. Vogels ein, R. Bu ns, and J. T. Vogels ein, “Science in he cloud (SIC): A use case in MRI
connec omics,”
Gigascience
, ol. 6, no. 5, pp. 1–10, May 2017.
[49] Docke Inc., “Wha is a Con aine ?: A s anda dized uni o so wa e,”
Docke .Com
, 2019. [Online].
A ailable: h ps://www.docke .com/ esou ces/wha -con aine . [Accessed: 30-Jun-2019].
[50] “Ki ema ic | Docke Documen a ion.” [Online]. A ailable: h ps://docs.docke .com/ki ema ic/.
[Accessed: 02-Jul-2019].
[51] “shipya d p ojec .” [Online]. A ailable: h p://shipya d-p ojec .com/. [Accessed: 02-Jul-2019].
[52] Po aine , “Po aine Managemen , Docke Use In e ace, Con aine So wa e - Auckland,
Singapo e, San F ancisco | Eme ging Technology Pa ne s,” 2019. [Online]. A ailable:
h ps://www.po aine .io/. [Accessed: 31-May-2019].
[53] M. Böhnlein and A. U. Vom Ende, “XML - Ex ensible Ma kup Language,”
Wi scha sin o ma ik
,
ol. 41, no. 3, pp. 274–276, 1999.
[54] F. Falaha i, E. Wes man, and A. Simmons, “Mul i a ia e da a analysis and machine lea ning in
Alzheime ’s disease wi h a ocus on s uc u al magne ic esonance imaging,”
J. Alzheime ’s Dis.
,
ol. 41, no. 3, pp. 685–708, 2014.
[55] Y. Huo, J. Blabe , S. M. Damon, B. D. Boyd, S. Bao, P. Pa a haneni, C. B. Nogue a, S. Chagan i,
V. Na h, J. M. G ee , I. Lyu, W. R. F ench, A. T. New on, B. P. Roge s, and B. A. Landman,
REFERENCES
lxx ii
“Towa ds Po able La ge-Scale Image P ocessing wi h High-Pe o mance Compu ing,”
J. Digi .
Imaging
, ol. 31, no. 3, pp. 304–314, 2018.
[56] D. Ma cus, “XNAT Clinical Analy ics Pla o m ( XCAP ): An In o ma ics Pla o m o Machine
Lea ning Applica ions in Clinical Resea ch.”
[57] “Pos g eSQL: The wo ld’s mos ad anced open sou ce da abase,” 2013. [Online]. A ailable:
h ps://www.pos g esql.o g/. [Accessed: 01-Jun-2019].
[58] B. Shaik, “Simple Pos g eSQL Blog: Pos g eSQL A chi ec u e,” 2013. [Online]. A ailable:
h p://bajis-pos g es.blogspo .com/2013/10/pos g esql-a chi ec u e.h ml. [Accessed: 30-Jun-
2019].
[59] T. Bui, “Analysis o Docke Secu i y,” 2015.
[60] Docke Inc., “O e iew o Docke Compose,”
docs.docke .com
, pp. 1–6, 2015.
[61] C. E ans, “The O icial {YAML} Web Si e,”
{YAML:} {YAML} Ain’ Ma kup Language
, 2011. [Online].
A ailable: h p://yaml.o g/. [Accessed: 06-Jun-2019].
[62] The Apache So wa e Founda ion, “Apache Tomca ,” 2011. [Online]. A ailable:
h p:// omca .apache.o g/. [Accessed: 06-Jun-2019].
[63] Mildenbe ge Pe e , M. Eichelbe g, and E. Ma in, “In oduc ion o he DICOM s anda d,” p. 8,
2001.
[64] “The G adle W appe ,” 2018. [Online]. A ailable:
h ps://docs.g adle.o g/cu en /use guide/g adle_w appe .h ml. [Accessed: 06-Jun-2019].
[65] “Clinical Da a Types - XNAT Ma ke placeXNAT Ma ke place.” [Online]. A ailable:
h ps://ma ke place.xna .o g/plugin/clinical-da a- ypes/. [Accessed: 06-Jun-2019].
[66] “IQ Assessmen - XNAT Ma ke placeXNAT Ma ke place.” [Online]. A ailable:
h ps://ma ke place.xna .o g/plugin/ adiological-assessmen /. [Accessed: 06-Jun-2019].
[67] “m ic on XNAT Pipeline.” [Online]. A ailable: h ps://gi hub.com/jhugue n/xna -
pipelines/ ee/mas e /m ic on.
[68] “QAP.” [Online]. A ailable: h ps://gi hub.com/jhugue n/xna -
pipelines/blob/mas e /QAP/README.md.
[69] “m ic ogl.” [Online]. A ailable: h ps://gi hub.com/jhugue n/xna -
pipelines/ ee/mas e /m ic ogl.
[70] “DTI-p ep ocessing.” [Online]. A ailable: h ps://gi hub.com/jhugue n/xna -
pipelines/ ee/mas e /d i_p ep ocessing.
[71] “MRI bias ield co ec ion.” [Online]. A ailable: h ps://gi hub.com/jhugue n/xna -
REFERENCES
lxx iii
pipelines/ ee/mas e /bias_co ec ion.
[72] “MRI ana omical de ace .” [Online]. A ailable: h ps://gi hub.com/jhugue n/xna -
pipelines/ ee/mas e /m i_ana _de ace.
[73] “xna de / xna -image- iewe -plugin.” [Online]. A ailable: h ps://bi bucke .o g/xna de /xna -
image- iewe -plugin/s c/mas e /. [Accessed: 07-Jun-2019].
[74] “XTK.” [Online]. A ailable: h ps://gi hub.com/x k/X# eadme.
[75] Google, “Closu e Tools - Google De elope s,” 2013. [Online]. A ailable:
h ps://de elope s.google.com/closu e/. [Accessed: 07-Jun-2019].
[76] NRG Lab, “Who Uses XNAT?” [Online]. A ailable: h ps://www.xna .o g/abou /xna -
implemen a ions.php. [Accessed: 11-Jun-2019].
[77] S. D. La son and M. E. Ma one, “On ologies o neu oscience: Wha a e hey and wha a e hey
good o ?,”
F on . Neu osci.
, ol. 3, no. MAY, pp. 60–67, 2009.
[78] E. Mulle , J. A. Bedna , M. Diesmann, M. Gewal ig, M. Hines, and A. P. Da ison,
Py hon in
Neu oscience
. 2015.
[79] SciPy de elope s, “SciPy.o g — SciPy.o g,” 2019. [Online]. A ailable: h ps://www.scipy.o g/.
[Accessed: 12-Jun-2019].
[80] A. J. Na han and A. Scobell, “How China sees Ame ica,”
Fo eign A ai s
, ol. 91, no. 5. p. All,
2012.
[81] “PEP 249 -- Py hon Da abase API Speci ica ion 2.0 | Py hon.o g.” [Online]. A ailable:
h ps://www.py hon.o g/de /peps/pep-0249/. [Accessed: 12-Jun-2019].
[82] R. T. Fielding, “A chi ec u al S yles and he Design o Ne wo k-based So wa e A chi ec u es,”
Uni e si y o Cali o nia, 2000.
[83] “Pypi XNAT sea ch.” [Online]. A ailable: h ps://pypi.o g/sea ch/?q=xna .
[84] Ma hWo ks, “MATLAB - Ma hWo ks - MATLAB & Simulink,”
Ma lab
, 2019. [Online]. A ailable:
h ps://www.ma hwo ks.com/p oduc s/ma lab.h ml. [Accessed: 13-Jun-2019].
[85] Py hon.o g, “ emp ile: Gene a e empo a y iles and di ec o ies,” 2019. [Online]. A ailable:
h ps://docs.py hon.o g/2/lib a y/ emp ile.h ml. [Accessed: 02-Jul-2019].
APPENDICES
APPENDICES
APPENDICES
lxxx
A - XNAT USER GUIDE
A.1 INTRODUCTION
XNAT@DI is an ins ance o he popula Neu oimaging a chi e sys em XNAT (xna .o g) and a chi es all
imaging da a acqui ed a he ICVS and Hospi al o B aga and used in he Depa men o In o ma ics.
This guide co e s he mos commonly pe o med ope a ions wi h he XNAT@DI web po al. Fo mo e
de ailed in o ma ion on how o use he po al please isi he XNAT wiki, o i you can' ind he answe
o you ques ion, please email a XNAT adminis a o .
Figu e A.1 - UMinho XNAT pla o m
A.2 SITE ACCESS
Regis a ion
All UMinho s a and s uden s can egis e o use XNAT@DI. Fo his, hey need o email P o . Vic o Al es
a [email p o ec ed] asking o an accoun in he pla o m. S a and s uden s may use hei
ins i u ional email. A e his i is necessa y o be g an ed access o a p ojec . Non-UMinho use s should
also email P o . Vic o Al es wi h hei p e e ed use name and con ac de ails, including he con ac

APPENDICES
lxxxi
de ails o an in es iga o o he p ojec (s) hey wish o be g an ed access o in he commen s sec ions.
XNAT@DI adminis a ions will enable he accoun a e con i ming wi h he ele an p ojec in es iga o (s).
Login
To access o he po al, access he add ess he pla o m add ess o copy/pas e his add ess in o a web
b owse add ess ba . Nex inse you login de ails in he login box. I any p oblem occu s, y o dele e
you cookies. I he p oblem pe sis s, please con ac P o . Vic o Al es. Login in o ma ion is displayed in
he op igh -hand co ne o all pages on he si e abo e he gene al sea ch ba . To logou simply click he
“logou ” link. Login sessions will expi e a e 15 mins o inac i i y, wi h he emaining ime displayed nex
o he use name o he logged-in use . I you wish o enew you session click he “ enew” link also in he
op igh -hand side o he sc een, and he 15 min coun e will s a again.
P ojec Membe ship
Access o imaging da a is con olled ia p ojec membe ship. Membe s a e added o a p ojec by
adminis a o s and/o p ojec in es iga o .
To ask he adminis a o s o add a new membe o a p ojec , he in es iga o mus email
[email p o ec ed] wi h he name and email add ess o he pe son o be added and he p ojec name
ha he access is o be gi en o.
I you a e a p ojec owne , you can use he "Access" ab o he p ojec page. Access is g an ed by on he
Access ab o he p ojec page, new membe s a e added by selec ing he a ailable use s om he lis .
Membe s can be emo ed om a p ojec by a p ojec owne o MBI adminis a o s by clicking he
“Remo e” bu on nex o hei names.
A.3 NAVIGATION
XNAT@DI ID Con en ions
All p ojec s acqui ed and make a ailable a XNAT@DI mus con ain a name. Gene ally, his name is he
p ojec s name.
APPENDICES
lxxxii
Home Sc een
The home sc een p o ides se e al con enien me hods o na iga e he imaging da a ha is
accessible o he use . A lis o ecen ly accessed p ojec s by he use will appea in he
bo om le co ne o he sc een and a lis o ecen ly uploaded scanning sessions on he igh . Clicking
on hese en ies will na iga e he use o he co esponding p ojec /session. To na ow down he lis o
p ojec s, subjec s o sessions, sea ch c i e ia can be en e ed in o he sea ch box in he middle o he
page. To e u n o he home sc een om any page, selec he XNAT logo in he op le co ne .
Command Ribbon
The command ibbon is accessible om all pages wi hin he si e. Clicking on he “B owse” opens a
hie a chical menu ha p o ides links o all p ojec s, subjec s and imaging sessions ha a e accessible
o he use .
A.4 DATA ACCESS
I is he esea che 's esponsibili y o e i y he quali y o he imaging da a uploaded o XNAT. Gene ally,
he da a uploaded o he XNAT ins ance goes o he "P e-a chi e". The esea ch mus e iew and a chi e
he da a himsel , gi ing a p ojec o i .
Snapsho s and DICOM Heade s
A e an imaging session is uploaded o XNAT, image snapsho s a e gene a ed o
ecognized image ypes and can be displayed along wi h o he basic me a-da a by oggling
he +/- bu on nex o he scan name on he session page. De ailed me ada a can be accessed om he
DICOM heade s ia he link “View DICOM Heade s”.
Image Viewe
XNATUM p o ides a con enien buil -in iewe o isual inspec ion o imaging da a, which
can be accessed by he “ iew images” link on he “Ac ions” menu on he session page.
APPENDICES
lxxxiii
A.5 MANAGE SESSIONS DATA WITH HOROS
To manage sessions h ough Ho os o o he DICOM medical image iewe you jus o ha e o add XNAT
as a new image loca ion on he co esponden DICOM po .
Figu e A..2 - HOROS XNAT loca ion con igu a ion
APPENDICES
lxxxi
B – XNAT DATA MODEL
A da a model is an abs ac model ha o ganizes ce ain elemen s and s anda dizes how hey can ela e
o each o he . I explici ly de e mines he s uc u e o he da a and o ha eason i is some imes e e ed
o as a da a s uc u e.
XNAT se e is a pla o m buil o imaging esea ch pu poses. I s unc ions can a chi e, impo , p ocess
and secu ely dis ibu e he da a. The co e da a-model used in XNAT p e iews he use o he XNAT se e
in a ious p ojec s. The e a e h ee co e da a- ypes in XNAT da a model: P ojec s, Subjec s and
Expe imen s. These h ee da a- ypes ela e wi h each o he .
P ojec s
A p ojec is used o de ine a collec ion o a ce ain da a s o ed in he se e . The p ojec is used o de ine
a secu e s uc u e o da a. Use s can ha e ce ain pe missions o da a wi hin a ce ain p ojec . They can
be Owne s, Membe s o Collabo a o s. This pe mission de ines who can ead, sa e o dele e da a. Fo
example, in a speci ic esea ch s udy we can gi e pe mission o he p incipal esea che o sa e, ead
and dele e da a bu o an in e nal esea che only o ead he da a.
Subjec s
A subjec is anyone who pa icipa es in a s udy. Imaging s udies has adi ionally ocused on human
s udies, howe e , he subjec could be non-human. I exis s in a con ex o a p ojec and i 's "owned" by
he p ojec whe e i was c ea ed on. Also, subjec s can be sha ed wi h o he p ojec s o cap u e
longi udinal da a om a ious s udies.
Expe imen s
An expe imen is an e en by which imaging da a o non-imaging da a is acqui ed. I canno exis ou side
he con ex o a p ojec and can be sha ed in o o he p ojec s.