Potential bug in slicer 4.6.2

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Potential bug in slicer 4.6.2

Matthew Anthony Mouawad

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ

Slicer_25516_20170227_110028 - 4.6.2.log (9K) Download Attachment
mainFunctionForScript.txt (1K) Download Attachment
parameters For Script.txt (716 bytes) Download Attachment
Slicer_25516_20170227_102831.log (156K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Andrey Fedorov-2
Try setting "Prefer executable CLIs"

Inline image 1

On Mon, Feb 27, 2017 at 12:06 PM, Matthew Anthony Mouawad <[hidden email]> wrote:

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Andras Lasso-2
In reply to this post by Matthew Anthony Mouawad

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [mailto:[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Matthew Anthony Mouawad
In reply to this post by Matthew Anthony Mouawad

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [mailto:[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Andras Lasso-2
In reply to this post by Matthew Anthony Mouawad

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Matthew Anthony Mouawad
In reply to this post by Matthew Anthony Mouawad
Thanks for looking at it and giving the tips. Couple questions

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

In 4.5.0-1 I did not have that high memory usage ever. 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

Thanks for your help so far


-------- Original message --------
From: Andras Lasso <[hidden email]>
Date: 2017-02-27 22:21 (GMT-05:00)
To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Andras Lasso-2
In reply to this post by Matthew Anthony Mouawad

> Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

Yes, they are quite different. ROI selection only affects sampling, while larger input volumes make everything slower, for example resampling (that is I think performed after each registration phase). For example, if you don’t crop the volume then registration takes 150sec for non-cropped inputs; 80sec for cropped inputs.

 

> In 4.5.0-1 I did not have that high memory usage ever. 

 

ITK and BRAINS is constantly improved. Usually the goal is to improve registration accuracy and memory use and performance are secondary. Hans Johnson can comment on what and how exactly changed since November 2016 and what justified the changes.

 

> In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

I didn’t experience any lockup. How much physical memory do you have and how much virtual memory have you configured?

 

> The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

We always use sampling because using more than 5-10% of the voxels usually don’t improve results considerably. I got visually nice results using 5% (Percentage of samples: 0.05).

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 27, 2017 22:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Thanks for looking at it and giving the tips. Couple questions

 

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

In 4.5.0-1 I did not have that high memory usage ever. 

 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

Thanks for your help so far

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 22:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Training Data

fred nightser
Hi,
I am a new user here and going through training modules and seeing that some of the presentations that have links in them for training data are no longer valid. Is there a place where such data is placed. One in particular I'm trying to do is the Dose Accumulation for Adaptive Radiotherapy. Upon opening up presentation and seeing link for data, you get page not found when clicking on link for data.
Thanks in advance for any help with this.

Fred





_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Matthew Anthony Mouawad
In reply to this post by Matthew Anthony Mouawad
In terms of memory I have 16gb physical and if I recall about 32 virtual but may be wrong. 

I understand that for a lot of cases using a low sampling is fine but when the difference between images becomes much larger higher sampling may be needed. As of now, I can't really change the default sampling without getting an exception from brainsfit. 

I'm surprised that you were able to successfully preform a registration using the parameters I sent. On two different systems it doesn't work for me (whereas the exact same settings in 4.5.0-1 work just fine). 


-------- Original message --------
From: Andras Lasso <[hidden email]>
Date: 2017-02-27 23:04 (GMT-05:00)
To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

> Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

Yes, they are quite different. ROI selection only affects sampling, while larger input volumes make everything slower, for example resampling (that is I think performed after each registration phase). For example, if you don’t crop the volume then registration takes 150sec for non-cropped inputs; 80sec for cropped inputs.

 

> In 4.5.0-1 I did not have that high memory usage ever. 

 

ITK and BRAINS is constantly improved. Usually the goal is to improve registration accuracy and memory use and performance are secondary. Hans Johnson can comment on what and how exactly changed since November 2016 and what justified the changes.

 

> In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

I didn’t experience any lockup. How much physical memory do you have and how much virtual memory have you configured?

 

> The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

We always use sampling because using more than 5-10% of the voxels usually don’t improve results considerably. I got visually nice results using 5% (Percentage of samples: 0.05).

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 27, 2017 22:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Thanks for looking at it and giving the tips. Couple questions

 

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

In 4.5.0-1 I did not have that high memory usage ever. 

 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

Thanks for your help so far

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 22:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Andras Lasso-2
In reply to this post by Matthew Anthony Mouawad

I’ve registered using default “General registration (BRAINS)” module settings, just changed those parameters that I described. You can adjust sampling rate by “Percentage of samples” parameter. Have you tried registration using the GUI, setting the parameters that I recommended?

 

The amount of memory you have should be enough.

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 28, 2017 7:16
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

In terms of memory I have 16gb physical and if I recall about 32 virtual but may be wrong. 

 

I understand that for a lot of cases using a low sampling is fine but when the difference between images becomes much larger higher sampling may be needed. As of now, I can't really change the default sampling without getting an exception from brainsfit. 

 

I'm surprised that you were able to successfully preform a registration using the parameters I sent. On two different systems it doesn't work for me (whereas the exact same settings in 4.5.0-1 work just fine). 

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 23:04 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

> Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

Yes, they are quite different. ROI selection only affects sampling, while larger input volumes make everything slower, for example resampling (that is I think performed after each registration phase). For example, if you don’t crop the volume then registration takes 150sec for non-cropped inputs; 80sec for cropped inputs.

 

> In 4.5.0-1 I did not have that high memory usage ever. 

 

ITK and BRAINS is constantly improved. Usually the goal is to improve registration accuracy and memory use and performance are secondary. Hans Johnson can comment on what and how exactly changed since November 2016 and what justified the changes.

 

> In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

I didn’t experience any lockup. How much physical memory do you have and how much virtual memory have you configured?

 

> The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

We always use sampling because using more than 5-10% of the voxels usually don’t improve results considerably. I got visually nice results using 5% (Percentage of samples: 0.05).

 

Andras

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 22:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Thanks for looking at it and giving the tips. Couple questions

 

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

In 4.5.0-1 I did not have that high memory usage ever. 

 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

Thanks for your help so far

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 22:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Steve Pieper-2
In reply to this post by Matthew Anthony Mouawad
Hi Matthew - 

Would you be able to create a small self contained test script using public sample data that demonstrates the issues you are seeing?  That would help the investigation.

Best,
Steve

On Tue, Feb 28, 2017 at 7:16 AM, Matthew Anthony Mouawad <[hidden email]> wrote:
In terms of memory I have 16gb physical and if I recall about 32 virtual but may be wrong. 

I understand that for a lot of cases using a low sampling is fine but when the difference between images becomes much larger higher sampling may be needed. As of now, I can't really change the default sampling without getting an exception from brainsfit. 

I'm surprised that you were able to successfully preform a registration using the parameters I sent. On two different systems it doesn't work for me (whereas the exact same settings in 4.5.0-1 work just fine). 


-------- Original message --------
From: Andras Lasso <[hidden email]>
Date: 2017-02-27 23:04 (GMT-05:00)
To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

> Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

Yes, they are quite different. ROI selection only affects sampling, while larger input volumes make everything slower, for example resampling (that is I think performed after each registration phase). For example, if you don’t crop the volume then registration takes 150sec for non-cropped inputs; 80sec for cropped inputs.

 

> In 4.5.0-1 I did not have that high memory usage ever. 

 

ITK and BRAINS is constantly improved. Usually the goal is to improve registration accuracy and memory use and performance are secondary. Hans Johnson can comment on what and how exactly changed since November 2016 and what justified the changes.

 

> In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

I didn’t experience any lockup. How much physical memory do you have and how much virtual memory have you configured?

 

> The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

We always use sampling because using more than 5-10% of the voxels usually don’t improve results considerably. I got visually nice results using 5% (Percentage of samples: 0.05).

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 27, 2017 22:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Thanks for looking at it and giving the tips. Couple questions

 

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

In 4.5.0-1 I did not have that high memory usage ever. 

 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

Thanks for your help so far

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 22:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Matthew Anthony Mouawad
In reply to this post by Matthew Anthony Mouawad
I will try your method when I get to work but 


-------- Original message --------
From: Andras Lasso <[hidden email]>
Date: 2017-02-28 07:21 (GMT-05:00)
To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

I’ve registered using default “General registration (BRAINS)” module settings, just changed those parameters that I described. You can adjust sampling rate by “Percentage of samples” parameter. Have you tried registration using the GUI, setting the parameters that I recommended?

 

The amount of memory you have should be enough.

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 28, 2017 7:16
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

In terms of memory I have 16gb physical and if I recall about 32 virtual but may be wrong. 

 

I understand that for a lot of cases using a low sampling is fine but when the difference between images becomes much larger higher sampling may be needed. As of now, I can't really change the default sampling without getting an exception from brainsfit. 

 

I'm surprised that you were able to successfully preform a registration using the parameters I sent. On two different systems it doesn't work for me (whereas the exact same settings in 4.5.0-1 work just fine). 

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 23:04 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

> Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

Yes, they are quite different. ROI selection only affects sampling, while larger input volumes make everything slower, for example resampling (that is I think performed after each registration phase). For example, if you don’t crop the volume then registration takes 150sec for non-cropped inputs; 80sec for cropped inputs.

 

> In 4.5.0-1 I did not have that high memory usage ever. 

 

ITK and BRAINS is constantly improved. Usually the goal is to improve registration accuracy and memory use and performance are secondary. Hans Johnson can comment on what and how exactly changed since November 2016 and what justified the changes.

 

> In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

I didn’t experience any lockup. How much physical memory do you have and how much virtual memory have you configured?

 

> The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

We always use sampling because using more than 5-10% of the voxels usually don’t improve results considerably. I got visually nice results using 5% (Percentage of samples: 0.05).

 

Andras

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 22:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Thanks for looking at it and giving the tips. Couple questions

 

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

In 4.5.0-1 I did not have that high memory usage ever. 

 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

Thanks for your help so far

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 22:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Matthew Anthony Mouawad
In reply to this post by Matthew Anthony Mouawad
Sorry for that previous basically blank email, my phone decided to send that for no apparent reason. 

I will try your settings when I get to work but I think the point more is that I was able to do something in a previous version of slicer and now I can no longer do that exact same thing on two different machines. It doesn't seem right that I basically can't sample above a certain threshold which will depend heavily on the type of image (not to mention I get different exceptions when I change other parameters from the default). 

For now I will probably stick to 4.5.0 for my purposes and try to find out what exactly is wrong in the new version (whether it's a bad install maybe or something that was changed in the new version) 


-------- Original message --------
From: Andras Lasso <[hidden email]>
Date: 2017-02-28 07:21 (GMT-05:00)
To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

I’ve registered using default “General registration (BRAINS)” module settings, just changed those parameters that I described. You can adjust sampling rate by “Percentage of samples” parameter. Have you tried registration using the GUI, setting the parameters that I recommended?

 

The amount of memory you have should be enough.

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 28, 2017 7:16
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

In terms of memory I have 16gb physical and if I recall about 32 virtual but may be wrong. 

 

I understand that for a lot of cases using a low sampling is fine but when the difference between images becomes much larger higher sampling may be needed. As of now, I can't really change the default sampling without getting an exception from brainsfit. 

 

I'm surprised that you were able to successfully preform a registration using the parameters I sent. On two different systems it doesn't work for me (whereas the exact same settings in 4.5.0-1 work just fine). 

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 23:04 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

> Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

Yes, they are quite different. ROI selection only affects sampling, while larger input volumes make everything slower, for example resampling (that is I think performed after each registration phase). For example, if you don’t crop the volume then registration takes 150sec for non-cropped inputs; 80sec for cropped inputs.

 

> In 4.5.0-1 I did not have that high memory usage ever. 

 

ITK and BRAINS is constantly improved. Usually the goal is to improve registration accuracy and memory use and performance are secondary. Hans Johnson can comment on what and how exactly changed since November 2016 and what justified the changes.

 

> In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

I didn’t experience any lockup. How much physical memory do you have and how much virtual memory have you configured?

 

> The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

We always use sampling because using more than 5-10% of the voxels usually don’t improve results considerably. I got visually nice results using 5% (Percentage of samples: 0.05).

 

Andras

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 22:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Thanks for looking at it and giving the tips. Couple questions

 

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

In 4.5.0-1 I did not have that high memory usage ever. 

 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

Thanks for your help so far

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 22:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Matthew Anthony Mouawad
In reply to this post by Matthew Anthony Mouawad

I will see what I can do when I get to work. I’ll throw something together.

 

From: Steve Pieper [mailto:[hidden email]]
Sent: February 28, 2017 7:25 AM
To: Matthew Anthony Mouawad <[hidden email]>
Cc: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: [slicer-users] Potential bug in slicer 4.6.2

 

Hi Matthew - 

 

Would you be able to create a small self contained test script using public sample data that demonstrates the issues you are seeing?  That would help the investigation.

 

Best,

Steve

 

On Tue, Feb 28, 2017 at 7:16 AM, Matthew Anthony Mouawad <[hidden email]> wrote:

In terms of memory I have 16gb physical and if I recall about 32 virtual but may be wrong. 

 

I understand that for a lot of cases using a low sampling is fine but when the difference between images becomes much larger higher sampling may be needed. As of now, I can't really change the default sampling without getting an exception from brainsfit. 

 

I'm surprised that you were able to successfully preform a registration using the parameters I sent. On two different systems it doesn't work for me (whereas the exact same settings in 4.5.0-1 work just fine). 

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 23:04 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

> Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

Yes, they are quite different. ROI selection only affects sampling, while larger input volumes make everything slower, for example resampling (that is I think performed after each registration phase). For example, if you don’t crop the volume then registration takes 150sec for non-cropped inputs; 80sec for cropped inputs.

 

> In 4.5.0-1 I did not have that high memory usage ever. 

 

ITK and BRAINS is constantly improved. Usually the goal is to improve registration accuracy and memory use and performance are secondary. Hans Johnson can comment on what and how exactly changed since November 2016 and what justified the changes.

 

> In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

I didn’t experience any lockup. How much physical memory do you have and how much virtual memory have you configured?

 

> The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

We always use sampling because using more than 5-10% of the voxels usually don’t improve results considerably. I got visually nice results using 5% (Percentage of samples: 0.05).

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 27, 2017 22:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Thanks for looking at it and giving the tips. Couple questions

 

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

In 4.5.0-1 I did not have that high memory usage ever. 

 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

Thanks for your help so far

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 22:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Andras Lasso-2
In reply to this post by Matthew Anthony Mouawad

You can set any percentage of samples, that should be no problem. Just use “Percentage of samples” parameter and don’t use the deprecated absolute number of samples parameter (that parameter may not be tested anymore and may not work as expected). Report us if you find any way of reliably reproducing a crash using publicly available data.

 

ITK and BRAINS is constantly developed and sometimes behavior is significantly changed, overall for the better. It may be annoying that you need to determine registration parameters again, but such breaking changes only occur in every 10 years or so.

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 28, 2017 7:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Sorry for that previous basically blank email, my phone decided to send that for no apparent reason. 

 

I will try your settings when I get to work but I think the point more is that I was able to do something in a previous version of slicer and now I can no longer do that exact same thing on two different machines. It doesn't seem right that I basically can't sample above a certain threshold which will depend heavily on the type of image (not to mention I get different exceptions when I change other parameters from the default). 

 

For now I will probably stick to 4.5.0 for my purposes and try to find out what exactly is wrong in the new version (whether it's a bad install maybe or something that was changed in the new version) 

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-28 07:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve registered using default “General registration (BRAINS)” module settings, just changed those parameters that I described. You can adjust sampling rate by “Percentage of samples” parameter. Have you tried registration using the GUI, setting the parameters that I recommended?

 

The amount of memory you have should be enough.

 

Andras

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 28, 2017 7:16
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

In terms of memory I have 16gb physical and if I recall about 32 virtual but may be wrong. 

 

I understand that for a lot of cases using a low sampling is fine but when the difference between images becomes much larger higher sampling may be needed. As of now, I can't really change the default sampling without getting an exception from brainsfit. 

 

I'm surprised that you were able to successfully preform a registration using the parameters I sent. On two different systems it doesn't work for me (whereas the exact same settings in 4.5.0-1 work just fine). 

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 23:04 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

> Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

Yes, they are quite different. ROI selection only affects sampling, while larger input volumes make everything slower, for example resampling (that is I think performed after each registration phase). For example, if you don’t crop the volume then registration takes 150sec for non-cropped inputs; 80sec for cropped inputs.

 

> In 4.5.0-1 I did not have that high memory usage ever. 

 

ITK and BRAINS is constantly improved. Usually the goal is to improve registration accuracy and memory use and performance are secondary. Hans Johnson can comment on what and how exactly changed since November 2016 and what justified the changes.

 

> In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

I didn’t experience any lockup. How much physical memory do you have and how much virtual memory have you configured?

 

> The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

We always use sampling because using more than 5-10% of the voxels usually don’t improve results considerably. I got visually nice results using 5% (Percentage of samples: 0.05).

 

Andras

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 22:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Thanks for looking at it and giving the tips. Couple questions

 

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

In 4.5.0-1 I did not have that high memory usage ever. 

 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

Thanks for your help so far

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 22:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Matthew Anthony Mouawad
In reply to this post by Matthew Anthony Mouawad

As a start, here is a simple test I ran on my home computer with the newest version of slicer 4.6.2 (downloaded on Saturday) running on windows 10 with 16gb of physical ram and 3594mb virtual:

 

  1. Using the sample data module, download MRBrainTumor1 and MRBrainTumor2
  2. Set 1 as fixed and 2 as moving.
  3. Parameters  not left at default: useGeometryALign, Rigid+affine+bspline, windowedsinc interpolation
  4. “Percentage of samples” (NOT THE DEPRACTED SAMPLES) was changed from the following 3 cases:
    1. Default of 0.002 – registration completed with no errors
    2. 0.01 – registration completed with no errors
    3. 0.1 – registration completed with errors (see last line of attached log)

I haven’t even started to touch the bspline grid size or any other parameters and already I am getting an exception. My total lock up most likely comes from the exorbitant amount of memory that is used as I increase bot the bspline grid size and the percentage of samples higher and higher (eventually using all the memory my computer has). I can test how far I can go at work if needed but clearly there is already an issue here. I understand the idea that things change as the years go by and I have no problems with that! I just want to be able to explore the best case scenario for my data which requires manipulation of the parameters (which I was able to do in the previous version).

 

I am not a programmer and know very little about the internal workings of slicer but my guess into what the problem is, is that it has to do with how the new version of slicer’s brainsfit handles memory. The problems I am seeing are most likely tied to the amount of memory available (so if your computer andras has more memory than mine, it may be why you did not see the issue – just a guess).

 

Any other information needed let me know

 

From: Matthew Anthony Mouawad
Sent: February 28, 2017 7:37 AM
To: 'Steve Pieper' <[hidden email]>
Cc: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: [slicer-users] Potential bug in slicer 4.6.2

 

I will see what I can do when I get to work. I’ll throw something together.

 

From: Steve Pieper [[hidden email]]
Sent: February 28, 2017 7:25 AM
To: Matthew Anthony Mouawad <[hidden email]>
Cc: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: [slicer-users] Potential bug in slicer 4.6.2

 

Hi Matthew - 

 

Would you be able to create a small self contained test script using public sample data that demonstrates the issues you are seeing?  That would help the investigation.

 

Best,

Steve

 

On Tue, Feb 28, 2017 at 7:16 AM, Matthew Anthony Mouawad <[hidden email]> wrote:

In terms of memory I have 16gb physical and if I recall about 32 virtual but may be wrong. 

 

I understand that for a lot of cases using a low sampling is fine but when the difference between images becomes much larger higher sampling may be needed. As of now, I can't really change the default sampling without getting an exception from brainsfit. 

 

I'm surprised that you were able to successfully preform a registration using the parameters I sent. On two different systems it doesn't work for me (whereas the exact same settings in 4.5.0-1 work just fine). 

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 23:04 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

> Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

Yes, they are quite different. ROI selection only affects sampling, while larger input volumes make everything slower, for example resampling (that is I think performed after each registration phase). For example, if you don’t crop the volume then registration takes 150sec for non-cropped inputs; 80sec for cropped inputs.

 

> In 4.5.0-1 I did not have that high memory usage ever. 

 

ITK and BRAINS is constantly improved. Usually the goal is to improve registration accuracy and memory use and performance are secondary. Hans Johnson can comment on what and how exactly changed since November 2016 and what justified the changes.

 

> In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

I didn’t experience any lockup. How much physical memory do you have and how much virtual memory have you configured?

 

> The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

We always use sampling because using more than 5-10% of the voxels usually don’t improve results considerably. I got visually nice results using 5% (Percentage of samples: 0.05).

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 27, 2017 22:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Thanks for looking at it and giving the tips. Couple questions

 

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

In 4.5.0-1 I did not have that high memory usage ever. 

 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

Thanks for your help so far

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 22:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ

Slicer_25516_20170228_080220.log (120K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Andras Lasso-2
In reply to this post by Matthew Anthony Mouawad

Use latest nightly build, enable “Prefer executable CLIs” in the application settings, set 32GB virtual memory, and report if you still get the error.

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 28, 2017 8:24
To: Steve Pieper <[hidden email]>
Cc: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: [slicer-users] Potential bug in slicer 4.6.2

 

As a start, here is a simple test I ran on my home computer with the newest version of slicer 4.6.2 (downloaded on Saturday) running on windows 10 with 16gb of physical ram and 3594mb virtual:

 

  1. Using the sample data module, download MRBrainTumor1 and MRBrainTumor2
  2. Set 1 as fixed and 2 as moving.
  3. Parameters  not left at default: useGeometryALign, Rigid+affine+bspline, windowedsinc interpolation
  4. “Percentage of samples” (NOT THE DEPRACTED SAMPLES) was changed from the following 3 cases:
    1. Default of 0.002 – registration completed with no errors
    2. 0.01 – registration completed with no errors
    3. 0.1 – registration completed with errors (see last line of attached log)

I haven’t even started to touch the bspline grid size or any other parameters and already I am getting an exception. My total lock up most likely comes from the exorbitant amount of memory that is used as I increase bot the bspline grid size and the percentage of samples higher and higher (eventually using all the memory my computer has). I can test how far I can go at work if needed but clearly there is already an issue here. I understand the idea that things change as the years go by and I have no problems with that! I just want to be able to explore the best case scenario for my data which requires manipulation of the parameters (which I was able to do in the previous version).

 

I am not a programmer and know very little about the internal workings of slicer but my guess into what the problem is, is that it has to do with how the new version of slicer’s brainsfit handles memory. The problems I am seeing are most likely tied to the amount of memory available (so if your computer andras has more memory than mine, it may be why you did not see the issue – just a guess).

 

Any other information needed let me know

 

From: Matthew Anthony Mouawad
Sent: February 28, 2017 7:37 AM
To: 'Steve Pieper' <[hidden email]>
Cc: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: [slicer-users] Potential bug in slicer 4.6.2

 

I will see what I can do when I get to work. I’ll throw something together.

 

From: Steve Pieper [[hidden email]]
Sent: February 28, 2017 7:25 AM
To: Matthew Anthony Mouawad <[hidden email]>
Cc: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: [slicer-users] Potential bug in slicer 4.6.2

 

Hi Matthew - 

 

Would you be able to create a small self contained test script using public sample data that demonstrates the issues you are seeing?  That would help the investigation.

 

Best,

Steve

 

On Tue, Feb 28, 2017 at 7:16 AM, Matthew Anthony Mouawad <[hidden email]> wrote:

In terms of memory I have 16gb physical and if I recall about 32 virtual but may be wrong. 

 

I understand that for a lot of cases using a low sampling is fine but when the difference between images becomes much larger higher sampling may be needed. As of now, I can't really change the default sampling without getting an exception from brainsfit. 

 

I'm surprised that you were able to successfully preform a registration using the parameters I sent. On two different systems it doesn't work for me (whereas the exact same settings in 4.5.0-1 work just fine). 

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 23:04 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

> Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

Yes, they are quite different. ROI selection only affects sampling, while larger input volumes make everything slower, for example resampling (that is I think performed after each registration phase). For example, if you don’t crop the volume then registration takes 150sec for non-cropped inputs; 80sec for cropped inputs.

 

> In 4.5.0-1 I did not have that high memory usage ever. 

 

ITK and BRAINS is constantly improved. Usually the goal is to improve registration accuracy and memory use and performance are secondary. Hans Johnson can comment on what and how exactly changed since November 2016 and what justified the changes.

 

> In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

I didn’t experience any lockup. How much physical memory do you have and how much virtual memory have you configured?

 

> The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

We always use sampling because using more than 5-10% of the voxels usually don’t improve results considerably. I got visually nice results using 5% (Percentage of samples: 0.05).

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 27, 2017 22:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Thanks for looking at it and giving the tips. Couple questions

 

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

In 4.5.0-1 I did not have that high memory usage ever. 

 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

Thanks for your help so far

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 22:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Training Data

Sharp, Gregory C.
In reply to this post by fred nightser

Hi Fred,

 

Can you send me a link where you found this?

 

Greg

 

From: slicer-users [mailto:[hidden email]] On Behalf Of fred nightser
Sent: Tuesday, February 28, 2017 12:47 AM
To: SPL Slicer Users
Subject: [slicer-users] Training Data

 

Hi,

I am a new user here and going through training modules and seeing that some of the presentations that have links in them for training data are no longer valid. Is there a place where such data is placed. One in particular I'm trying to do is the Dose Accumulation for Adaptive Radiotherapy. Upon opening up presentation and seeing link for data, you get page not found when clicking on link for data.

Thanks in advance for any help with this.

 

Fred

 


 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Matthew Anthony Mouawad
In reply to this post by Matthew Anthony Mouawad

Alright quick update

 

I have run the exact same experiment as before in the nightly version. I also checked, the “prefer executable CLI” is enabled by default in both the nightly at 4.6.2 – don’t know about 4.5.0-1.

 

I am going to focus specifically on using a percentage of samples of 0.1%

 

In 4.6.2 it uses ~99% of my memory max (physical = 16gb, virtual page 32gb)

 

For the exact same image and parameter set in nightly it uses ~31% max which is what I approximately see in 4.5.0-1.

 

Where this discrepancy occurs I do not know. But there is one. Both the 4.6.2 and nightly were done on a windows 10 computer this morning with a completely fresh install (i.e., no older versions).

 

If any other information is needed please let me know

 

From: Andras Lasso [mailto:[hidden email]]
Sent: February 28, 2017 8:36 AM
To: Matthew Anthony Mouawad <[hidden email]>; Steve Pieper <[hidden email]>
Cc: SPL Slicer Users <[hidden email]>
Subject: RE: [slicer-users] Potential bug in slicer 4.6.2

 

Use latest nightly build, enable “Prefer executable CLIs” in the application settings, set 32GB virtual memory, and report if you still get the error.

 

Andras

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 28, 2017 8:24
To: Steve Pieper <[hidden email]>
Cc: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: [slicer-users] Potential bug in slicer 4.6.2

 

As a start, here is a simple test I ran on my home computer with the newest version of slicer 4.6.2 (downloaded on Saturday) running on windows 10 with 16gb of physical ram and 3594mb virtual:

 

  1. Using the sample data module, download MRBrainTumor1 and MRBrainTumor2
  2. Set 1 as fixed and 2 as moving.
  3. Parameters  not left at default: useGeometryALign, Rigid+affine+bspline, windowedsinc interpolation
  4. “Percentage of samples” (NOT THE DEPRACTED SAMPLES) was changed from the following 3 cases:
    1. Default of 0.002 – registration completed with no errors
    2. 0.01 – registration completed with no errors
    3. 0.1 – registration completed with errors (see last line of attached log)

I haven’t even started to touch the bspline grid size or any other parameters and already I am getting an exception. My total lock up most likely comes from the exorbitant amount of memory that is used as I increase bot the bspline grid size and the percentage of samples higher and higher (eventually using all the memory my computer has). I can test how far I can go at work if needed but clearly there is already an issue here. I understand the idea that things change as the years go by and I have no problems with that! I just want to be able to explore the best case scenario for my data which requires manipulation of the parameters (which I was able to do in the previous version).

 

I am not a programmer and know very little about the internal workings of slicer but my guess into what the problem is, is that it has to do with how the new version of slicer’s brainsfit handles memory. The problems I am seeing are most likely tied to the amount of memory available (so if your computer andras has more memory than mine, it may be why you did not see the issue – just a guess).

 

Any other information needed let me know

 

From: Matthew Anthony Mouawad
Sent: February 28, 2017 7:37 AM
To: 'Steve Pieper' <[hidden email]>
Cc: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: [slicer-users] Potential bug in slicer 4.6.2

 

I will see what I can do when I get to work. I’ll throw something together.

 

From: Steve Pieper [[hidden email]]
Sent: February 28, 2017 7:25 AM
To: Matthew Anthony Mouawad <[hidden email]>
Cc: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: [slicer-users] Potential bug in slicer 4.6.2

 

Hi Matthew - 

 

Would you be able to create a small self contained test script using public sample data that demonstrates the issues you are seeing?  That would help the investigation.

 

Best,

Steve

 

On Tue, Feb 28, 2017 at 7:16 AM, Matthew Anthony Mouawad <[hidden email]> wrote:

In terms of memory I have 16gb physical and if I recall about 32 virtual but may be wrong. 

 

I understand that for a lot of cases using a low sampling is fine but when the difference between images becomes much larger higher sampling may be needed. As of now, I can't really change the default sampling without getting an exception from brainsfit. 

 

I'm surprised that you were able to successfully preform a registration using the parameters I sent. On two different systems it doesn't work for me (whereas the exact same settings in 4.5.0-1 work just fine). 

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 23:04 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

> Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

Yes, they are quite different. ROI selection only affects sampling, while larger input volumes make everything slower, for example resampling (that is I think performed after each registration phase). For example, if you don’t crop the volume then registration takes 150sec for non-cropped inputs; 80sec for cropped inputs.

 

> In 4.5.0-1 I did not have that high memory usage ever. 

 

ITK and BRAINS is constantly improved. Usually the goal is to improve registration accuracy and memory use and performance are secondary. Hans Johnson can comment on what and how exactly changed since November 2016 and what justified the changes.

 

> In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

I didn’t experience any lockup. How much physical memory do you have and how much virtual memory have you configured?

 

> The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

We always use sampling because using more than 5-10% of the voxels usually don’t improve results considerably. I got visually nice results using 5% (Percentage of samples: 0.05).

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 27, 2017 22:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Thanks for looking at it and giving the tips. Couple questions

 

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

In 4.5.0-1 I did not have that high memory usage ever. 

 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

Thanks for your help so far

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 22:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Potential bug in slicer 4.6.2

Andras Lasso-2
In reply to this post by Matthew Anthony Mouawad

Thanks for the info. It seems that whatever problem was in 4.6.2 is fixed in the nightly. Keep using the nightly and let us know if you run into any other problems.

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 28, 2017 9:12
To: Andras Lasso <[hidden email]>; Steve Pieper <[hidden email]>
Cc: SPL Slicer Users <[hidden email]>
Subject: RE: [slicer-users] Potential bug in slicer 4.6.2

 

Alright quick update

 

I have run the exact same experiment as before in the nightly version. I also checked, the “prefer executable CLI” is enabled by default in both the nightly at 4.6.2 – don’t know about 4.5.0-1.

 

I am going to focus specifically on using a percentage of samples of 0.1%

 

In 4.6.2 it uses ~99% of my memory max (physical = 16gb, virtual page 32gb)

 

For the exact same image and parameter set in nightly it uses ~31% max which is what I approximately see in 4.5.0-1.

 

Where this discrepancy occurs I do not know. But there is one. Both the 4.6.2 and nightly were done on a windows 10 computer this morning with a completely fresh install (i.e., no older versions).

 

If any other information is needed please let me know

 

From: Andras Lasso [[hidden email]]
Sent: February 28, 2017 8:36 AM
To: Matthew Anthony Mouawad <[hidden email]>; Steve Pieper <[hidden email]>
Cc: SPL Slicer Users <[hidden email]>
Subject: RE: [slicer-users] Potential bug in slicer 4.6.2

 

Use latest nightly build, enable “Prefer executable CLIs” in the application settings, set 32GB virtual memory, and report if you still get the error.

 

Andras

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 28, 2017 8:24
To: Steve Pieper <[hidden email]>
Cc: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: [slicer-users] Potential bug in slicer 4.6.2

 

As a start, here is a simple test I ran on my home computer with the newest version of slicer 4.6.2 (downloaded on Saturday) running on windows 10 with 16gb of physical ram and 3594mb virtual:

 

  1. Using the sample data module, download MRBrainTumor1 and MRBrainTumor2
  2. Set 1 as fixed and 2 as moving.
  3. Parameters  not left at default: useGeometryALign, Rigid+affine+bspline, windowedsinc interpolation
  4. “Percentage of samples” (NOT THE DEPRACTED SAMPLES) was changed from the following 3 cases:
    1. Default of 0.002 – registration completed with no errors
    2. 0.01 – registration completed with no errors
    3. 0.1 – registration completed with errors (see last line of attached log)

I haven’t even started to touch the bspline grid size or any other parameters and already I am getting an exception. My total lock up most likely comes from the exorbitant amount of memory that is used as I increase bot the bspline grid size and the percentage of samples higher and higher (eventually using all the memory my computer has). I can test how far I can go at work if needed but clearly there is already an issue here. I understand the idea that things change as the years go by and I have no problems with that! I just want to be able to explore the best case scenario for my data which requires manipulation of the parameters (which I was able to do in the previous version).

 

I am not a programmer and know very little about the internal workings of slicer but my guess into what the problem is, is that it has to do with how the new version of slicer’s brainsfit handles memory. The problems I am seeing are most likely tied to the amount of memory available (so if your computer andras has more memory than mine, it may be why you did not see the issue – just a guess).

 

Any other information needed let me know

 

From: Matthew Anthony Mouawad
Sent: February 28, 2017 7:37 AM
To: 'Steve Pieper' <[hidden email]>
Cc: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: [slicer-users] Potential bug in slicer 4.6.2

 

I will see what I can do when I get to work. I’ll throw something together.

 

From: Steve Pieper [[hidden email]]
Sent: February 28, 2017 7:25 AM
To: Matthew Anthony Mouawad <[hidden email]>
Cc: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: [slicer-users] Potential bug in slicer 4.6.2

 

Hi Matthew - 

 

Would you be able to create a small self contained test script using public sample data that demonstrates the issues you are seeing?  That would help the investigation.

 

Best,

Steve

 

On Tue, Feb 28, 2017 at 7:16 AM, Matthew Anthony Mouawad <[hidden email]> wrote:

In terms of memory I have 16gb physical and if I recall about 32 virtual but may be wrong. 

 

I understand that for a lot of cases using a low sampling is fine but when the difference between images becomes much larger higher sampling may be needed. As of now, I can't really change the default sampling without getting an exception from brainsfit. 

 

I'm surprised that you were able to successfully preform a registration using the parameters I sent. On two different systems it doesn't work for me (whereas the exact same settings in 4.5.0-1 work just fine). 

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 23:04 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

> Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

Yes, they are quite different. ROI selection only affects sampling, while larger input volumes make everything slower, for example resampling (that is I think performed after each registration phase). For example, if you don’t crop the volume then registration takes 150sec for non-cropped inputs; 80sec for cropped inputs.

 

> In 4.5.0-1 I did not have that high memory usage ever. 

 

ITK and BRAINS is constantly improved. Usually the goal is to improve registration accuracy and memory use and performance are secondary. Hans Johnson can comment on what and how exactly changed since November 2016 and what justified the changes.

 

> In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

I didn’t experience any lockup. How much physical memory do you have and how much virtual memory have you configured?

 

> The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

We always use sampling because using more than 5-10% of the voxels usually don’t improve results considerably. I got visually nice results using 5% (Percentage of samples: 0.05).

 

Andras

 

From: Matthew Anthony Mouawad [mailto:[hidden email]]
Sent: February 27, 2017 22:31
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: Re: Potential bug in slicer 4.6.2

 

Thanks for looking at it and giving the tips. Couple questions

 

Is there any difference between cropping a volume and leaving the volume as it and using an roi mask? 

 

In 4.5.0-1 I did not have that high memory usage ever. 

 

In my original email I mentioned using a python script that looped over the moving images. When I do that the whole thing locks up my computer but this does not occur in 4.5.0-1

 

The newest slicer version throws exceptions when I use sampling that isn't the default (tested at 0.09 as mentioned) 

 

Thanks for your help so far

 

 

-------- Original message --------

From: Andras Lasso <[hidden email]>

Date: 2017-02-27 22:21 (GMT-05:00)

To: Matthew Anthony Mouawad <[hidden email]>, SPL Slicer Users <[hidden email]>

Subject: RE: Potential bug in slicer 4.6.2

 

I’ve received data from Matthew and found the followings.

 

Large memory usage is normal when Mattes mutual information (MMI) metric is used and there are a large number of parameters to optimize. For example:

bspline grid size 8,8,8 => 2.5GB memory is needed

bspline grid size 16,16,16 => 10GB memory is needed

 

Bspline grid size 8,8,8 seems to be enough for your images. You only get slight improvement with more grid points in areas where there is a lot of deformation (near the chest wall), but probably those areas are not relevant. I would recommend using 8x8x8.

 

To make registration faster and consume less memory, crop both your input volumes approximately to the size of the mask using Crop volume module.

 

Your fixed and moving images are of the same imaging modality, so correlation-based metrics could be usable. However, in the bright region in the center of the breast correlation-based metrics don’t perform very well (intensities are not matching). So, despite MMI is slower than correlation-based metrics and requires 10x more memory, I would still recommend using MMI metric.

 

Rigid, affine, bspline registration phases make sense, use that.

 

Masking helps a bit. Choose: Masking option: ROI; (ROI) Masking input fixed: Smoothed; (ROI) Masking input moving: Smoothed.

 

I didn’t see much improvement when I increased sample percentage about 5%. So, I would recommend Percentage of samples: 0.05.

 

Using these parameters, registration completes in about 80 sec, which is about average for deformable registration of MRIs.

 

Andras

 

 

From: Matthew Anthony Mouawad [[hidden email]]
Sent: February 27, 2017 13:06
To: Andras Lasso <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

That is what I did at the end just briefly with percentage of samples and it actually threw an exception as I pasted at the bottom. I would rather not send the data sets out to the entire mailing list but if there is someone who wouldn’t mind taking the time to try out a set I could send it to them

 

From: Andras Lasso [[hidden email]]
Sent: Monday, February 27, 2017 12:59 PM
To: Matthew Anthony Mouawad <[hidden email]>; SPL Slicer Users <[hidden email]>
Subject: RE: Potential bug in slicer 4.6.2

 

I would recommend to run General registration (BRAINS) module from the GUI using default options. It should not use excessive amount of memory. Then, modify parameters one-by-one and you’ll see what parameters makes your memory needs explode. You can also send us (anonymized or phantom) data sets and parameters that you’ve tried to use and we’ll try to reproduce & fix the problem.

 

Andras

 

From: slicer-users [[hidden email]] On Behalf Of Matthew Anthony Mouawad
Sent: February 27, 2017 12:07
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Potential bug in slicer 4.6.2

 

Hi everyone,

 

I recently upgraded to slicer 4.6.2 to stay recent. I am using the brainsfit module to do registration for images. I was using 4.5.0-1 originally. My script is very simple (though terribly written as I am learning to program as I program) – it grabs the nodes for each image I was to register, grabs the fixed image node, grabs the ROI node, sets the common parameters I want to use, then runs brainsfit using the following command :

 

slicer.modules.brainsfit,None,parametersReg,wait_for_completion=True

 

This is all done in a loop i.e., it grabs the first moving image node and feeds that through, waits until done, then using the next moving image node. In 4.5.0-1 the script I used worked though I would always get a warning from brainsfit (even if I used the GUI):

 

WARNING: In ..\..\..\..\..\ITKv4\Modules\Numerics\Optimizersv4\src\itkLBFGSBOptimizerv4.cxx, line 116

LBFGSBOptimizerv4 (0000000063E3E820): LBFGSB optimizer does not support scaling. All scales are set to one.

 

Which I never figured out what it meant but it didn’t seem to be affecting anything. It is also present in the new version of slicer as far as I can tell.

 

In the new version of slicer, following the exact some process that I did in 4.5.0-1 with my script (load, input commands into python prompt and run), my entire computer locks up and I have to do a hard shut down. Preceding this, the amount of memory that is used is also incredibly different. In 4.5.0-1, it doesn’t seem to have a very big affect on memory usage when I register them. When I register in 4.6.2 the memory usage is almost 12 gigs (with the same amount of images loaded) and keeps growing. I also get a “completed with errors message” (see attached log and see attached parameters for script that I have used in both versions)

 

In order to test and find where the error is occurring I used the GUI in both version to compare outputs/memory usage, and then used my script on a single image registration in both version to compare.

 

GUI

If I use the GUI in 4.6.2 my computer doesn’t completely lock up but again the memory usage difference from 4.5.0-1 to 4.6.2 is immense (~33%  of my entire memory in 4.5.0-1 to >93-100% in 4.6.2). Also see error log

In terms of the output to the log messages:

In 4.5.0-1 there is a “found SharedObject module …”, then the warning I posted above, then an output message from the Qt stream that shows the outputs of the registration. (NOTE THIS IS THE EXACT SAME SEQUENCE OF OUTPUTS I GET WHEN I USE MY SCRIPT – see second attachement that is the main function to loop through the moving list)

 

In 4.6.2 – I originally just ran this with most of the default parameters and it provided an output.

 

Parameters: moving and fixed image, all the rest of the parameters default except usegeometryalign, BSpline, windowedsinc interpolation

 

I then ran it with 0.09 percentage of samples (otherwise the same as above) and got an exception:

 

EXCEPTION

 

Exception occurred during SingleMethodExecute

bad allocation

 

At this point I realized that it may be a parameter issue. I don’t have the time to test every single permutation of parameters but note that in running my script I got the last attachements exceptions. For now I am going to revert back to 4.5.0-1 but I would not mind helping to find out what the issue is. I also ran 4.6.2 on my home computer using my scripts but instead of it completely locking my computer, I got a brainsfit crash message but slicer continued to run

 

I know there is a ton of information in this email but I wanted to try and give as much as possible to figure out what happened. If any of it is unclear or needs clarifications don’t hesitate to ask me. I can provide more info if needed.

 

 

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ

 


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
12