[Midas] Using pydas to identify bitstream location

BRIAN E CHAPMAN Brian.Chapman at utah.edu
Thu Oct 31 01:43:49 EDT 2013


Zach and JC,

What I'm envisioning is something similar to what JC describes. I'm playing around with using an IPython notebook as a web-based means of data exploration via SimpleITK, OpenCV, etc. So I was hoping to be able to figure out from pydas where the file was located on the disk and pass that to the reader (e.g., SimpleITK image reader).

Brian

________________________________
From: Jean-Christophe Fillion-Robin [jchris.fillionr at kitware.com]
Sent: Wednesday, October 30, 2013 5:54 PM
To: Zach Mullen
Cc: BRIAN E CHAPMAN; midas at public.kitware.com
Subject: Re: [Midas] Using pydas to identify bitstream location

Hi Zach,

I guess for performance purpose, if one would like to have a common file-system between a processing/visualization server and midas server. Knowing the location of the bitstream would avoid unneeded streaming operation.

Jc


On Wed, Oct 30, 2013 at 7:43 PM, Zach Mullen <zach.mullen at kitware.com<mailto:zach.mullen at kitware.com>> wrote:
Hi Brian,

The location of a bitstream on the server's filesystem is known only to the server, it isn't exposed in the API in any way. As such, it wouldn't be possible to know its server-side path using pydas. Out of curiosity, what's your use case where you would want to know that information?

Thanks,

Zach


On Wed, Oct 30, 2013 at 6:49 PM, BRIAN E CHAPMAN <Brian.Chapman at utah.edu<mailto:Brian.Chapman at utah.edu>> wrote:
Hello Midas World,

In 2012 Patrick posted the following code snippet to identify the location of a bitstream in the file system. Can the equivalent be done in pydas?


Mona,

First, a bit about how items correspond to files. Items are made up of revisions. Most items contain one revision (the head or latest revision). Within each revision are bitstreams. These bitstreams are analogous to the files on the file system. With all that in mind, the following code should get you what you want (I'm going to assume the item ID is in a variable called, appropriately, $itemId.):

// Load our models
$ItemModel = MidasLoader::loadModel('Item');
$ItemRevisionModel = MidasLoader::loadModel('ItemRevision');
$BitstreamModel = MidasLoader::loadModel('Bitstream');

// Get the item and its last revision from the time id
$itemDao = $ItemModel->load($itemId);
$lastRevisionDao = $ItemModel->getLastRevision($itemDao);

// loop through the bitstreams and print their paths
foreach($lastRevisionDao->getBitstreams() as $bitstreamDao)
  {
  print($bitstreamDao->getPath());
  }

Hope that helps!

Thanks,
Patrick Reynolds
Technical Leader
Kitware, Inc.
919 869 8848<tel:919%20869%208848>


Brian E. Chapman, Ph.D.
Associate Professor
Department of Radiology
University of Utah


_______________________________________________
Midas mailing list
Midas at public.kitware.com<mailto:Midas at public.kitware.com>
http://public.kitware.com/cgi-bin/mailman/listinfo/midas




--
Zach Mullen
R & D Engineer
Kitware Inc.
919-869-8858<tel:919-869-8858>

_______________________________________________
Midas mailing list
Midas at public.kitware.com<mailto:Midas at public.kitware.com>
http://public.kitware.com/cgi-bin/mailman/listinfo/midas




--
+1 919 869 8849<tel:%2B1%20919%20869%208849>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/midas/attachments/20131031/e5c1fadc/attachment.html>


More information about the Midas mailing list