[−][src]Struct orthanc::Client
Client type
The client itself is fairly simple. There are only 3 fields that the end-user should care
about: server
(the address of the Orthanc server, an HTTP(S) URL), username
and password
.
Creating a new client instance:
let client = Client::new("http://localhost:8042".to_string());
Authentication (setting username
/password
) can be done by calling the auth
method:
client.auth("username".to_string(), "password".to_string());
Or combined:
let client = Client::new("http://localhost:8042".to_string()) .auth("username".to_string(), "password".to_string());
Implementations
impl Client
[src]
pub fn new(server: String) -> Client
[src]
Creates a new client instance
let client = Client::new("http://localhost:8042".to_string());
pub fn auth(self, username: String, password: String) -> Client
[src]
Adds authentication to the client instance
let client = Client::new("http://localhost:8042".to_string()) .auth("username".to_string(), "password".to_string());
pub fn modalities(&self) -> Result<Vec<String>, Error>
[src]
List modalities
pub fn patients(&self) -> Result<Vec<String>, Error>
[src]
List patients
pub fn studies(&self) -> Result<Vec<String>, Error>
[src]
List studies
pub fn series_list(&self) -> Result<Vec<String>, Error>
[src]
List series
pub fn instances(&self) -> Result<Vec<String>, Error>
[src]
List instances
pub fn modalities_expanded(&self) -> Result<HashMap<String, Modality>, Error>
[src]
List all modalities in an expanded format
pub fn patients_expanded(&self) -> Result<Vec<Patient>, Error>
[src]
List all patients in an expanded format
pub fn studies_expanded(&self) -> Result<Vec<Study>, Error>
[src]
List all studies in an expanded format
pub fn series_expanded(&self) -> Result<Vec<Series>, Error>
[src]
List all series in an expanded format
pub fn instances_expanded(&self) -> Result<Vec<Instance>, Error>
[src]
List all instances in an expanded format
pub fn patient(&self, id: &str) -> Result<Patient, Error>
[src]
Get a patient by its ID
pub fn study(&self, id: &str) -> Result<Study, Error>
[src]
Get a study by its ID
pub fn series(&self, id: &str) -> Result<Series, Error>
[src]
Get a series by its ID
pub fn instance(&self, id: &str) -> Result<Instance, Error>
[src]
Get an instance by its ID
pub fn instance_tags(&self, id: &str) -> Result<Value, Error>
[src]
Get all DICOM tags of an instance in a simplified format
See related Orthanc documentation section for details
pub fn instance_tags_expanded(&self, id: &str) -> Result<Value, Error>
[src]
Get all DICOM tags of an instance in an expanded format
See related Orthanc documentation section for details
pub fn instance_content(&self, id: &str) -> Result<Vec<String>, Error>
[src]
Get all DICOM tags' codings of an instance
Returns a Vec<String>
of the following format: ["0008-0018", "0040-0260", "0040-0254"]
pub fn instance_tag(&self, id: &str, tag: &str) -> Result<String, Error>
[src]
Get the value of a specific DICOM tag of an instance
tag
is the DICOM tag coding, e.g. 0008-0018
pub fn patient_dicom<W: Write>(
&self,
id: &str,
writer: &mut W
) -> Result<(), Error>
[src]
&self,
id: &str,
writer: &mut W
) -> Result<(), Error>
Download a patient as a collection of DICOM files
Accepts a mutable reference to an object, that implements a Write
trait, and mutates the
object, writing the data into it in a streaming fashion.
Streamed data is a ZIP archive
Example:
let mut file = fs::File::create("/tmp/patient.zip").unwrap(); client().patient_dicom("3693b9d5-8b0e2a80-2cf45dda-d19e7c22-8749103c", &mut file).unwrap();
pub fn study_dicom<W: Write>(
&self,
id: &str,
writer: &mut W
) -> Result<(), Error>
[src]
&self,
id: &str,
writer: &mut W
) -> Result<(), Error>
Download a study as a collection of DICOM files
Accepts a mutable reference to an object, that implements a Write
trait, and mutates the
object, writing the data into it in a streaming fashion.
Streamed data is a ZIP archive
Example:
let mut file = fs::File::create("/tmp/study.zip").unwrap(); client().study_dicom("3693b9d5-8b0e2a80-2cf45dda-d19e7c22-8749103c", &mut file).unwrap();
pub fn series_dicom<W: Write>(
&self,
id: &str,
writer: &mut W
) -> Result<(), Error>
[src]
&self,
id: &str,
writer: &mut W
) -> Result<(), Error>
Download a series as a collection of DICOM files
Accepts a mutable reference to an object, that implements a Write
trait, and mutates the
object, writing the data into it in a streaming fashion.
Streamed data is a ZIP archive
Example:
let mut file = fs::File::create("/tmp/series.zip").unwrap(); client().series_dicom("3693b9d5-8b0e2a80-2cf45dda-d19e7c22-8749103c", &mut file).unwrap();
pub fn instance_dicom<W: Write>(
&self,
id: &str,
writer: &mut W
) -> Result<(), Error>
[src]
&self,
id: &str,
writer: &mut W
) -> Result<(), Error>
Download an instance as a DICOM file
Accepts a mutable reference to an object, that implements a Write
trait, and mutates the
object, writing the data into it in a streaming fashion.
Example:
let mut file = fs::File::create("/tmp/instance.dcm").unwrap(); client().instance_dicom("3693b9d5-8b0e2a80-2cf45dda-d19e7c22-8749103c", &mut file).unwrap();
pub fn delete_patient(&self, id: &str) -> Result<RemainingAncestor, Error>
[src]
Delete a patient
pub fn delete_study(&self, id: &str) -> Result<RemainingAncestor, Error>
[src]
Delete a study
pub fn delete_series(&self, id: &str) -> Result<RemainingAncestor, Error>
[src]
Delete a series
pub fn delete_instance(&self, id: &str) -> Result<RemainingAncestor, Error>
[src]
Delete an instance
pub fn echo(&self, modality: &str, timeout: Option<u32>) -> Result<(), Error>
[src]
Send a C-ECHO request to a remote modality
If no error is returned, the request was successful
pub fn store(&self, modality: &str, ids: &[&str]) -> Result<StoreResult, Error>
[src]
Send a C-STORE request to a remote modality
ids
is a slice of entity IDs to send. An ID can signify either of Patient, Study, Series
or instance
pub fn anonymize_patient(
&self,
id: &str,
anonymization: Option<Anonymization>
) -> Result<ModificationResult, Error>
[src]
&self,
id: &str,
anonymization: Option<Anonymization>
) -> Result<ModificationResult, Error>
Anonymize a patient
pub fn anonymize_study(
&self,
id: &str,
anonymization: Option<Anonymization>
) -> Result<ModificationResult, Error>
[src]
&self,
id: &str,
anonymization: Option<Anonymization>
) -> Result<ModificationResult, Error>
Anonymize a study
pub fn anonymize_series(
&self,
id: &str,
anonymization: Option<Anonymization>
) -> Result<ModificationResult, Error>
[src]
&self,
id: &str,
anonymization: Option<Anonymization>
) -> Result<ModificationResult, Error>
Anonymize a series
pub fn anonymize_instance<W: Write>(
&self,
id: &str,
anonymization: Option<Anonymization>,
writer: &mut W
) -> Result<(), Error>
[src]
&self,
id: &str,
anonymization: Option<Anonymization>,
writer: &mut W
) -> Result<(), Error>
Anonymize an instance
Accepts a mutable reference to an object, that implements a Write
trait, and mutates the
object, writing the data into it in a streaming fashion.
Example:
let mut file = fs::File::create("/tmp/anonymized_instance.dcm").unwrap(); client().anonymize_instance("3693b9d5-8b0e2a80-2cf45dda-d19e7c22-8749103c", None, &mut file).unwrap();
pub fn modify_patient(
&self,
id: &str,
modification: Modification
) -> Result<ModificationResult, Error>
[src]
&self,
id: &str,
modification: Modification
) -> Result<ModificationResult, Error>
Modify a patient
pub fn modify_study(
&self,
id: &str,
modification: Modification
) -> Result<ModificationResult, Error>
[src]
&self,
id: &str,
modification: Modification
) -> Result<ModificationResult, Error>
Modify a study
pub fn modify_series(
&self,
id: &str,
modification: Modification
) -> Result<ModificationResult, Error>
[src]
&self,
id: &str,
modification: Modification
) -> Result<ModificationResult, Error>
Modify a series
pub fn modify_instance<W: Write>(
&self,
id: &str,
modification: Modification,
writer: &mut W
) -> Result<(), Error>
[src]
&self,
id: &str,
modification: Modification,
writer: &mut W
) -> Result<(), Error>
Modify an instance
Accepts a mutable reference to an object, that implements a Write
trait, and mutates the
object, writing the data into it in a streaming fashion.
Example:
let mut file = fs::File::create("/tmp/modified_instance.dcm").unwrap(); let modification = Modification { replace: None, remove: vec!["PatientName"], force: false, }; client().modify_instance("3693b9d5-8b0e2a80-2cf45dda-d19e7c22-8749103c", modification, &mut file).unwrap();
pub fn upload(&self, data: &[u8]) -> Result<UploadResult, Error>
[src]
Upload a DICOM file to Orthanc
let data = fs::read("/tmp/instance.dcm").unwrap(); let client = Client::new("http://localhost:8042"); client.upload(&data).unwrap();
pub fn create_modality(
&self,
name: &str,
modality: Modality
) -> Result<(), Error>
[src]
&self,
name: &str,
modality: Modality
) -> Result<(), Error>
Create a modality
pub fn modify_modality(
&self,
name: &str,
modality: Modality
) -> Result<(), Error>
[src]
&self,
name: &str,
modality: Modality
) -> Result<(), Error>
Modify a modality
pub fn delete_modality(&self, name: &str) -> Result<(), Error>
[src]
Delete a modality
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,