Package qupath.lib.projects
Interface Project<T>
- Type Parameters:
- T-
- All Superinterfaces:
- MinimalMetadataStore
Data structure to manage images and associated data in QuPath.
- 
Method SummaryModifier and TypeMethodDescriptionaddDuplicate(ProjectImageEntry<T> entry, boolean copyData) Add an image by duplicating an existing entry.addImage(ImageServerBuilder.ServerBuilder<T> server) Add an image for a particular ImageServer.createSubProject(String name, Collection<ProjectImageEntry<T>> entries) Create a sub-project that provides a view on the specified entries.longRequest a timestamp from when the project was created.Request aProjectImageEntryassociated with anImageDataGet a list of image entries for the project.booleanQuery whether 'true' or masked image names are being returned.longRequest a timestamp from when the project was last synchronized.getName()Get the name of the project.static StringgetNameFromURI(URI uri) Extract a usable project name from a URI.default ResourceManager.Manager<ObjectClassifier<T>> Get a manager for object classifiers saved within this project.getPath()Get a path to this project, or null if this project is not on a local file system.Get an unmodifiable list representing thePathClasses associated with this project.default ResourceManager.Manager<PixelClassifier> Get a manager for pixel classifiers saved within this project.Sometimes projects move (unfortunately).default <S,R extends S> 
 ResourceManager.Manager<R> getResources(String location, Class<S> cls, String ext) Get a manager for objects of a specified class within this project.default ResourceManager.Manager<String> Get a manager for scripts saved within this project.getURI()Get a URI that can be used when saving/reloading this project.The version string for this project, which can be used to distinguish new and older project (which may contain different information).booleanisEmpty()Test if the project contains any images.voidremoveAllImages(Collection<ProjectImageEntry<T>> entries, boolean removeAllData) Remove multiple images from the project, optionally including associated data.voidremoveImage(ProjectImageEntry<?> entry, boolean removeAllData) Remove an image from the project, optionally including associated data.voidsetMaskImageNames(boolean maskNames) Request that entries return masked image names, rather than the 'true' image names.booleansetPathClasses(Collection<? extends PathClass> pathClasses) Update the available PathClasses.voidSave the project.Methods inherited from interface qupath.lib.interfaces.MinimalMetadataStoregetMetadata
- 
Method Details- 
getPathClassesGet an unmodifiable list representing thePathClasses associated with this project.- Returns:
 
- 
getMaskImageNamesboolean getMaskImageNames()Query whether 'true' or masked image names are being returned.- Returns:
- See Also:
 
- 
setMaskImageNamesvoid setMaskImageNames(boolean maskNames) Request that entries return masked image names, rather than the 'true' image names.The purpose of this is to support studies where the user ought not to see the image names during analysis, reducing the potential for user bias. - Parameters:
- maskNames-
- See Also:
 
- 
setPathClassesUpdate the available PathClasses.- Parameters:
- pathClasses-
- Returns:
- trueif the stored values changed, false otherwise.
 
- 
getURIURI getURI()Get a URI that can be used when saving/reloading this project.- Returns:
 
- 
getPreviousURIURI getPreviousURI()Sometimes projects move (unfortunately). This returns the previous URI, if known - which can be helpful for resolving relative paths to images in the event that both project and images have moved together.- Returns:
 
- 
getNameFromURIExtract a usable project name from a URI.- Parameters:
- uri-
- Returns:
 
- 
getVersionString getVersion()The version string for this project, which can be used to distinguish new and older project (which may contain different information).This may be null if the version information is not stored. - Returns:
 
- 
getPathPath getPath()Get a path to this project, or null if this project is not on a local file system.If not null, the path may be a file or a directory. - Returns:
- See Also:
 
- 
createSubProjectCreate a sub-project that provides a view on the specified entries.The retains exactly the same references and data, i.e. it does not duplicate entries or data files - rather it is used to generate projects that provide access to a subset of the entries in the original project. - Parameters:
- name- the name of the sub-project
- entries- the entries to retain within the sub-project
- Returns:
 
- 
isEmptyboolean isEmpty()Test if the project contains any images.- Returns:
 
- 
addImageAdd an image for a particular ImageServer.- Parameters:
- server-
- Returns:
- Throws:
- IOException
 
- 
addDuplicateAdd an image by duplicating an existing entry. This retains the sameImageServerBuilder.ServerBuilder, name, description and metadata, but assigns a new unique ID.- Parameters:
- entry- the entry that should be copied
- copyData- if true, copy existing image data in addition to other properties
- Returns:
- the new entry that has been added to the project
- Throws:
- IOException
 
- 
getEntryRequest aProjectImageEntryassociated with anImageData- Parameters:
- imageData-
- Returns:
 
- 
removeImageRemove an image from the project, optionally including associated data.- Parameters:
- entry-
- removeAllData-
 
- 
removeAllImagesRemove multiple images from the project, optionally including associated data.- Parameters:
- entries-
- removeAllData-
 
- 
syncChangesSave the project.- Throws:
- IOException
 
- 
getImageListList<ProjectImageEntry<T>> getImageList()Get a list of image entries for the project.- Returns:
 
- 
getNameString getName()Get the name of the project.- Returns:
 
- 
getCreationTimestamplong getCreationTimestamp()Request a timestamp from when the project was created.- Returns:
 
- 
getModificationTimestamplong getModificationTimestamp()Request a timestamp from when the project was last synchronized.- Returns:
- See Also:
 
- 
getScriptsGet a manager for scripts saved within this project.- Returns:
- See Also:
 
- 
getObjectClassifiersGet a manager for object classifiers saved within this project.- Returns:
- See Also:
 
- 
getPixelClassifiersGet a manager for pixel classifiers saved within this project.- Returns:
- See Also:
 
- 
getResourcesdefault <S,R extends S> ResourceManager.Manager<R> getResources(String location, Class<S> cls, String ext) Get a manager for objects of a specified class within this project.- Type Parameters:
- S-
- Parameters:
- location- a location relative to the project where the resources should be stored, e.g. "classifiers/pixel classifiers". Projects may use this location in an implementation-dependent way.
- cls- class of the resource to return
- ext- extension to use with the resource. This is used for determining the type. Usually it should be "json".
- Returns:
- a ResourceManager.Managerfor the specified resource, ornullif the project does not support the resource or extension.
- Implementation Note
- the default implementation returns null. Subclasses should override this.
 
 
-