Now i would like to identiy the extracted cells in 4 but on the original surface mesh imported.
how can I do this kind of manipulation? i see that each time i apply a filter the ID is recreated, i imagine that beween the original surface mesh and the smoothed one as the number of elements did not change the ID would be the same, but after the threshold there will be less cells, i imagine that there exists a solution to select the original ones from the output of the threshold itself.
in the last step it does, as i am using threshold to get only a part of it. i have found the generateIDs filter that I think will help me do what I wanted (keep the original ID thought the complete pipeline).
well, what I want to do is in the original surface mesh, generate a flag field that will indicate the cells that were āselectedā during the thershold with a 1 and the others with a 0.
how could I do this? i need to pass thought a programmable filter, no? is there any easier way?
Perhaps it does not directly help with the problem, as there is also smoothing involved, but I had a similar issue where I needed to know a certain mesh cell ID after I applied a thresholding filter.
I used a programmable filter before the threshold to add a āoriginal Cell IDā:
import numpy as np
output.CellData.append(np.arange(inputs[0].GetNumberOfCells()), "OrigCellID")
Hello,
what i finally did that did not required extra steps (at least steps that are expensive or repeating data). was to use the find data, that can be used with python with the extract selection.
so, basically:
i identify the IDs that i want to recover on the original data (on the root before doing anything i apply the global id filter to have a constant ID)
set as active filter the one where i want to identify the specific cells
select the respective cells or points using find data using: QuerySelect(QueryString=f'(in1d({fieldName}, {listOfValues}))', FieldType=FieldType, InsideOut=False)
use extract selection filter.
this is an easy workaround without too much extra steps.
yeah, the issue i was having with programmable filter was that i had the list of ids, a list of values as a python object, and outside of hardcoding the values list on the programable filter i was not sure how to do this cleanly. and this was creating a lot of extra data as i was creating a new filter that was copying all the data, getting the specific values then selecting only that, etc. I am pretty lost in regards to programmable filter, pretty sure that it is possible to do it in a ācleanā way but did not find it.
hey @mwestphal , sorry for the tag, but I just upgraded to 6.1 and the querySelect fails as (I dont know why) the format changed from in1d to isin is this normal? i could not find anything about this in the release notes of 6.1
Iām afraid that doesnt ring a bell, this looks like a regression or a behavior change that should have been at least documented. Please open an issue.