Searching for labels

Greetings!

I’m having some trouble making the /tools/find endpoint behave as I expect it to.

First of all, I have uploaded some sample data into Orthanc. To the study I have attached a label, as shown here:

# curl -u orthanc:orthanc -XGET localhost:8042/studies/
[
   "ac24aa8f-538c0743-cee99f2b-20f6050a-ac0adae6"
]
# curl -u orthanc:orthanc -XGET localhost:8042/studies/ac24aa8f-538c0743-cee99f2b-20f6050a-ac0adae6/labels
[
   "projectdingo"
]

My end goal is to use the REST API to search for all studies labeled a certain way. However, no matter how I constrain my label searching, the study is always returned. Observe below, how i search for nonexistantlabel and the study still appears:

curl -uorthanc:orthanc \
  --request POST \
  --url http://localhost:8042/tools/find \
  --data '{
            "Level" : "Study",
            "Label" : ["nonexistantlabel"],
            "LabelsConstraint" : "All",
            "Query" : { }
          }'
[
   "ac24aa8f-538c0743-cee99f2b-20f6050a-ac0adae6"
]

I have tried various permutations, making the Label value a string rather than an array, mixing it up with Any, All and None, but everything ends in the study being returned when it shouldn’t.

What am I missing here?

Version: docker.io/orthancteam/orthanc:24.6.2

Cheers,
-R

Hello and welcome!

Blockquote
What am I missing here?

An ‘s’ here:

"Labels" : ["nonexistantlabel"],

HTH,

Thank you!

And yeah, that ‘s’ was just the thing. Thanks again!

-R

1 Like