New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Input filter enhancement] Adjusting input filter in node controller #243
Comments
Yes but it works with your second pipeline too
Yes you can use export to database_scans instead of export plug and set as inputs your database. This comes to the same thing.
Finally it is indeed an issue of comprehension of the brick. When you set the filter from right click Then, to me, it is very illogical that I guess you understand it the other way, you set the inputs because you want to filter your inputs, but as a consequence when you filter inputs from the controller, your input are set to your filtered files and your output remains empty (whereas using right click open filter set the database as input and your filtered files as output) |
After discussion in private message with @LStruber, we thought it would be good to remove the The Input_filter brick must also allow to take as input either the whole database (right click In summary, to close this ticket, we need to:
Any remarks or comments on this roadmap are welcome! |
OK I understand, it's a user interface issue. |
I'm trying to change this... |
or inputs connected to the output of another node (#243)
OK I have removed the |
I finally found some peace to come back to this ticket! So great @denisri, your codes change exceeds what we imagined with @LStruber !!! Effectively it is also necessary to remove However, when I start working on the rest of the ticket I notice that there is still a |
Okay, I agree with this idea. I'll see what can be done in that direction. There is an aesthetic side to it! A simple QPushButton? The chosen solution has to be adaptable to a resizing of the node by the user ... I'll take any good ideas on the subject. |
The more I think about user friendly access to the filter in the Input_Filter brick, the more I think the best solution would be, as @LStruber suggested, to have exceptionally a |
I spent some time on this part today and the least we can say is that the fix is not trivial because if we want to do things correctly we have to move on the old chestnut of the initialisation and indexing of the database with "the data of the future". Indeed, we are currently indexing the database at the initialisation time when the outputs do not yet exist. This is very bad and it would be best to index the database at runtime and to do it really well when each process has finished running. Especially for this part of the ticket it is currently not possible to filter on the input of the Input_filter brick/node when this plug is connected to an output of another brick because the indexing of the database is currently done after the initialisation of the whole pipeline. This means that the Input_filter brick is only really useful (functional) if it is connected directly to the database, which greatly reduces the usefulness of the Input_filter brick... The only way I can see to deal with this part of the ticket would be to make some fairly major changes:
As these changes will be important, I think we have to think about it before we start. All suggestions, remarks, ideas, discussions on this topic are welcome! |
I looked a bit into this issue this afternoon and I've a concern about it.
In my opinion, it is then not easy to index database after completion of each brick (either in initialisation or before run). To do that, we would need to :
I need to think a bit more about the third solution to know if it would be possible/interesting/necessary or whatever. I hope I've been clear, but not sure ! |
Yes, it is very clear ... that it is not very easy to index the database after each node/process initialisation! However, this is the only solution if you want to be able to use the Input_filter brick in all cases (and especially if we want to filter a brick input linked to the output of another brick). .. Or we can decide to filter only from the database (which already works), but this removes a major interest from the filtering of the brick input (we can already do it without the Input_filter brick, with the Filter button in the controller!). If my memories are good (it's getting old) in V1 it worked because we initialised each brick one after the other with indexing after each initialisation. I admit that the code of this part in V1 was not very elegant and that in V2 the method is much more readable and elegant... However, it would be a shame to lose this feature (the possibility to filter all entries, not only those coming from the database!). However I am confident !!!! From the discussion will come the light! |
I didn't know the input filter brick was expected to work when connected to the output of another filter, so I didn't run into this problem. However it's certainly an interesting feature... |
In fact I have the impression that this is the case for all the bricks in a pipeline (except the first one which is linked to the database). Except for the first brick linked to the database, all bricks receive inputs from the future at the time of completion or initialisation (including the indexing of outputs) as we currently produce it. The only difference for the Input_filter brick is that for this one we don't do any calculation with the inputs, we just proceed to a filtration of these data coming from the future for the next brick. I also have the feeling that the indexing step should be integrated at the time of completion (inside the completion system), it would be done in a temporary database that would allow the user to visualise the state of the database expected after the run step (we thus fulfill one of the goals of the initialisation step which is to control, as much as possible, that everything should be fine at the time of the run.
I stay convinced that the persistent database should only be definitively indexed after each (successful) calculation for each brick ... or at least as close as possible to that ... So I think that using an ephemeral database for the initialisation step is the best method (at least at the current state of our thought !) Anyway, the same issue will occur at run time, if we don't index after each brick that has been run (the Input_filter brick won't be able to filter if the input data are not in the database) .... I think we are really discussing a deep concept for mia here. There are several opened tickets that are not at all trivial, that require thought, discussions and that are ultimately very strongly connected. Without listing them all, there is for example a ticket where we can ask ourselves for the feasibility of having only one database for all the tabs opened in the editor (#150)... If we initialise all the pipelines in all the opened tabs and then launch a run on one of the initialised tabs, I think that it could go wrong with the current functioning ... To do it right we should try to deal with these tickets together and find a solution that satisfies everyone and allows to answer all these tickets (which I believe are very strongly connected!) ... Anyway, let's come back to this particular ticket ... We currently have a problem with the initialisation which could be fixed with the use of a temporary database and an indexing integrated in the completion step (one brick after the other). However it is not impossible that we find a trick to achieve this !!!! Or as I said, there is also the easy solution which would be to consider that the Input_filter brick has a real interest only when linked to the data base (it already works!) |
I have just removed the automatic generation of the output plug value in the Input_filter brick when we make the filter definition (Open filter). |
Just a little point on what we have to do (independently of the substantive discussions undertaken):
As there are several points still to be settled in this ticket, we could close it and open several specific ones (it might get messy if we mix up the discussion and the specific points to be dealt with) ? |
I did not even think to that before... It brings me to a question, which might be silly since I did not dig into mia_processes so far. Why this particular brick fail to complete its outputs from its inputs (when they are not yet created in the database), while other bricks manage to do it ? Wouldn't it be possible to change only the brick functioning (mimicking other bricks) to solve this particular issue ? (not talking about when initializing). Filtering "from inputs" instead of "from database". Regarding your comment, ok for splitting thie issue in different ones. |
During the initialisation (see the list_outputs method of the bricks) the Input_filter process queries the database whereas for all other processes it is only a parameter completion step. The inputs retrieves the outputs of the previous brick and the outputs is determined by completion. |
And what prevent us to do "only a parameter completion step" for the input_filter brick ? |
There is a notable difference however: most (all, actuallly) other nodes perform completion based either on filenames (strings) given as some of their (input) parameters (like nipype nodes), or on a set of attributes (strings also) possibly given by a database, or by filenames parsing, or by another means, but which are given as a dictionary of strings: the database itself is not mandatory and is only used upstream to get either filenames or attributes dicts. The input filter node is different in the way that it is using directly a database (files already available in a database, even if they are not existing files), which makes the database mandatory, and needs it to be available, and up-to-date during completion. This is probably not a problem but this particular node has thus a specific requirement for completion, which other nodes do not have. |
in this case we lose the Input_Filter brick interest. Finally, the interest as we defined it almost at the beginning of mia. Maybe it is time to redefine some things, needs? |
I completely agree, the fundamental difference of the Input_filter brick is that it needs an updated database for all the i/o of the previous bricks ... and that there is not really any completion to do at the initialisation since we can even consider that the goal of this brick is precisely to do the completion for the output ... |
For me I see the job of the input filter being precisely to perform completion. It is a specific completion, but can take place within the existing completion framework. It only performs its job during completion, and has no runtime work. This way the current infrastructure and way we operate doesn't need to change (or, not much). The only things would be to:
Unless we want it to do its job at runtime, but then we enter the world of "dynamic pipelines" where parameters, and iterations could change during runtime, but this schema is not supported for now, and would question any initialization anyway - we are not on this field for now. |
This is another, perhaps clearer, way of saying:
I don't think we want to enter the world of "dynamic pipelines". I think we have a deterministic view of how the pipeline works. At the beginning we can already know everything that will happen, we don't have in mind a functioning where the parameters and initialisations could change along the way. However, we can consider that the runtime will be identical to the initialisation, we say that the runtime does not change because it has already been done during the initialisation... Well, I think I'm splitting hairs here and we have something else to do. The main thing is that I think we agree on what we want and how to get there! |
as discussed in #243, the filter is confusing.
I have removed the filter button for file parameters inside a list. I could not distinguish between lists which can use the filter and those which should not (outputs and inputs connected to upstream outputs) since in individual file editors we don't have the context of the parent list. But I guess the filter is mainly useful at list level, when a list is involved. |
Cool ! I think this is exactly what we needed! |
or inputs connected to the output of another node (#243)
as discussed in #243, the filter is confusing.
When you create a pipeline, you sometimes want to filter your database by a tag, or a patient name etc. There is a tool in MIA to do that: the input filter (which is automatically added to the pipeline, in iteration modes 2 and 3).
In the documentation, it is indicated that you select outputs of the filter by right clicking on it and selecting your desired keywords etc. in the opened window. Your filtered files are indicated in the "outputs" field of the input filter in the node controller. If you initialize, everything is working. No issue here.
However, one might expect that the filter button next to the outputs field in the node controller perform exactly the same action, since you would click here to filter your outputs of the input filter. And when you try to filter outputs with this button, it seems to work (filtered files are indicated in the "outputs" field of the node controller as previously), but when you initialize, the output field is reset to "all files in the database" and initialization is performed on all the database ! This is not a desirable behavior.
Minimum steps to reproduce:
The outputs are reset to all your project database, and in data browser the path of all database smoothed files are created.
The text was updated successfully, but these errors were encountered: