Dave,
The same XNAT machinery that accepts DICOM objects via C-STORE and puts them into the prearchive also accepts HTTP POST: either file-at-a-time, MIRC-style, or series-at-a-time zips containing DICOM. We haven’t done any benchmarks, but I would expect these to be faster than using the REST API because there’s less overhead (I think), especially for the series zips (which is what the upload applet uses now).
There’s no documentation for posting series zips, but there is Java code in the upload applet (http://hg.xnat.org/uploadassistant), particularly in org.nrg.dcm.Study and org.nrg.io.dcm.ZipSeriesUploader.
- Kevin
--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To post to this group, send email to
xnat_di...@googlegroups.com.
To unsubscribe from this group, send email to
xnat_discussi...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/xnat_discussion?hl=en.
univ = Interface('https://hd-hni-xnat.cac.cornell.edu:8443/xnat')
learn_obj = univ.select.project('Learn') #project_obj
subject_list = learn_obj.subjects().get() #subject_no = accession number on XNAT web interface
subjectobj_HDHNI_S00163_ajsc = learn_obj.subject(subject_list[4])
experimenat_obj = subjectobj_HDHNI_S00163_ajsc.experiment('MR Session')
scan_obj = experimenat_obj.scan('3planeloc')
scan_obj.resource('NIFTI_upload').file('image.nii').put('/home/r100307_BOLD_SOCIAL1_RL.nii')
Error reposrted for the lasyt line:
<h3>The server encountered an unexpected condition which prevented it from fulfilling the request</h3><p>You can get technical details <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">here</a>.<br>
Please continue your visit at our <a href="/">home page</a>.
</p>
</body>
</html>
Was wondering if you can share snippet of youe Pyxnat code ..? That would be of big help.
I appreciate your time and consideration.
Thanks!
DB
import osimport sys
def storeFile(xnat_resource, fullFilePath, fileType='Image', overwrite=False,fid=None): if not xnat_resource.exists(): return None if not fid: fid = os.path.basename(fullFilePath) thefile = xnat_resource.file(fid) if os.path.isfiile(fullFilePath): if overwrite or not thefile.exists() : thefile.put(fullFilePath, fileType, overwrite=True) sys.stderr.write("created file resource for: " + fullFilePath) else: sys.stderr.write("Cannot store file. File does not exist: {file} ".format(file=fullFilePath))
univ = Interface('https://hd-hni-xnat.cac.cornell.edu:8443/xnat')
learn_obj = univ.select.project('Learn') #project_objsubject_list = learn_obj.subjects().get() #subject_no = accession number on XNAT web interfacesubjectobj_HDHNI_S00163_ajsc = learn_obj.subject(subject_list[4])experimenat_obj = subjectobj_HDHNI_S00163_ajsc.experiment('MR Session')scan_obj = experimenat_obj.scan('3planeloc')scan_resource=scan_obj.resource('NIFTI_upload')storeFile(scan_resource, '/home/r100307_BOLD_SOCIAL1_RL.nii', 'NII', True, 'image.nii')
--
You received this message because you are subscribed to a topic in the Google Groups "xnat_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xnat_discussion/nrl_yV0RyP0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xnat_discussi...@googlegroups.com.
To post to this group, send email to xnat_di...@googlegroups.com.
Visit this group at https://groups.google.com/group/xnat_discussion.
For more options, visit https://groups.google.com/d/optout.
univ = Interface('https://hd-hni-xnat.cac.gwu.edu:8443/xnat')
learn_obj = cornell.select.project('Learn')
subject_list = learn_obj.subjects().get()
subject_obj = learn_obj.subject(subject_list[4])
experimenat_obj = subject_obj.experiment('AFNI')
experimenat_obj.resource('NIFTI').file('image.nii').put('/Users/sdb99/Subject18/mprage-s18-obl.nii')
the above code does upload file successfuly as i can even download it with get method. However doesnt show up on XNAt website.
Any idea why this might be the case?
Many Thanks in advance.
Suyash