<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Here in a nutshell is what I’m trying to do.</div>
<div><br>
</div>
<div>Iterate over (or select from a dropdown widget) a list of directories corresponding to medical imaging exams</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>For the selected directory (exam) select a subdirectory (image series)</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>For the selected series</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>Read in the image</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>interactively define a bounding box in the image using IntRangeSlider</div>
<div><br>
</div>
<div>Since interactive doesn’t block, I can’t work it into a loop. On the other hand, I haven’t been able to get an interactive widget to generate another interactive widget.</div>
<div><br>
</div>
<div>Brian</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Thomas Kluyver <<a href="mailto:takowl@gmail.com">takowl@gmail.com</a>><br>
<span style="font-weight:bold">Reply-To: </span>IPython developers list <<a href="mailto:ipython-dev@scipy.org">ipython-dev@scipy.org</a>><br>
<span style="font-weight:bold">Date: </span>Friday, June 19, 2015 at 12:07 PM<br>
<span style="font-weight:bold">To: </span>IPython developers list <<a href="mailto:ipython-dev@scipy.org">ipython-dev@scipy.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [IPython-dev] Nested and blocking calls of Interact or Interactive<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On 19 June 2015 at 10:20, Brian E Chapman <span dir="ltr">
<<a href="mailto:Brian.Chapman@utah.edu" target="_blank">Brian.Chapman@utah.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>First, is it possible to use interactive in a nested manner. That is, I have one function that I call with interactive and this function in turn calls another function with interactive?</div>
<div><br>
</div>
<div>Second, can you call interactive such that execution is blocked until the widget is closed? For example, I would like to call create/execute an interactive widget within a loop.</div>
</blockquote>
</div>
<br>
</div>
<div class="gmail_extra">Widgets can't pause code, and the kernel won't process widget updates while the kernel is running in the main thread. You could probably hack something together using generators and/or threads to make it look like it was doing that,
but I wouldn't recommend it.<br>
<br>
</div>
<div class="gmail_extra">Can you describe at a higher level what you're trying to do - we might be able to suggest other ways to achieve it.<br>
<br>
</div>
<div class="gmail_extra">Thomas<br>
</div>
</div>
</div>
</div>
</span>
</body>
</html>