Hi,
I am trying to run example notebooks on my data in XNAT/JupyterHub.
When I open the terminal JupyterHub, the .dcm files are acceessible under
/data/projects/[PROJECTNAME]/experiments/[EXPERIMENTID]/SCANS/[SCANID]/DICOM/*.dcm
However, there is an error trying to retrieve the files from the Jupyter notebook XNATpy.ipynb:
file_object = session.projects['NNN'].subjects['NNN'].experiments['NNN'].scans['NNN'].resources['DICOM'].files[0]
There are no python errors in the notebook prior to this, connection to XNAT is ok. Error message is below.
Thank you,
Nadya
File /opt/conda/lib/python3.10/site-packages/xnat/core.py:783, in XNATBaseListing.__getitem__(self, item)
781 def __getitem__(self, item):
782 if isinstance(item, (int, slice)):
--> 783 return self.listing[item]
785 try:
786 return self.data[item]
File /opt/conda/lib/python3.10/site-packages/xnat/core.py:767, in XNATBaseListing.listing(self)
762 @property
763 def listing(self):
764 """
765 The listing view of the data
766 """
--> 767 return self.data_maps[3]
File /opt/conda/lib/python3.10/site-packages/xnat/core.py:59, in caching.<locals>.wrapper(self)
53 def wrapper(self):
54 # We use self._cache here, in the decorator _cache will be a member of
55 # the objects, so nothing to worry about
56 # pylint: disable=protected-access
57 if not self.caching or name not in self._cache:
58 # Compute the value if not cached
---> 59 self._cache[name] = func(self)
61 return self._cache[name]
File /opt/conda/lib/python3.10/site-packages/xnat/core.py:928, in XNATListing.data_maps(self)
926 if self.secondary_lookup_field is not None:
927 secondary_lookup_value = x.get(self.secondary_lookup_field)
--> 928 new_object = self.xnat_session.create_object(x['URI'],
929 type_=xsi_type,
930 id_=x['ID'],
931 fieldname=x.get('fieldname'),
932 **{self.secondary_lookup_field: secondary_lookup_value})
933 if secondary_lookup_value in key_map:
934 non_unique.add(secondary_lookup_value)
File /opt/conda/lib/python3.10/site-packages/xnat/session.py:1021, in BaseXNATSession.create_object(self, uri, type_, fieldname, **kwargs)
1018 overwrites = None
1020 if cls.SECONDARY_LOOKUP_FIELD not in kwargs:
-> 1021 kwargs[cls.SECONDARY_LOOKUP_FIELD] = datafields.get(cls.SECONDARY_LOOKUP_FIELD)
1023 obj = cls(uri, self, datafields=datafields, fieldname=fieldname, overwrites=overwrites, **kwargs)
1025 self._cache['__objects__'][uri, fieldname] = obj
AttributeError: 'NoneType' object has no attribute 'get'