-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return paths of downloaded files? #151
Comments
@CPBridge this is an interesting idea. As always, it is the question of whether improving convenience for one use case would not make things worse for other use cases. What if you download a million of series? What would you expect if the series you downloaded is multi-instance? |
When I made this suggestion I was thinking of adding the return values just to Still, even in the case where you are downloading a long list of studies/series/instances, you could just ignore the returned file paths if you don't want them and the time/memory taken to return them list would be pretty negligible. I do not think it would make sense to add return values for the methods that are clearly intended for "bulk" download, such as Just a thought. Another option would be to add a function to get the paths for a given previously-downloaded study/series/instance given the |
I think the challenge is that there is no easy way to say whether a certain API is used in bulk mode or not. I guess we could have a parameter that would return that list of the number of series is below some threshold. Convenience function would be perhaps less confusing, but then the user would need to maintain reference of the Note that there is nothing to prevent the user from using I have to say, I feel like it is easier to leave it to the user to traverse the folder hierarchy. Or maybe handle in a new or revised API endpoint somehow. |
Yes, good points. Perhaps if we do anything, it would be easier to add new methods, as you suggest. At the risk of creating a confusing/bloated API of course |
I have been working with
idc-index
a bit recently, and there's one thing I find a bit frustrating.I often have a workflow where I want to download an instance or series and then immediately read it in using pydicom in the following line. However, because the file gets downloaded into a tree-like structure (that I understand is controlled by the
dirTemplate
), I often have to go globbing or iterating through directories to find the files I just downloaded.I think it would be a nice feature if the "download" methods returned a list of filepaths (as
str
s or aspathlibs.Path
s, I preferPath
s personally) so that you could instantly load in the file(s).That would allow me to replace code like this:
with this
Alternatively/additionally we could even add methods that download files into a temporary directory and load them into memory immediately, though this would require adding pydicom as a dependency.
What do you think @fedorov ?
The text was updated successfully, but these errors were encountered: