When deleting subjects via REST, SCANS not deleted from filesystem

70 views
Skip to first unread message

Isabel Restrepo

unread,
Sep 28, 2021, 4:46:17 PM9/28/21
to xnat_discussion
Hi All,

When I delete a subject via the API using /data/projects/{{current_project}}/subjects/{{current_subject}}, I can still see all the SCANS in the filesystem. The subject does not longer show up on web UI. If I delete simply using the web UI, then corresponding folder in the archive is gone as expected. Do I need to pass something special to the rest API? The docs here - https://wiki.xnat.org/display/XAPI/Subject+API#SubjectAPI-Delete(OrUnshare)ASubjectRecord  seem to indicate that it should get deleted. I'm in 1.8.2.2.

Thank you for any wisdom!

Isabel

Moore, Charlie

unread,
Sep 28, 2021, 4:55:11 PM9/28/21
to xnat_di...@googlegroups.com
Hi Isabel,

That is handled by the "removeFiles" query parameter. If omitted (or set to false), XNAT leaves the files in place while deleting the subject/experiment records from the database. I've updated the documentation you linked to include the missing query parameter. Hopefully it's a bit clearer now.

Thanks,
Charlie

From: xnat_di...@googlegroups.com <xnat_di...@googlegroups.com> on behalf of Isabel Restrepo <isabel...@gmail.com>
Sent: Tuesday, September 28, 2021 3:46 PM
To: xnat_discussion <xnat_di...@googlegroups.com>
Subject: [XNAT Discussion] When deleting subjects via REST, SCANS not deleted from filesystem
 

* 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/fd8e2311-0691-407b-9b7d-96e5cf7ae5b7n%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.

Isabel Restrepo

unread,
Sep 28, 2021, 5:12:56 PM9/28/21
to xnat_discussion
Thank you! and thank you for updating the documenation!

Martin Boswell

unread,
Sep 30, 2021, 1:17:56 PM9/30/21
to xnat_discussion
Thanks for sharing this info.  I accidentally discovered a lot of orphaned directories in my archive a while back and  trying to figure out where they came from was on my list of tasks for the near future.  

Now I know how to stop this from happening, but I have a pretty big cleanup job to do to find these excess files.  The only way I can think of to find these is to look at each dir in my archive and then query XNAT for an experiment, assessor, etc. with a matching name.  

Does anyone know of an easier way to find a list of  the orphaned files (or dirs)?  

 - Martin
Reply all
Reply to author
Forward
0 new messages