Autodesk Forge Model Derivative API: how to tying geometory in OBJ File with property - forge

I was successful in downloading Geometory Data of Revit Model (following this tutorial).
And I was successful in getting Revit Model Properties (tutorial).
But I can not find key for tying geometory with property.
Anyone know key for tying? or Anyone know how to tie both data ?

The Revit Element UniqueId property is included in the Forge translated result. In the Forge data, it is stored as the externalId.
An example of accessing the Forge information in the viewer in order to transmit changes back to the Revit BIM is provided by the roomedit3d sample:
https://github.com/jeremytammik/roomedit3d
Look at the Roomedit3dTranslationTool implementation:
https://github.com/jeremytammik/roomedit3d/blob/master/www/js/extensions/Roomedit3dTranslationTool.js

Related

Pass search strategy to filter from rest URI

First time using api-platform and Symfony 4 to create an API interface for a MySQL db.
I'm updating an old search interface for the db for which I need to replicate many of the search options. This includes being able to search on a given field using various matching operators/strategies. e.g. starts with, contains exactly equals, etc.
I've set everything up for the api using Annotations.
The #ApiFilter(SearchFilter::class, properties={"fieldname": "strategy"} annotation on my table class works as designed, but I am limited to one-and-only-one strategy per field. I need to be able to pass the strategy to the api search function in the url. something like:
/api/staff?lastname[start]=dav
or
/api/staff?lastname=david&match=contains
or
/api/staff/lastname/son?searchtype=end
would be fine.
I can't figure out how to set this up. Shockingly, to me anyway, this common requirement doesn't seem to be documented at all.
The file CustomSearchFilter.php located at the repo https://github.com/jordonedavidson/custom_search_filter solves this use-case using the
/api/staff?lastname[start]=dav
syntax.
The file was written by Kévin Dunglas (the author of Api Platform) and is presented with his blessing.

Get project ID without using training module on custom vision?

I'm using the Custom Vision API and the sample I found out on github / docs included the training and creation of a project. However, I have done the training and creation part online (http://customvision.ai).
Now in order to predict the image, I need project ID.
endpoint.PredictImage(project.Id, testImage);
Where can I get this one from?
I am only interested in using the Prediction API without having to train from my code.
Your thoughts please.
The simplest way to get the project url from the website is to open the project in a browser and look at the URL; the project id is the GUID listed after /projects: customvision.ai/projects/<ProjectID>#/manage
Or you can call TrainingApi.GetProjects() to retrieve a list of ProjectModel objects, and get the project id you need by checking its properties (like Name or Description).

OpenJpa2.0 How to map Oracle sys.XMLTYPE column to String

I changed Change in persistence.xml
I also changed column definition (columnDefinition="XDB.XMLType") for xml fields
I checked OpenJpa(http://openjpa.208410.n2.nabble.com/Oracle-XMLType-fetch-problems-td6208344.html) site and IBM (http://www.ibm.com/support/knowledgecenter/SS7J6S_7.5.0/com.ibm.wsadapters.jca.jdbc.doc/env/doc/rjdb_problemsolutions.html)
My env is OpenJpa 2.0 and WAS 7
its throwing exception
org.apache.openjpa.persistence.PersistenceException: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.XMLTYPE", line 169
Please suggest without changing OpenJpa2.0 as its part of IBM WebSphere Application Server V7.0 how can i handle sys.XMLTYPE data, i am migrating my application from db2 to Oracle in same environment.
Writing XML data can be tricky some times! Getting the correct drivers and things defined properly can have its challenges. I can not say exactly what you need to do given the lack of info on your domain model and such, but let me give some general things to look for. First, there is an XML test in the OpenJPA test framework if you want to make reference to it. It can be seen publicly here:
https://apache.googlesource.com/openjpa/+/refs/heads/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/
Or, another test using an "XMLValueHandler" (likely this is beyond the scope of what you are looking for):
https://apache.googlesource.com/openjpa/+/refs/heads/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/
Second, (stating the obvious) I assume you have a column in Oracle defined as "XMLTYPE". Also, I see you are using schema SYS. I'm sure you are aware but this is a system/admin schema......just for sanity sake you might want to first get things running using a non-system/admin schema just so we don't get hung up with any issues with your OpenJPA client not having the correct permissions.
Next, you need the following definition:
#Lob #Basic
#Column(name = "ANXMLCOLUMN", columnDefinition="XMLCOLUMN XMLType")
private String anXMLString;
The #Lob I think will be necessary if you are using data greater than 4000 chars (this was mentioned in one of the comments). To start I'd use a very small set of data (a couple characters), once that works, then experiment with > 4k.
Next, make sure to use the correct JDBC driver. The last time I experimented with an XMLType I used the Oracle JDBC 11.2.0.2 driver.
Finally, you might need to use the property "openjpa.jdbc.DBDictionary" with value "oracle(supportsSetClob=true,maxEmbeddedClobSize=-1)". Again, experiment with this AND look at the OpenJPA documentation on these properties to determine if they are necessary in your scenario. I think the supportsSetClob=true will only be necessary for older version (pre-2.2.x) of OpenJPA. You might also need to use property "openjpa.jdbc.SchemaFactory" with value "native". I would suggest you first try without either or these two properties. If that doesn't help, then experiment with these two properties. I know this is vague, but I don't know what your DDL or domain model looks like so I have to keep in vague.
Thanks,
Heath Thomann

Searching a DICOM server for metadata

I want to search the DICOM server. if for example user enters a patient id to serach, then my app populate a table with all the metadata relating to that id , such as id, name, accession number e.tc. if tha study id exists in the dicom server, How can this be done using dcm4chee kit. –
You can use dcm4che3 tool dcm4che-tool-findscu. This code shows you how to do a C-FIND against a PACS (or whatever implementing C-FIND as SCP).
FindSCU.java is quite clear, take a while and don't get missed through Apache Commons CLI code to understand input from console. Most of CLI management code is not in this project, but you can find it in the dcm4che3 tool dcm4che-tool-common project, org.dcm4che3.tool.common.CLIUtils.java class.
Take into account following considerations:
Specify the search level of Query/Retrieve. You can use several search levels in order to match attributes into a PACS. If you look at lines 260:265 of FindSCU.java, you will see that you can manage four different levels: PATIENT|STUDY|SERIES|IMAGE.This will instruct C-FIND SCP how to search matching attributes.
Tell C-FIND SCP what attributes do you want to retrieve. If you want to search studies to be retrieved later, you must ask for 0020, 000D Study​InstanceUID tag.
Of course, add all attributes that you want to populate your table.
Use retrieved 0020, 000D Study​InstanceUID tag value to do the C-GET/C-MOVE operation.
You can see how to configure attribute keys to do C-FIND SCU into CLIUtils.java class that is part of dcm4che3 tool dcm4che-tool-common project. See CLIUtils.addAttributes(Attributes, String[]).
Hope it helps!
Edit
Due to you comment you are using dcm4che2 and that you already have a DicomObject with the search result, if you want to obtain metadata from this DicomObject you must parse it before, using DicomInputStream, and then you can use getXXXX(Tag) from BasiDicomObject, something like this:
DicomObject dcmObj;
DicomInputStream dis = null;
dis = new DicomInputStream(file);
dcmObj = dis.readDicomObject();
String someVar = dcmObj.getString(Tag.SeriesInstanceUID);
Keep in mind, some attributes are inside sequences, and thus you have to search it before.
You can also take a look into dcm4che-tool-dcm2txt, you will see Dcm2Txt.java and in lines 170 and so on, there is how to parse whole dicom object.
If you need some general description about the DICOM network protocol, you could read the "Understanding DICOM with Orthanc" guide, and more specifically the section about C-Find.

What is job.get() and job.getBoolean() in mapreduce

I am working on pdf document clustering over hadoop so I am learning mapreduce by reading some examples on internet.In wordcount examples have lines
job.get("map.input.file")
job.getboolean()
What is function of these functions?what is exactly map.input.file where is it to set? or is it just a name given to input folder?
Please post answer if anyone know.
For code see the following link
wordcount 2.0 example=http://hadoop.apache.org/docs/r1.0.4/mapred_tutorial.html
These are job configurations. i.e. set of configurations which are passed on to each mapper and reducer. Now, these configurations consist of well defined mapreduce/hadoop related configurations as well as user-defined configurations.
In your case, map.input.file is a pre-defined configuration and yes it is set to a comma separated list of all the paths you have set as input path.
While wordcount.skip.patterns is a custom configuration which is set as per user's input, and you may see this configuration to be set in run() as follows:
conf.setBoolean("wordcount.skip.patterns", true);
As for when to use get and when to use getBoolean, it should be self-explanatory, as whenever you want to set a value of type boolean you will use getBoolean and setBoolean to get and set the specific config value respectively. Similarly you have specific methods for other data types as well. If it is string then you may use get().

Resources