Code Monkey home page Code Monkey logo

Comments (6)

hkaraoguz avatar hkaraoguz commented on September 3, 2024

@jayyoung Yes now we also store the history of ROIs as @kunzel requested. Luckily I have also created a service for querying ROIS. You can use the service soma/query_rois for that. But I think there is no option to get the latest roi for each id. I will see how it can be done. Thanks for pointing this out.

from soma.

jayyoung avatar jayyoung commented on September 3, 2024

Yeah that's the service I'm using, I updated everything to use the new methods, but noticed this behaviour.

It'd be really nice to be able to just query the most recent version of all the ROIs with a flag in the service call or something in order to get the current state. Or maybe instead of inserting a new entry into the database entirely when an ROI is updated, just keep the same database entry, but update a vector of the previous poses. So roi.poses[0] gets me the most recent posearray of the ROI, roi.poses[1] gets me the previous posearray, and so on. Not sure what's easiest/best, probably just a flag in the service call.

from soma.

hkaraoguz avatar hkaraoguz commented on September 3, 2024

@jayyoung I have updated the roi query service with the flag returnmostrecent which will return you the most recent versions of rois when set to true. I have also opened a pull request for mongodb_store because the latest version of soma needs to have the updated version of mongodb_store. For an immediate solution you can use this version https://github.com/hkaraoguz/mongodb_store/tree/somaroiupdate

from soma.

jayyoung avatar jayyoung commented on September 3, 2024

Woo awesome! Thank you!

from soma.

hkaraoguz avatar hkaraoguz commented on September 3, 2024

@jayyoung Did you check the functionality? Should we close this issue?

from soma.

jayyoung avatar jayyoung commented on September 3, 2024

Yep sure sorry I only just got around to testing it. It seems to work just fine. Here is the test code I used to verify it in case you care:

import roslib
import rospy
from soma_msgs.msg import SOMAObject
from soma_manager.srv import *


if __name__ == '__main__':
    rospy.init_node('test_masks', anonymous = False)
    print("getting soma service")
    rospy.wait_for_service('/soma/query_rois')
    print("done")
    print("setting up proxy")
    soma_query = rospy.ServiceProxy('/soma/query_rois',SOMAQueryROIs)
    print("done")
    print("making query")

    query = SOMAQueryROIsRequest()
    query.returnmostrecent = True
    response = soma_query(query)

    print("found: " + str(len(response.rois)) + " rois using return_most_recent")
    for roi in response.rois:
        print(roi.id)

from soma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.