XNAT 1.8 Container service output handlers

341 views
Skip to first unread message

elijah....@gmail.com

unread,
Mar 30, 2021, 12:27:37 PM3/30/21
to xnat_discussion
Hello, I'm on XNAT 1.8, trying to get the latest NRG xnat/FreeSurfer container service working. It processes the data and generates the assessor XML, but it does not upload the assessor XML or the FS data as a resource.

Can someone clarify my understanding of this? When reading the documentation, I get the impression that this is actually intentional, and we are supposed to write separate "wrap-up" commands to do this upload process? Or is that supposed to be handled by the "vanilla" output-handlers that are already included in the default JSON "Command"? I'm not wanting to do any special post processing, other than uploading the assessor and the data "Resource".

I notice the FS docker image has "upload_assesor.sh" and "upload_freesurfer.sh" as available scripts I could potentially run in a "wrap-up command", but those (curl commands) require host, user, and password arguments, and it's not very clear form the documentation how I would include all the necessary parameters into a "wrap-up" command.

Unfortunately the output handler documentation does not exist yet, so any tips on how to fix this issue would be most welcome. 

Thanks for all your help,
-Eli


Moore, Charlie

unread,
Mar 30, 2021, 12:35:13 PM3/30/21
to xnat_di...@googlegroups.com
Hi Eli,

Just to double check: have you also installed the Freesurfer common plugin? The Freesurfer assessor is not a data type included with vanilla XNAT, so CS won't know how to create the assessor without that plugin.

Thanks,
Charlie

From: xnat_di...@googlegroups.com <xnat_di...@googlegroups.com> on behalf of elijah....@gmail.com <elijah....@gmail.com>
Sent: Tuesday, March 30, 2021 11:27 AM
To: xnat_discussion <xnat_di...@googlegroups.com>
Subject: [XNAT Discussion] XNAT 1.8 Container service output handlers
 

* External Email - Caution *

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/4ec0a354-7bba-4bbe-b0b6-266cddccb03en%40googlegroups.com.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

elijah....@gmail.com

unread,
Mar 30, 2021, 12:38:40 PM3/30/21
to xnat_discussion
Hi Charlie, thanks for the quick reply. Yes I believe so, freesurfer-common-1.0.4.jar is installed.

kel...@wustl.edu

unread,
Mar 30, 2021, 1:59:21 PM3/30/21
to xnat_discussion
Hi Eli,

There are a few Freesurfer containers floating around. Could you link to the specific one you're trying to use?

Best,
Matt

elijah....@gmail.com

unread,
Mar 30, 2021, 2:37:32 PM3/30/21
to xnat_discussion
Hi Matt, I am using the one located at https://hub.docker.com/r/xnat/freesurfer711-xnat

This is pulled under the administration, plugin settings, and pulling the image through the provided interface. I'm using the :latest tag.

elijah....@gmail.com

unread,
Mar 30, 2021, 3:45:06 PM3/30/21
to xnat_discussion
This post (https://groups.google.com/g/xnat_discussion/c/SBHSUApuyZ) is having similar issues. I also found that my stderr messages are the same. I did a little digging and I was able to track down those error messages to the "fs2xml" perl script ... the "Stats" library has those exact messages, so it looks like it's having some trouble interpreting the Freesurfer stats file... but it's hard for me to see if the generated XML has any problems with the format or not - or if that could even be part of our issue

Sarah K

unread,
Mar 30, 2021, 4:09:21 PM3/30/21
to xnat_discussion
Hi, I'm the person that put that container together. I'm so sorry this isn't working!

I'm going to dig a little deeper but here are some surface things I'm noticing:

That timestamp error with fs2xml is actually something that happens for every run. It's just a really old perl script that like you said is trying to pull program info from Freesurfer stats files that isn't there. The script still completes and the assessor XML still gets generated, it's just unable to pull some specific pieces from the stats files to store in the XML.
From that user's logs, it actually looks like the entire run.sh script in the container is completing fully. If your stdout logs also end with "Finished generating assessor XML" and a final datestamp, that means the container part is completing (or it's reaching the end of the run.sh script anyway). So the issue is something in the uploading step.

I'm actually noticing that everywhere I've been using it and when I've sent it to others I've included a customized fork of the freesurfercommon plugin. So the container may be generating XML that freesurfercommon-1.0.4 can't figure out. I'm digging to see if I made any updates to the data type schema in my custom version that would cause this, or if it's something else.

I'll respond again soon when I know more.

-Sarah

Sarah K

unread,
Mar 30, 2021, 4:32:44 PM3/30/21
to xnat_discussion
Yep, I think the freesurfercommon plugin release needs to be updated to handle FreeSurfer 7.1.1 output. It looks like the current release of freesurfercommon -1.0.4 doesn't include a field for VentricleChoroidVol which is included in the stats2xml output for 7.1.1 Freesurfers, but not 5.3 Freesurfers. I'll let the XNAT team know and hopefully they can get an update out soon.

elijah....@gmail.com

unread,
Mar 31, 2021, 10:57:37 AM3/31/21
to xnat_discussion
Thanks for these great modules, Sarah. recon-all finishes just fine, and the XML is generated, but it's as you said with the upload not working for me also. Any chance you could make the "working" FreeSurfer data type plugin available in the meantime?

Sarah K

unread,
Mar 31, 2021, 11:41:49 AM3/31/21
to xnat_discussion
Been working on this - The changes were just approved and pushed here: https://bitbucket.org/nrg_customizations/nrg_plugin_freesurfercommon/downloads/?tab=branches
The updated version to use of nrg_plugin_freesurfercommon to work with the Freesurfer 7 container is 1.0.5.

I'll see if I can find out about getting an updated jar file in the downloads section next.

Sarah K

unread,
Mar 31, 2021, 12:20:39 PM3/31/21
to xnat_discussion
Ok, I've been given write access to that repository and just uploaded the .jar file to the Downloads tab. Let me know if that works for you!

elijah....@gmail.com

unread,
Mar 31, 2021, 1:19:20 PM3/31/21
to xnat_discussion
Awesome. The new jar file seems to load fine, I'm running the pipeline now. I'll let you know by tomorrow if there are any more issues. Thank you!

elijah....@gmail.com

unread,
Apr 5, 2021, 10:03:07 AM4/5/21
to xnat_discussion
Hi Sarah, sorry for the delay. It appears the same issue occurs, with the same . The XML is generated, but neither the data nor the assessor XML are uploaded. I tried with a fresh install of XNAT (the main difference being that I used only the 1.0.5 jar, from the very start)

Are there any logs associated with the container service that might give a better indication of what's going on with the output handler?

Thanks,
-Eli

Sarah K

unread,
Apr 5, 2021, 10:11:28 AM4/5/21
to xnat_discussion
yes, definitely check containers.log in the standard XNAT logs folder, XNAT_HOME/logs. If you want to send me the resulting XML to check out I can take a look also!

elijah....@gmail.com

unread,
Apr 5, 2021, 10:21:14 AM4/5/21
to xnat_discussion
OK, here's the XML. I'm not knowledgeable enough to be able to notice any immediate errors, but maybe you'll have better luck. I've also attached the stderr/out for recon-all, although that may not be very helpful at this point.

I'll take a look at the container service logs and see if anything pops out at me

stdout.txt
XNAT2_E00002_freesurfer7.xml
stderr.txt

elijah....@gmail.com

unread,
Apr 5, 2021, 10:35:35 AM4/5/21
to xnat_discussion

Hi Sarah, here are a few of the more conspicuous lines from containers.log:

2021-04-02 03:11:30,907 [DefaultMessageListenerContainer-10] ERROR org.nrg.containers.services.impl.ContainerFinalizeServiceImpl - Container 1: Could not insert item from XML file /data/xnat/build/3e2cbbca-9203-42d3-a450-c8e3b8cc892e/XNAT2_E00002_freesurfer7.xml
2021-04-02 03:11:30,916 [DefaultMessageListenerContainer-10] ERROR org.nrg.containers.services.impl.ContainerFinalizeServiceImpl - Cannot upload files for command output ASSESSOR_XML:assessor
org.nrg.containers.exceptions.ContainerException: Container 1: Could not insert item from XML file /data/xnat/build/3e2cbbca-9203-42d3-a450-c8e3b8cc892e/XNAT2_E00002_freesurfer7.xml

Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'fs:Freesurfer'.

2021-04-02 03:11:30,916 [DefaultMessageListenerContainer-10] ERROR org.nrg.containers.services.impl.ContainerFinalizeServiceImpl - Cannot upload files for command output DATA:data-resource
org.nrg.containers.exceptions.ContainerException: Container 1: Cannot upload output "DATA:data-resource". Could not instantiate object from input "assessor".

2021-04-02 03:11:30,916 [DefaultMessageListenerContainer-10] ERROR org.nrg.containers.services.impl.ContainerFinalizeServiceImpl - Cannot upload files for command output SNAPSHOTS:snapshots-resource
org.nrg.containers.exceptions.ContainerException: Container 1: Cannot upload output "SNAPSHOTS:snapshots-resource". Could not instantiate object from input "assessor".

elijah....@gmail.com

unread,
Apr 5, 2021, 12:19:43 PM4/5/21
to xnat_discussion
Hmm ... I just noticed that when I look at "Administration -> Data Types", there is no Freesurfer data type at all... was I supposed to keep both the 1.0.4 jar as well as 1.0.5? Because I removed the 1.0.4 jar and replaced it with 1.0.5.

Sarah K

unread,
Apr 5, 2021, 12:31:32 PM4/5/21
to xnat_discussion
oh, it might be your data type setup! I spent a little while uploading your XML, re-installing the same 1.0.5 plugin, checking my data type settings, etc. and could not replicate your error from containers.log - it does sound like the data type setup might have to do with it. You would want to entirely replace the 1.0.4 jar with the 1.0.5, so it sounds like that's correct. Another tomcat restart might help? I'm trying to think of how I set up my Freesurfer data type originally - you could try the "Setup additional data type" button and see if there is a fs:fsData in the list. That would be the one you're looking for.

Moore, Charlie

unread,
Apr 5, 2021, 12:39:21 PM4/5/21
to xnat_di...@googlegroups.com
That observation would be consistent with the error. That particular parsing error is what XNAT will give you if it doesn't recognize the data type. Some things you can double check:
  1. In the site admin UI (Administer > Site Administration), check the "Installed Plugins" tab. You should see the Freesurfer common plugin. If it's not there, XNAT doesn't think you have it installed.
  2. Double check the jar you installed: there's two 1.0.5 jars uploaded to the repo. You would want the "cnda-freesurfer-common-1.0.5.jar" one.
Thanks,
Charlie

From: xnat_di...@googlegroups.com <xnat_di...@googlegroups.com> on behalf of Sarah K <sarahja...@gmail.com>
Sent: Monday, April 5, 2021 11:31 AM
To: xnat_discussion <xnat_di...@googlegroups.com>
Subject: Re: [XNAT Discussion] XNAT 1.8 Container service output handlers
 

elijah....@gmail.com

unread,
Apr 5, 2021, 12:56:20 PM4/5/21
to xnat_discussion
I think I know what happened.... my mistake, I was using freesurfer-common-beans-1.0.5.jar thinking that was the right plugin. Looks like there's another 1.0.5 plugin that I should probably be using instead.

Sarah K

unread,
Apr 5, 2021, 1:00:13 PM4/5/21
to xnat_discussion
That might be it! Try out the other .jar, labeled "cnda-freesurfer-common-1.0.5.jar" on the downloads page: https://bitbucket.org/nrg_customizations/nrg_plugin_freesurfercommon/downloads/

elijah....@gmail.com

unread,
Apr 5, 2021, 1:03:35 PM4/5/21
to xnat_discussion
Thanks, yeah I just noticed charlies reply also. Again, thank you both! Will update this thread when the results are in.
Reply all
Reply to author
Forward
0 new messages